Allowing different parameters with zcmd: it can has problem. - 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: Allowing different parameters with zcmd: it can has problem. (
/showthread.php?tid=140017)
Allowing different parameters with zcmd: it can has problem. -
biltong - 07.04.2010
I have this code where you can enter a vehicle's model name OR a model id, but the way I put it didn't work and gave me an unreachable code error.
http://pawn.pastebin.com/6zgMhCTF
Код:
G:\Program Files\Rockstar Games\SA-MP Server 0.3a\lol.pwn(292) : warning 225: unreachable code
G:\Program Files\Rockstar Games\SA-MP Server 0.3a\lol.pwn(292) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
How else can I put this?
Re: Allowing different parameters with zcmd: it can has problem. -
cessil - 07.04.2010
which line is 292? and it's most likely an extra }
Re: Allowing different parameters with zcmd: it can has problem. -
kc - 07.04.2010
You have more than one else statement leading off the same if statement.
Also your way of structuring the code seems a bit odd to me, with an if statement that is true displaying an error message.
Anyway I did a bit of work to your code, it should help you get going again.
http://pawn.pastebin.com/BnWb5G0X
Re: Allowing different parameters with zcmd: it can has problem. -
biltong - 07.04.2010
Quote:
Originally Posted by kc
Also your way of structuring the code seems a bit odd to me, with an if statement that is true displaying an error message.
|
That's because sscanf returns 0 if the statement is true and -1 if the statement is false if I remember correctly. I'll try your code
EDIT: Doesn't work, it gives me an unknown command error if I use it with parameters and if I just use "/requestcar" nothing happens, which was exactly what the code did before.