13.07.2012, 11:59
pawn Code:
CMD:pay(playerid, params[])
{
new pID, Amount, string[256], string1[256], transmitter[MAX_PLAYER_NAME], receivers[MAX_PLAYER_NAME];
if(sscanf(params, "ud", pID, Amount)) return SendClientMessage(playerid, COLOR_WHITE, "[CMD]:/pay [PlayerID] [Amount]");
if(pID == INVALID_PLAYER_ID) SendClientMessage(playerid, red, "[ERROR]:Player not Found or Connected!");
else
{
GetPlayerName(playerid, transmitter, sizeof(transmitter));
GetPlayerName(pID, receivers, sizeof(receivers));
format(string, sizeof(string), "* [CMD]: %s has pay you $%d *", transmitter, Amount);
SendClientMessage(pID, COLOR_WHITE, string);
format(string1, sizeof(string1), "* [CMD]: You have pay $%d to %s ", Amount, receivers);
SendClientMessage(playerid, COLOR_WHITE, string1);
GivePlayerMoney(pID, Amount);
}
return 1;
}