Error 076: syntax error in the expression, or invalid function call.
#1

I have problems with this error.

Code:
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.
pawn Code:
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;
        }
    }
Line 1495:
pawn Code:
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);
Reply
#2

You're missing parameters,

Code:
GetPlayerHealth,GetPlayerArmour,GetPlayerIp
Reply
#3

Quote:
Originally Posted by Eric_
You're missing parameters,

Code:
GetPlayerHealth,GetPlayerArmour,GetPlayerIp
I don't know them...
Reply
#4

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);
You're code was kinda messed up and i am not sure if those variables are correct but that should compile now.
Reply
#5

Quote:
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);
You're code was kinda messed up and i am not sure if those variables are correct but that should compile now.
Hmmm... This works (no errors).

But the updated stuff (health, armour, IP) are not showing in-game when I type ''/stats''.
Reply
#6

Quote:
Originally Posted by Andy McKinley
Quote:
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);
You're code was kinda messed up and i am not sure if those variables are correct but that should compile now.
Hmmm... This works (no errors).

But the updated stuff (health, armour, IP) are not showing in-game when I type ''/stats''.
Cause you just left Health to nothing

Put:
Code:
Health: %f | Armour: %f | IP: %s
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)