15.08.2012, 18:03
So I'm trying to make an command that will show you a players statistics but when I press compile the pawno compiler crashes and comes up with a popup saying that it is not responding. Anyone have any ideas? Here is the code:
I am using another script as an reference but I don't know if i'm messing up completely or not.
pawn Код:
CMD:info(playerid, params[])
{
new targetid, string[128];
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /info[id]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage, COLOR_RED, "Only Administrators have access to this command.");
if( targetid != INVALID_PLAYER_ID )
{
format(string, sizeof(string),"Health: %d Armor: %d Score: %d Cash: %d",GetPlayerHealth(targetid),GetPlayerArmor(targetid),
GetPlayerScore(targetid),GetPlayerMoney(targetid);
SendClientMessage(playerid,COLOR_RED,string);
}
return 1;
}