03.08.2011, 05:47
Yes, this is what i have
And it works :]
pawn Код:
CMD:givecash(playerid,params[])
{
new
id,
amount;
if(sscanf(params, "ud", id, amount)) SendClientMessage(playerid,COLOR_RED,"Usage: /givecash <ID> <Amount>");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Player Not Connected!");
else
{
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
GivePlayerMoney(id,amount);
new str[40+MAX_PLAYER_NAME];
format(str, sizeof(str), "You have sent %d to %s",amount,PlayerName);
SendClientMessage(playerid, COLOR_GREEN, str);
format(str, sizeof(str), "You have recieved %d from %s",amount,name);
SendClientMessage(id, COLOR_GREEN, str);
}
return 1;
}