SA-MP Forums Archive
Invalid expression, assumed zero - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Invalid expression, assumed zero (/showthread.php?tid=130492)



Invalid expression, assumed zero - Desert - 27.02.2010

Hello im working on a small filterscript when i got the error number 029 (Invalid expression, assumed zero) on this code

Код:
	if(GetVehicleModel(vehicleid) == 586 || GetVehicleModel(vehicleid == 448) || GetVehicleModel(vehicleid) == 463 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 468 || GetVehicleModel(vehicleid) == 533 || GetVehicleModel(vehicleid) == 555 || (GetVehicleModel(vehicleid) == 482 || GetVehicleModel(vehicleid) == 455)
	{
		if(ispassenger == 0)
		{
Its the { under the GetVehicleModel's that haves the error. I have been looking for whats wrong for long but out of ideas. And im sure on its some weird mistake and im just too blind to see it.


Note above the code i have a similar code with only 1 vehicle type and that has no errors


Re: Invalid expression, assumed zero - smeti - 27.02.2010

Quote:
Originally Posted by Desert
Hello im working on a small filterscript when i got the error number 029 (Invalid expression, assumed zero) on this code

Код:
	if(GetVehicleModel(vehicleid) == 586 || GetVehicleModel(vehicleid == 448) || GetVehicleModel(vehicleid) == 463 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 468 || GetVehicleModel(vehicleid) == 533 || GetVehicleModel(vehicleid) == 555 || (GetVehicleModel(vehicleid) == 482 || GetVehicleModel(vehicleid) == 455)
	{
		if(ispassenger == 0)
		{
Its the { under the GetVehicleModel's that haves the error. I have been looking for whats wrong for long but out of ideas. And im sure on its some weird mistake and im just too blind to see it.


Note above the code i have a similar code with only 1 vehicle type and that has no errors
GetVehicleModel(vehicleid == 448)

pawn Код:
GetVehicleModel(vehicleid) == 448



Re: Invalid expression, assumed zero - Desert - 27.02.2010

Thanks for finding that one

But error still comes after changing it



Re: Invalid expression, assumed zero - smeti - 27.02.2010

Quote:
Originally Posted by Desert
Thanks for finding that one

But error still comes after changing it
Sorry.
if(GetVehicleModel(vehicleid) == 586 || GetVehicleModel(vehicleid == 448) || GetVehicleModel(vehicleid) == 463 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 468 || GetVehicleModel(vehicleid) == 533 || GetVehicleModel(vehicleid) == 555 || (GetVehicleModel(vehicleid) == 482 || GetVehicleModel(vehicleid) == 455)
Simplifield:
pawn Код:
new
      model = GetVehicleModel(vehicleid);
     
    if(model == 586 || model == 448 || model == 463 || model == 522 || model == 468 || model == 533 || model == 555 || model == 482 || model == 455)
    {



Re: Invalid expression, assumed zero - Desert - 27.02.2010

Thanks that 1 did the job