13.07.2014, 13:58
Hi all. i made a command for getting info about a player.
When i type /pinfo it's shows me health 0.00, weapons 0.00 all 0.00 . WHAT?
pawn Код:
CMD:pinfo(playerid, params [])
{
if(IsPlayerConnected(playerid))
{
if(IsSpecing[playerid] == 1)
{
if( isnull ( params ) ) return SendClientMessage(playerid, -1, "Syntax: /pinfo <targetid>");
if(PlayerInfo[playerid] [pAdmin] < 1) return SendClientMessage(playerid, -1, "Your admin leve isn't high enough to use this command.");
else
{
new string[24+MAX_PLAYER_NAME+1];
GetPlayerWeapon(playerid);
SendClientMessage(playerid, -1, "Info about player:");
new Float:health;
format(string, sizeof(string), "Health: %.1f",GetPlayerHealth(playerid, health));
SendClientMessage(playerid, -1,string);
format(string, sizeof(string), "Weapons:%.1f",GetPlayerWeapon(playerid));
SendClientMessage(playerid, -1,string);
new Float:armour;
format(string, sizeof(string),"Armour: %.1f",GetPlayerArmour(playerid, armour));
SendClientMessage(playerid, -1,string);
}
}
}
return 1;
}