04.12.2012, 09:42
This should work.
The params will be <name cash>, there is no such a file with name cash.ini. What the message [Admin-Warning] should do, because I left it.
pawn Код:
CMD:osetcash(playerid,params[])
{
if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SCM(playerid, COLOR_LIGHTRED,"You are not authorized to use this command");
new
_name[ 24 ],
_cash
;
if(sscanf(params, "s[24]d", _name, _cash)) return SCM(playerid, COLOR_LIGHTRED,"Usage: /osetcash <Name> <Cash>");
new
string[ 32 ]
;
format(string,sizeof(string),"Users/%s.ini",_name);
if(fexist(string))
{
new INI:File = INI_Open(string);
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash", _cash);
INI_Close(File);
// I don't really understand that message
}
else SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}..::{FF6347}[Database]:Account not found{FF0000}::..");
return 1;
}