Blockland Forums > Modification Help
(new problem) Save and Load (server sided)
xcruso:
Hey anyone have a idea how to make for example adding clan tag to the client with the FindClientByName(%name).clanSuffix and save it when they leave and load it automatic when they join.
And the way to remove it again.
Anyone?
:cookie:
PurpleMetro:
Well idk the full code but you could try making a script add a variable when the player joins and stuff...
And when the player joins again the variable will be searched and found and executed and stuff....
To remove all you do is remove the variable lolz.
DrenDran:
--- Code: ---function changeclantag(%client,%target,%clantag)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
%target = findclientbyname(%target);
if(isObject(%target))
{
%target.clanprefix = %clantag;
$clantags[%target.bl_id] = %clantag;
export("$clantags*","config/server/clantags.cs");
}
else
messageclient(%client,'',"\c6No user was found by that name.");
}
else
messageclient(%client,'',"\c6You must be admin to change other people's clan tags.");
}
--- End code ---
That's your changing function code.
--- Code: ---package clantagchanger
{
function GameConnection::AutoAdminCheck(%client)
{
Parent::AutoAdminCheck(%client);
if(strlen($clantags[%client.bl_id]) > 0)
%client.clanprefix = $clantags[%client.bl_id];
}
};
activatepackage(clantagchanger);
--- End code ---
And that changes people tags to what you set when they join.
I just typed this up now.
Have no idea if it works.
And sorry for the lack of indentation, these forums won't let me do it.
xcruso:
--- Quote from: DrenDran on September 05, 2011, 02:35:57 PM ---
--- Code: ---function changeclantag(%client,%target,%clantag)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
%target = findclientbyname(%target);
if(isObject(%target))
{
%target.clanprefix = %clantag;
$clantags[%target.bl_id] = %clantag;
export("$clantags*","config/server/clantags.cs");
}
else
messageclient(%client,'',"\c6No user was found by that name.");
}
else
messageclient(%client,'',"\c6You must be admin to change other people's clan tags.");
}
--- End code ---
That's your changing function code.
--- Code: ---package clantagchanger
{
function GameConnection::AutoAdminCheck(%client)
{
Parent::AutoAdminCheck(%client);
if(strlen($clantags[%client.bl_id]) > 0)
%client.clanprefix = $clantags[%client.bl_id];
}
};
activatepackage(clantagchanger);
--- End code ---
And that changes people tags to what you set when they join.
I just typed this up now.
Have no idea if it works.
And sorry for the lack of indentation, these forums won't let me do it.
--- End quote ---
Thanks, havent tested yet busy with other things.
xcruso:
Ok, i got a new Problem, the clan tag is getting removed after restarting the game, any idea to fix that?