Z does not exists? - 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: Z does not exists? (
/showthread.php?tid=131306)
Z does not exists? -
Hot - 02.03.2010
Код:
if(new z=0; z<ZOMBIES_TOTAL; z++) {
if(IsPlayerNPC(playerid)) {
if(z == 0) {
SetPlayerPos(playerid, 2057.3208, 1339.8979, 10.9259);
SetPlayerFacingAngle(playerid, 90);
}
if(z == 1) {
SetPlayerPos(playerid, 2057.3208, 1337.8979, 10.9259);
SetPlayerFacingAngle(playerid, 90);
}
if(z == 2) {
SetPlayerPos(playerid, 2057.3208, 1335.8979, 10.9259);
SetPlayerFacingAngle(playerid, 90);
}
}
}
I have this piece of code but i got errors saying that the variable Z does not exists?
Код:
C:\Documents and Settings\Usuario\Desktop\SAMP\gamemodes\npc.pwn(138) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Usuario\Desktop\SAMP\gamemodes\npc.pwn(138) : error 017: undefined symbol "z"
C:\Documents and Settings\Usuario\Desktop\SAMP\gamemodes\npc.pwn(138) : warning 215: expression has no effect
C:\Documents and Settings\Usuario\Desktop\SAMP\gamemodes\npc.pwn(138) : error 017: undefined symbol "z"
C:\Documents and Settings\Usuario\Desktop\SAMP\gamemodes\npc.pwn(138) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Z does not exists? -
Fj0rtizFredde - 02.03.2010
I think this: if(new z=0; z<ZOMBIES_TOTAL; z++) should be: for(new z=0; z<ZOMBIES_TOTAL; z++) ?:P
Re: Z does not exists? -
Hot - 02.03.2010
OMG, i'm so noob. Sorry for that. Thanks (:
Re: Z does not exists? -
Correlli - 02.03.2010
And also use switch/case instead of if/else if, switch is faster.