Vehicle auto respawn problem... help me plz
#1

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
Reply
#2

Your script's missing,

PHP код:
main(){} 
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..
Reply
#3

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+..
Reply
#4

Its not respawn, the vehicle get auto removed.. and it doesnt spawn in the place i've placed it..
Reply
#5

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(vehicleidkillerid) {
    
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.
Reply
#6

Код:
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.
Reply
#7

Are you using a release script or something? Maybe there's a timer destroying them or something?
Reply
#8

I need help as well it is the same problem I've got
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)