SA-MP Forums Archive
expected token "," but found ";" :| - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: expected token "," but found ";" :| (/showthread.php?tid=525657)



expected token "," but found ";" :| - prooftzm - 13.07.2014

hi there. i have a problem that is no making sense.
C:\Users\Cristi\Desktop\server\gamemodes\WAR.pwn(7 85) : error 001: expected token: ",", but found ";"
C:\Users\Cristi\Desktop\server\gamemodes\WAR.pwn(7 87) : error 001: expected token: ",", but found ";"
C:\Users\Cristi\Desktop\server\gamemodes\WAR.pwn(7 91) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
pawn Код:
Line 785: format(string, sizeof(string), "Health: %i.",GetPlayerHealth(playerid, health);
Line 787: format(string, sizeof(string), "Weapons: %i.",GetPlayerWeapon(playerid);
Line 791: format(string, sizeof(string),"Armour: %i.",GetPlayerArmour(playerid, armour);
where is the problem??


Re: expected token "," but found ";" :| - Stinged - 13.07.2014

You're missing a ) at the end of each line.


Re: expected token "," but found ";" :| - amirab - 13.07.2014

hey Holy Shit what are you doing man?
see at the end of you codes
and these are floats you can not use it at this way

PHP код:

new Float:health;
new 
Float:armour;
GetPlayerHealth(playerid health);
GetPlayerArmour(playerid armour);
format(stringsizeof(string), "Health: %f.",health);
format(stringsizeof(string), "Weapons: %d.",GetPlayerWeapon(playerid));
format(stringsizeof(string),"Armour: %f.",armour); 
Maybe +REP


Re: expected token "," but found ";" :| - Threshold - 13.07.2014

pawn Код:
//To fix line 785: (Usage of 'GetPlayerHealth' was incorrect)
new Float:health;
GetPlayerHealth(playerid, health);
format(string, sizeof(string), "Health: %0.2f.", health);

//To fix line 787: (Did not close the brackets properly)
format(string, sizeof(string), "Weapons: %i.", GetPlayerWeapon(playerid));

//To fix line 791: (Usage of 'GetPlayerArmour' was incorrect)
new Float:armour;
GetPlayerArmour(playerid, armour);
format(string, sizeof(string), "Armour: %0.2f.", armour);
Sources:
https://sampwiki.blast.hk/wiki/GetPlayerHealth
https://sampwiki.blast.hk/wiki/GetPlayerArmour


Re: expected token "," but found ";" :| - prooftzm - 13.07.2014

holy shit i didn't see that comming. it was missing two ) ) =))
thx a lot guys