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



Errors :( - aircombat - 05.04.2010

Код:
if(modelid == 592 || modelid == 577 || modelid == 511 || modelid = 512 || modelid == 593 || modelid == 520 || modelid == 553 || modelid == 476 || modelid == 519 || modelid == 460 || modelid == 513 || modelid == 548 || modelid == 425 || modelid == 417 || modelid == 488 || modelid 497 || modelid == 497 || modelid == 563 || modelid == 447 || modelid == 469)
that the line and those are the errors :
Код:
warning 211: possibly unintended assignment
error 022: must be lvalue (non-constant)
warning 215: expression has no effect
error 001: expected token: ";", but found "-integer value-"
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
fatal error 107: too many error messages on one line



Re: Errors :( - huyguy - 05.04.2010

For such long if's i would use the switch statement. It is much clearer.


Re: Errors :( - aircombat - 05.04.2010

What do u mean?


Re: Errors :( - huyguy - 05.04.2010

Quote:
Originally Posted by [AC
Etch ]
What do u mean?
Код:
switch(modelid)
{
  case 592,577,511,...,469:
  {
    //Add some code here
  }
}
But i think the line of the script you posted is correct. Did you forget the { and } ?


Re: Errors :( - aircombat - 05.04.2010

nvm its just i missed a "==" ty anyways


Re: Errors :( - huyguy - 05.04.2010

Nice
I didn't see it either.
Thats why you should use switch