Vehicle auto respawn problem... help me plz -
Janpatrick22 - 22.03.2017
Hello everyone!
I've created some cars around los santos and it doesnt give me warnings and errors in script but when i go in game and enter in a car after some seconds it will auto respawn is there any way how to fix it and it keep spamming this debug
[debug] Run time error 20: "Invalid index parameter (bad entry point)"
plz help me
Re: Vehicle auto respawn problem... help me plz -
ISmokezU - 22.03.2017
Your script's missing,
Could you post an example of how u create the vehicle?
Keep in mind, that only
AddStaticVehicleEx &
CreateVehicle Has "respawn_delay" parameters:
respawn_delay The delay until the car is respawned without a driver in seconds. Using -1 will prevent the vehicle from respawning..
Re: Vehicle auto respawn problem... help me plz -
Janpatrick22 - 22.03.2017
CreateVehicle(446, 728.1595, -1495.2687, -0.4906, 179.7909, 1, 5, 600);
This is in my script
main(){}
but its in line 3000 and vehicles are in line 12k+..
Re: Vehicle auto respawn problem... help me plz -
Janpatrick22 - 22.03.2017
Its not respawn, the vehicle get auto removed.. and it doesnt spawn in the place i've placed it..
Re: Vehicle auto respawn problem... help me plz -
ISmokezU - 22.03.2017
Uh, Please elaborate more on your problem when the vehicle re - spawns are you in it or not? Do you use a command to re spawn them? Say something. Though
SetVehicleToRespawn may work in your favor i just need to know what's your problem.
PHP код:
public OnVehicleDeath(vehicleid, killerid) {
printf("Vehicle ID: %i Destroyed." vehicleid);
return true;
}
public OnVehicleSpawn(vehicleid) {
printf("Vehicle %i spawned!", vehicleid);
return true;
}
Or do some debug if you destroy it with (a) weapon(s) to see what's going on.
Re: Vehicle auto respawn problem... help me plz -
Janpatrick22 - 22.03.2017
Код:
public OnVehicleSpawn(vehicleid)
{
if(adminVehicle{vehicleid})
{
DestroyVehicle(vehicleid);
adminVehicle{vehicleid} = false;
}
if(IsValidDynamicObject(vehicleSiren[vehicleid]))
{
DestroyDynamicObject(vehicleSiren[vehicleid]);
vehicleSiren[vehicleid] = INVALID_OBJECT_ID;
}
if((VehicleInfo[vehicleid][vID] > 0 && VehicleInfo[vehicleid][vOwnerID] > 0) || (VehicleInfo[vehicleid][vGang] >= 0))
{
ReloadVehicle(vehicleid);
if(VehicleInfo[vehicleid][vGang] >= 0)
{
vehicleFuel[vehicleid] = 100;
}
}
else
{
if(VehicleInfo[vehicleid][vID] > 0 && VehicleInfo[vehicleid][vHealth] > 300.0)
{
SetVehicleHealth(vehicleid, VehicleInfo[vehicleid][vHealth]);
}
vehicleFuel[vehicleid] = 100;
}
vehicleStream[vehicleid][0] = 0;
return 1;
}
If i spawn a admin vehicle /vehicle then if i drive a bit around with it, it will get auto destroyed and idk where's the problem..
Not only admin vehicles, it happens at all server vehicles.
Re: Vehicle auto respawn problem... help me plz -
ISmokezU - 22.03.2017
Are you using a release script or something? Maybe there's a timer destroying them or something?
Re: Vehicle auto respawn problem... help me plz -
kukboy - 16.12.2018
I need help as well it is the same problem I've got