Quote:
Originally Posted by Dwane
This should work.
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; }
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.
|
i add that message line to tell all admin that one of admin uses the command to a player.This is to prevent admin to abuse their power.We can know admin uses the important command to abuse or in a legal way.Anyway thanks to all who help me and i'm learning much from Cassbra lol Thank you very much