Dont know what error is this :(
#6

In the else statement, you do not check if the modelid is between 400 and 611 and an invalid modelid (in your case it returns 0 and you subtract -400; hence the run time error) would cause it.

I'll give you an example of how you should check in format:
pawn Код:
format(msg, sizeof(msg), "~g~>> ~r~You have spawned ~g~%s", (modelid) ? (VehicleNames[modelid - 400]) : ("N/A"));
so if the modelid is valid, it'll pass the vehicle's name stored in the array otherwise N/A.

PS: Try optimizing your code, it'll be easier to read and also not having to re-calling functions again and again (that's what variables are for).
Reply


Messages In This Thread
Help me to fix this :( - by kesarthakur - 17.01.2015, 08:57
Re: Dont know what error is this :( - by GShock - 12.04.2015, 08:28
Re: Dont know what error is this :( - by dominik523 - 12.04.2015, 08:31
Re: Dont know what error is this :( - by R0 - 12.04.2015, 08:34
Re: Dont know what error is this :( - by GShock - 12.04.2015, 12:29
Re: Dont know what error is this :( - by Konstantinos - 12.04.2015, 13:49

Forum Jump:


Users browsing this thread: 3 Guest(s)