05.06.2010, 19:53
Hi there ! This is my first release on sa-mp.com
So here`s what it does...
When your car is very soon to blowing up, a timer gives it a little more health (so that it doesn`t blow up) and removes the player from the vehicle.
This is an AddOn, so you have to add it in your GameMode by yourself !
Here are the code`s :
1. Forward : add it up, where you will see a lot of "forward"s :
2. Public : add it up or down, where you will see a lot of "public"s "
3. Setting the timer on.
I used this under OnPlayerSpawn, because it would be the simple-est way possible. So under OnPlayerSpawn, you will see something like this :
Add this :
And it will look like this :
Made entirely by me, MihaiTZa55.
Please comment if you liked it.
Also, i`ll upload a video as soon as possible of the script in action !
/wave
xD
So here`s what it does...
When your car is very soon to blowing up, a timer gives it a little more health (so that it doesn`t blow up) and removes the player from the vehicle.
This is an AddOn, so you have to add it in your GameMode by yourself !
Here are the code`s :
1. Forward : add it up, where you will see a lot of "forward"s :
Code:
forward EngineBreak();
Code:
public EngineBreak() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerInAnyVehicle(i)) { new Float:TempCarHealth; GetVehicleHealth(GetPlayerVehicleID(i), TempCarHealth); if(TempCarHealth <= 250.0) { SetVehicleHealth(GetPlayerVehicleID(i), 350.0); SendClientMessage(i, COLOR_RED, "The vehicle`s engine was broken ! Repair it before proceeding !!!"); RemovePlayerFromVehicle(i); return 1; } } } return 1; }
I used this under OnPlayerSpawn, because it would be the simple-est way possible. So under OnPlayerSpawn, you will see something like this :
Code:
public OnPlayerSpawn(playerid) { //other stuff goes here }
Code:
SetTimer("EngineBreak",1,true);
Code:
public OnPlayerSpawn(playerid) { SetTimer("EngineBreak",1,true); //other stuff goes here }
Please comment if you liked it.
Also, i`ll upload a video as soon as possible of the script in action !
/wave
xD