SA-MP Forums Archive
invalid expression - 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: invalid expression (/showthread.php?tid=607347)



invalid expression - ToiletDuck - 18.05.2016

Код:
for(new ammoid; ammoid<MAX_STOREAMMO; ammoid++) {
	if(ammoid == MAX_STOREAMMO-1) {
//				printf("Last Ammo ID %d Saved",ammoid); //debug
	    format(string, sizeof(string), "%s `Ammo%d`=%d, `AmmoType%d`=%d WHERE `ID` = %d",string,
			ammoid,
			BackpackInfo[i][sAmmo][ammoid],
			ammoid,
			BackpackInfo[i][sAmmoType][ammoid],
			i+
		);
	}
	else {
//			    printf("Ammo ID %d performed",ammoid); //debug
	    format(string, sizeof(string), "%s \
			`Ammo%d`=%d, \
			`AmmoType%d`=%d,",
			string,
			ammoid,
			BackpackInfo[i][sAmmo][ammoid],
			ammoid,
			BackpackInfo[i][sAmmoType][ammoid]
		);
	}
}
error:
Код:
(1356 -- 1362) : error 029: invalid expression, assumed zero
(1356 -- 1362) : error 001: expected token: ",", but found ";"
what the fuck was wrong in this code
Код:
Line 1356: format(string, sizeof(string), "%s `Ammo%d`=%d, `AmmoType%d`=%d WHERE `ID` = %d",string,
			ammoid,
			BackpackInfo[i][sAmmo][ammoid],
			ammoid,
			BackpackInfo[i][sAmmoType][ammoid],
			i+
		);



Re: invalid expression - F1N4L - 18.05.2016

Код:
format(string, sizeof(string), "%s `Ammo%d`=%d, `AmmoType%d`=%d WHERE `ID` = %d",string,
					ammoid,
					BackpackInfo[i][sAmmo][ammoid],
					ammoid,
					BackpackInfo[i][sAmmoType][ammoid],
					i+ // <<<<<<<<
				);



Re: invalid expression - ToiletDuck - 18.05.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
format(string, sizeof(string), "%s `Ammo%d`=%d, `AmmoType%d`=%d WHERE `ID` = %d",string,
					ammoid,
					BackpackInfo[i][sAmmo][ammoid],
					ammoid,
					BackpackInfo[i][sAmmoType][ammoid],
					i+ // <<<<<<<<
				);
Oooo What the fuck I forgot the digit loool Thankss i just figgure out that I've missing the digit there xD damn u do dis pawno