I need to be able to save variables/info that won't erase after I shutdown my server. I know how to create and
have it write in a .txt file, but from what I'm hearing, this way is more efficient to use.
This is the demonstration we'll work with:
function serverCMDaddMoney(%client, %target, %amount)
{
%targ = findClientByName(%target);
//Just checking things here...
if(!%client.isSuperAdmin)
{
return;
}
if(!isObject(%targ))
{
%client.chatMessage("Invalid client!");
return;
}
if(%amount <= 0)
{
%client.chatMessage("Invalid amount!");
return;
}
%targ.money = %targ.money + %amount;
announce("\c3"@%targ.name@" \c6has gained \c2$"@%amount);
}
As shown, the function has the ability to add 'money' to a client. Now all I need is for it to save
so that they'll still have their money when the server restarts (or when they leave and come back).