[HELP] Onvehicledeath
#1

Код:
public OnVehicleDeath(vehicleid, killerid) {
	foreach(Player, v) {
		if(playerVariables[v][pCarID] == vehicleid) {
			DestroyVehicle(vehicleid); // If an owned car is destroyed... it'll be manually despawned...
			systemVariables[vehicleCounts][1]--;
			/*
			playerVariables[v][pCarPos][0] = 2157.5559; // ...moved to the LS junk yard...
			playerVariables[v][pCarPos][1] = -1977.6494;
			playerVariables[v][pCarPos][2] = 13.3835;
			playerVariables[v][pCarPos][3] = 177.3687;
   			*/

			SpawnPlayerVehicle(v);
			/*
			SetVehicleHealth(playerVariables[v][pCarID], 400.0); // A wrecked car is a wrecked car.

			new
				Damage[4]; // Complete the job!

			GetVehicleDamageStatus(playerVariables[v][pCarID], Damage[0], Damage[1], Damage[2], Damage[3]);

			Damage[0] = encode_panels(1, 1, 1, 1, 3, 3, 3);
			Damage[1] = encode_doors(4, 4, 4, 4);
			Damage[2] = encode_lights(1, 1, 1, 1);

			UpdateVehicleDamageStatus(playerVariables[v][pCarID], Damage[0], Damage[1], Damage[2], Damage[3]);
			*/
		}
	}
	return 1;
}
Basically when a "normal unowned car" exploded, it respawns where it exploded, so my question is, how does one make it that it respawns where it was initially set

I looked at other scripts they dont have anything under OnVehDeath...
So whats happening?
Reply
#2

OnVehicleSpawn?
Reply
#3

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
OnVehicleSpawn?
Код:
public OnVehicleSpawn(vehicleid) {
	switch(GetVehicleModel(vehicleid)) {
		case 427, 428, 432, 601, 528: SetVehicleHealth(vehicleid, 5000.0); // Enforcer, Securicar, Rhino, SWAT Tank, FBI truck - this is the armour plating.
	}

	systemVariables[vehicleCounts][1] = 0;

	foreach(Player, x) {
		if(doesVehicleExist(playerVariables[x][pCarID])) {
			systemVariables[vehicleCounts][1]++;
		}
	}
	return 1;
}
dont see how this helps / influences
Reply
#4

You destroy and recreate the vehicle if it was a owned by a player

Just comment the whole OnVehicleDeath code and everything should be fine
Reply
#5

will give it a try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)