SA-MP Forums Archive
error 001: 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: error 001: expected token: ",", but found ";" (/showthread.php?tid=650897)



error 001: expected token: ",", but found ";" - enzulikeS - 09.03.2018

D:\server\gamemodes\ExtremeGame.pwn(31163 -- 31165) : error 001: expected token: ",", but found ";" (red color)

Код:
function SalvareRealizari(playerid) {
	new string[256], query[256];
	format(string, sizeof(string),
		"%d|%d|%d",
		PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2];

	format(query, sizeof(query),
		"UPDATE `users` SET `Realizari`='%s' WHERE `ID`='%d'", string, PlayerInfo[playerid][pSQLID])
	mysql_tquery(SQL, query, "","");
	return 1;
}
D:\server\gamemodes\ExtremeGame.pwn(31169) : error 001: expected token: ";", but found "-identifier-" (lime color)


Re: error 001: expected token: ",", but found ";" - wallen - 09.03.2018

PHP код:
format(string,sizeof(string),"%d|%d|%d",PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);
                
SendClientMessage(playerid, -1string); 



Re: error 001: expected token: ",", but found ";" - Maximun - 09.03.2018

Try that :

Код:
function SalvareRealizari(playerid) {
	new string[256], query[256];
	format(string, sizeof(string),
		"%d|%d|%d",
		PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);

	format(query, sizeof(query),
		"UPDATE `users` SET `Realizari`='%s' WHERE `ID`='%d'", string, PlayerInfo[playerid][pSQLID]);
	mysql_tquery(SQL, query, "","");
	return 1;
}



Re: error 001: expected token: ",", but found ";" - wallen - 09.03.2018

^

Код:
PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);
Why would you add a bracket if there are no brackets on this line

edit: my bad, for that bad identation didnt figured out it was a format.


Re: error 001: expected token: ",", but found ";" - enzulikeS - 09.03.2018

Quote:
Originally Posted by Maximun
Посмотреть сообщение
Try that :

Код:
function SalvareRealizari(playerid) {
	new string[256], query[256];
	format(string, sizeof(string),
		"%d|%d|%d",
		PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);

	format(query, sizeof(query),
		"UPDATE `users` SET `Realizari`='%s' WHERE `ID`='%d'", string, PlayerInfo[playerid][pSQLID]);
	mysql_tquery(SQL, query, "","");
	return 1;
}
ty bro
worked with this one


Re: error 001: expected token: ",", but found ";" - Maximun - 09.03.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
^

Код:
PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);
Why would you add a bracket if there are no brackets on this line
Look ! In addition, he's having two erros If I'm correct.
Код:
format(string, sizeof(string), "%d|%d|%d",PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);



Re: error 001: expected token: ",", but found ";" - wallen - 09.03.2018

Quote:
Originally Posted by Maximun
Посмотреть сообщение
Look ! In addition, he's having two erros If I'm correct.
Код:
format(string, sizeof(string), "%d|%d|%d",PlayerInfo[playerid][pAchievement][0], PlayerInfo[playerid][pAchievement][1], PlayerInfo[playerid][pAchievement][2]);
Yeah, i explained why, my fail


Re: error 001: expected token: ",", but found ";" - Maximun - 09.03.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
Yeah, i explained why, my fail
Yeah, because all lines are separated each others.

@enzulikeS, No problem bro