Vehicle ID Issue (REP+)
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
because rows starts from 0 not 1 so you need use [id - 1]
Thank you! It works! But would I have to do this every time I want to mess with my dynamic vehicle system or could I just make it so the ID is 'corrected' when they initiate?

Edit: Also, say I have an admin spawned vehicle (different from a dynamic vehicle) that is occupying slot 1. I also have a dynamic vehicle occupying slot 2. If I delete the admin spawned vehicle, and then use the command /editvehicle, my dynamic vehicle will respawn to ID 1. I just tested this in game, but the script still thinks it has ID 2.

Here's my respawn function:

PHP код:
RespawnVehicle(id

    
DestroyVehicle(Vehicle[id][VehID]); 
    if(
Vehicle[id][VehiclePos][0] != 0.00000 && Vehicle[id][VehiclePos][1] != 0.00000 && Vehicle[id][VehiclePos][2] != 0.00000
    { 
        
Vehicle[id][VehID] = CreateVehicle(Vehicle[id][Model], Vehicle[id][VehiclePos][0], Vehicle[id][VehiclePos][1], Vehicle[id][VehiclePos][2], Vehicle[id][VehiclePos][3], Vehicle[id][VehicleColour][0], Vehicle[id][VehicleColour][1], -1Vehicle[id][Siren]); 
        
SetVehicleVirtualWorld(Vehicle[id][VehID], Vehicle[id][VehicleVW]); 
        
LinkVehicleToInterior(Vehicle[id][VehID], Vehicle[id][VehicleInt]); 
    } 
    return 
1

Reply


Messages In This Thread
Vehicle ID Issue (REP+) - by BornHuman - 24.05.2016, 23:04
Re: Vehicle ID Issue (REP+) - by Jefff - 24.05.2016, 23:36
Re: Vehicle ID Issue (REP+) - by BornHuman - 24.05.2016, 23:44
Re: Vehicle ID Issue (REP+) - by Jefff - 24.05.2016, 23:53
Re: Vehicle ID Issue (REP+) - by BornHuman - 24.05.2016, 23:56
Re: Vehicle ID Issue (REP+) - by Jefff - 24.05.2016, 23:59
Re: Vehicle ID Issue (REP+) - by BornHuman - 25.05.2016, 00:10
Re: Vehicle ID Issue (REP+) - by Jefff - 25.05.2016, 00:16
Re: Vehicle ID Issue (REP+) - by BornHuman - 25.05.2016, 00:20
Re: Vehicle ID Issue (REP+) - by Jefff - 25.05.2016, 00:24

Forum Jump:


Users browsing this thread: 1 Guest(s)