SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 07/07/2020, 03:41 PM   #1
supermember
Big Clucker
 
Join Date: May 2012
Posts: 95
Reputation: 0
Wink Wreck Car After Respawn [Easily]

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://forum.sa-mp.com/showthread.php?t=676775
supermember is offline   Reply With Quote
Old 16/07/2020, 07:10 AM   #2
YouShootIDodge
Big Clucker
 
Join Date: May 2019
Posts: 75
Reputation: 15
Default Re: Wreck Car After Respawn [Easily]

Is this a troll ? If not then Good Effort.
YouShootIDodge is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdateVehicleDamageStatus get to Car wreck supermember Scripting Help 1 06/07/2020 04:57 PM
Wreck of car cnoopers Scripting Help 5 22/06/2014 11:03 PM
Getting zone coordinates easily Phil_Cutcliffe Scripting Help 3 09/03/2013 06:25 PM
[Map] SF Ship Wreck/Dm zone nickdodd25 Maps 8 03/07/2012 07:09 PM
[Map] Wreck boat interior+ outside mapping (with Video) (Download now) oscar7610 Maps 2 06/05/2012 11:44 PM


All times are GMT. The time now is 06:50 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.