02.04.2015, 21:44
Somehow it doesn't give the player cash,
When I type /givemoney 0 500, I get a message displayed "An admin gave you $" It doesn't show the amount of money nor does it gives the player money.
Code:
When I type /givemoney 0 500, I get a message displayed "An admin gave you $" It doesn't show the amount of money nor does it gives the player money.
Code:
PHP код:
CMD:givemoney(playerid, params[])
{
new targetplayer, amount;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "ui", targetplayer, amount))
return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /givemoney [ID] [AMOUNT]");
if(!IsPlayerConnected(targetplayer)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
new string[100];
GivePlayerMoney(targetplayer, amount);
format(string, sizeof string, "An admin gave you $%i", amount);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else
{
SendClientMessage(playerid, -1, "SERVER: Unknown command.");
}
return 1;
}