Help with Offline set cash
#10

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
Reply


Messages In This Thread
Help with Offline set cash - by zionx08 - 04.12.2012, 08:58
Re: Help with Offline set cash - by Jarnu - 04.12.2012, 09:05
Re: Help with Offline set cash - by zionx08 - 04.12.2012, 09:25
Re: Help with Offline set cash - by cosbraa - 04.12.2012, 09:27
Re: Help with Offline set cash - by zionx08 - 04.12.2012, 09:33
Re: Help with Offline set cash - by cosbraa - 04.12.2012, 09:41
Re: Help with Offline set cash - by Konstantinos - 04.12.2012, 09:42
Re: Help with Offline set cash - by zionx08 - 04.12.2012, 09:48
Re: Help with Offline set cash - by Konstantinos - 04.12.2012, 09:52
Re: Help with Offline set cash - by zionx08 - 04.12.2012, 10:03

Forum Jump:


Users browsing this thread: 4 Guest(s)