14.09.2015, 08:28
I just cannot understand how this is wrong...
What's wrong about this code?
It says me always that the player has $0 even when the player has like 10k or smth.
What's wrong about this code?
PHP код:
CMD:getcash(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
if(PlayerInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_YELLOWGREEN, "Error: You are not authorized to use this command.");
new targetplayer;
if(sscanf(params, "i", targetplayer)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /getcash [ID]");
if(!IsPlayerConnected(targetplayer)) return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!");
new string[50], pName[MAX_PLAYER_NAME], amount;
GetPlayerName(targetplayer, pName, MAX_PLAYER_NAME);
format(string, sizeof string, "%s is currently holding $%i.", pName, amount);
GetPlayerMoney(targetplayer);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}