D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1495) : error 076: syntax error in the expression, or invalid function call Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
And this is the script:
if(strcmp(cmd, "/stats", true) == 0)
{
new idplayer;
tmp2 = strtok(cmdtext, idx);
if(!strlen(tmp2))
{
ShowStats(playerid);
return 1;
}
idplayer = strval(tmp2);
if(IsPlayerConnected(idplayer))
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(idplayer, playername, sizeof(playername));
format(string, sizeof(string), "%s's Stats: Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Health: | Armour: | IP: ",playername,pInfo[idplayer][pKills],pInfo[idplayer][pDeaths],Float:pInfo[idplayer][pKills]/Float:pInfo[idplayer][pDeaths],GetPlayerMoney(idplayer),GetPlayerHealth,GetPlayerArmour,GetPlayerIp);
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Player Not Connected.");
return 1;
}
}
format(string, sizeof(string), "%s's Stats: Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Health: | Armour: | IP: ",playername,pInfo[idplayer][pKills],pInfo[idplayer][pDeaths],Float:pInfo[idplayer][pKills]/Float:pInfo[idplayer][pDeaths],GetPlayerMoney(idplayer),GetPlayerHealth,GetPlayerArmour,GetPlayerIp);
GetPlayerHealth,GetPlayerArmour,GetPlayerIp
Originally Posted by Eric_
You're missing parameters,
Code:
GetPlayerHealth,GetPlayerArmour,GetPlayerIp |
new Float:PlayerHealth, Float:PlayerArmour, IP[20]; GetPlayerHealth(idplayer, PlayerHealth); GetPlayerArmour(idplayer, PlayerArmour); GetPlayerIp(idplayer, IP, sizeof(IP)); format(string, sizeof(string), "%s's Stats: Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Health: | Armour: | IP: ",playername,pInfo[idplayer][pKills], pInfo[idplayer][pDeaths], pInfo[idplayer][pKills], pInfo[idplayer][pDeaths],GetPlayerMoney(idplayer),PlayerHealth, PlayerArmour,IP);
Originally Posted by Christopher.
Code:
new Float:PlayerHealth, Float:PlayerArmour, IP[20]; GetPlayerHealth(idplayer, PlayerHealth); GetPlayerArmour(idplayer, PlayerArmour); GetPlayerIp(idplayer, IP, sizeof(IP)); format(string, sizeof(string), "%s's Stats: Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Health: | Armour: | IP: ",playername,pInfo[idplayer][pKills], pInfo[idplayer][pDeaths], pInfo[idplayer][pKills], pInfo[idplayer][pDeaths],GetPlayerMoney(idplayer),PlayerHealth, PlayerArmour,IP); |
Originally Posted by Andy McKinley
Quote:
But the updated stuff (health, armour, IP) are not showing in-game when I type ''/stats''. |
Health: %f | Armour: %f | IP: %s