12.04.2015, 13:49
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:
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).
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"));
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).