18.03.2013, 02:54
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);
}
EDIT - also this is ZCMD - not sure how OCMD works with writing commands but the body is the same reguardless.