OnPlayerStateChange, locking vehicles
#2

There are vehicleids and then there are modelids. A single vehicle has both a vehicleid, which is unique and a modelid, which is not unique. Don't confuse them. Furthermore, you cannot check a range of values like this:
PHP код:
if(vehicleID == 596 || 597 || 598 || 599 || 523
Each operand is self-contained. Meaning the above will basically compile to:
PHP код:
if(vehicleID == 596 || true || true || true || true
And as a result that statement will always be true. You should check as follows:
PHP код:
if(model == 596 || model == 597 || ...) 
However I would advice using either a switch or an array if you intend to add more items to that list otherwise you'll end up with very long lines which are really, really ugly.
Reply


Messages In This Thread
OnPlayerStateChange, locking vehicles - by ross8839 - 10.06.2017, 13:44
Re: OnPlayerStateChange, locking vehicles - by Vince - 10.06.2017, 14:04
Re: OnPlayerStateChange, locking vehicles - by ross8839 - 10.06.2017, 14:07
Re: OnPlayerStateChange, locking vehicles - by SyS - 10.06.2017, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)