14.04.2013, 09:42
Hello!
I have a new command /givecash for players, so players can do /givecash [playerid] [amount] to give his cash to someone...But it doesn't work -.-
Can someone fix it?
Code:
I get no errors or warnings...Thanks for your help
I have a new command /givecash for players, so players can do /givecash [playerid] [amount] to give his cash to someone...But it doesn't work -.-
Can someone fix it?
Code:
PHP код:
CMD:givecash(playerid, params[])
{
new targetid, cash, string[160];
if(sscanf(params, "u", targetid, cash))return SendClientMessage(playerid, -1, "Usage: /givecash [playerid] [amount]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "ERROR: This Player is Not Connected.");
GivePlayerMoney(targetid, cash);
if(GetPlayerMoney(playerid) <= cash )return SendClientMessage(playerid, -1, "ERROR: You Don't Have Enough Money");
format(string, sizeof(string), "[INFO]: %s Has Given $%d Cash To %s", GetName(playerid), cash, GetName(targetid));
SendClientMessageToAll(-1, string);
return 1;
}