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;
}
Well, maybe it's just a typo here, but when you are checking if player is admin you forgot to add bracket and playerid on SendClientMessage :/
|
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(playerid, 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),GetPlayerArmour(targetid), GetPlayerScore(targetid),GetPlayerMoney(targetid));//line 349
SendClientMessage(playerid,COLOR_RED,string);
}
return 1;
}
C:\Users\user\Desktop\h\gamemodes\new.pwn(349) : warning 202: number of arguments does not match definition C:\Users\user\Desktop\h\gamemodes\new.pwn(349) : warning 202: number of arguments does not match definition Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
format(string, sizeof(string),"Health: %d Armor: %d Score: %d Cash: %d",GetPlayerHealth(targetid),GetPlayerArmour(targetid), GetPlayerScore(targetid),GetPlayerMoney(targetid));//line 349
new Float:Health, Float:Armour;
GetPlayerHealth(targetid, Health); GetPlayerArmour(targetid, Armour);
format(string, sizeof(string),"Health: %d Armor: %d Score: %d Cash: %d",Health,Armour, GetPlayerScore(targetid),GetPlayerMoney(targetid));
Oh, thing is that GetPlayerHealth and GetPlayerArmour work with float, just add in the top of the command:
Код:
new Float:Health, Float:Armour; Код:
GetPlayerHealth(targetid, Health); GetPlayerArmour(targetid, Armour); Код:
format(string, sizeof(string),"Health: %d Armor: %d Score: %d Cash: %d",Health,Armour, GetPlayerScore(targetid),GetPlayerMoney(targetid)); |