CreateVehicle returns a very big and incorrect ID
#3

I suppose you have something like this in your script:
pawn Код:
new id = CreateVehicle(...);
some_array[id] = ...;
Now the case is that when something is wrong (invalid model ID, server full of vehicles), the CreateVehicle native returns INVALID_VEHICLE_ID (65535).
You need to add a safety guard for this:
pawn Код:
new id = CreateVehicle(...);
if(id != INVALID_VEHICLE_ID)
{
    // continue
}
Reply


Messages In This Thread
CreateVehicle returns a very big and incorrect ID - by Universal - 09.10.2012, 16:36
Re: CreateVehicle returns a very big and incorrect ID - by ViniBorn - 09.10.2012, 16:43
Re: CreateVehicle returns a very big and incorrect ID - by AndreT - 09.10.2012, 16:45
Re: CreateVehicle returns a very big and incorrect ID - by Universal - 09.10.2012, 17:26

Forum Jump:


Users browsing this thread: 2 Guest(s)