#7

pawn Код:
CMD:rob(playerid, params[])
{
    new string[128], pID;
    if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "Correct usage for command is: /rob playerid");
   
    new cash = GetPlayerMoney(pID);
    new Float:steal =  cash * 0.10;
   
    format(string, sizeof(string), "You have stolen %d from ID %i", floatround(steal), pID);
    SendClientMessage(playerid, -1, string);
   
    GivePlayerMoney(playerid, floatround(steal));
    return 1;
}
This is untested, should be what you wanted, let me know if any errors or whatever.

You need ZCMD and SSCANF btw.
Reply


Messages In This Thread
Rob - by Edin Black - 12.05.2012, 15:30
Re: Rob - by Edin Black - 12.05.2012, 17:24
Re: Rob - by Faisal_khan - 12.05.2012, 17:32
Re: Rob - by thefatshizms - 12.05.2012, 17:36
Re: Rob - by Abreezy - 12.05.2012, 17:39
Re: Rob - by Edin Black - 12.05.2012, 17:40
Re: Rob - by Abreezy - 12.05.2012, 17:55
Re: Rob - by Edin Black - 12.05.2012, 18:51
Re: Rob - by Edin Black - 12.05.2012, 19:52

Forum Jump:


Users browsing this thread: 1 Guest(s)