[Tutorial] Wreck Car After Respawn [Easily] - 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: Tutorials (
https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Wreck Car After Respawn [Easily] (
/showthread.php?tid=677255)
Wreck Car After Respawn [Easily] -
supermember - 07.07.2020
I am New developer, And I have Low skill for sa-mp.
[I am weak english]
I am open a server for real life. But sometimes players often seize the opportunity to Spawn car, such as Drive the car fall water without Mechanic's repair. I try to fix this problems but I am new developer [weak developer]
First : I try to make Save health's Car into Mysql but I can't make it.
Second : I am think to easy make and I tried not related to the database.
Yep! I choose the second method. and I think it basic for all gamemode.
Begin : make it
Code:
new Float:VehicleDamage[MAX_VEHICLES];
Next : Find to : public OnVehicleDeath(vehicleid)
Describe : When The Vehicle was damage by something such as Fall the water, Weapon or Crash
It's Check = 1.
Type :
Code:
VehicleDamage[vehicleid] = 1;
Next : Find public OnVehicleSpawn(vehicleid)
Describe : If the vehicledamage = 1 , It will determine what the vehicle will look like.
TYPE:
Code:
if(VehicleDamage[vehicleid] == 1)
{
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);//If want to Show look the car's damage
SetVehicleHealth(vehicleid, 300);//Set Health After Respawn
VehicleDamage[vehicleid] = 0; // Back Check this car to 0
}
This is working, But If you're Restart Server Or Vehicle's Respawn. The Car is comeback to Full hp.
-----------------------------------------------------------------------------------------------------------------
I developed knowledge from...
Credit : SharpenBlade
https://sampforum.blast.hk/showthread.php?tid=676775
Re: Wreck Car After Respawn [Easily] -
YouShootIDodge - 16.07.2020
Is this a troll ? If not then Good Effort.