MONEY
#8

pawn Код:
CMD:givemoney(playerid, params[])
{
    new string[56],giveplayerid,money,pname[56];
    if(sscanf(params,"ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /givemoney [playerid/name] [amount]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "The target player is not online!");
    GivePlayerMoney(giveplayerid, money);
    GetPlayerName(giveplayerid,pname,sizeof(pname));
    format(string, sizeof(string), "You have given $%d to %s (id: %d).",money,pname,giveplayerid);
    SendClientMessage(playerid, COLOR_ORANGE, string);
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string, sizeof(string), "You have been given $%d from %s (id: %d).", money,pname,playerid);
    return SendClientMessage(giveplayerid, COLOR_ORANGE, string);
}
think that should manage it - pretty simple but it'll also kinda inform the using player and the receiving player.

EDIT - also this is ZCMD - not sure how OCMD works with writing commands but the body is the same reguardless.
Reply


Messages In This Thread
MONEY - by NuggaN - 18.03.2013, 00:53
Re: MONEY - by Scenario - 18.03.2013, 00:55
Re: MONEY - by Glad2BeHere - 18.03.2013, 00:56
Re: MONEY - by Don_Cage - 18.03.2013, 01:13
Re: MONEY - by kamzaf - 18.03.2013, 01:13
Re: MONEY - by Scenario - 18.03.2013, 01:18
Re: MONEY - by NuggaN - 18.03.2013, 01:31
Re: MONEY - by CJay9209 - 18.03.2013, 02:54

Forum Jump:


Users browsing this thread: 1 Guest(s)