Allowing different parameters with zcmd: it can has problem.
#1

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?
Reply
#2

which line is 292? and it's most likely an extra }
Reply
#3

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
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)