[HELP] Onvehicledeath - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Onvehicledeath (
/showthread.php?tid=263911)
[HELP] Onvehicledeath -
euRo - 24.06.2011
Код:
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?
Re: [HELP] Onvehicledeath -
=WoR=Varth - 24.06.2011
OnVehicleSpawn?
Re: [HELP] Onvehicledeath -
euRo - 24.06.2011
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
AW: [HELP] Onvehicledeath -
Nero_3D - 24.06.2011
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
Re: [HELP] Onvehicledeath -
euRo - 24.06.2011
will give it a try