Car help
#1

Hello, I need help I want that when a player is in a car and that car and seriously damaged its ejects

thank you in advance
Reply
#2

https://sampwiki.blast.hk/wiki/Main_Page
http://forum.sa-mp.com/index.php?action=search
Reply
#3

pleaze help me,
Reply
#4

Quote:
Originally Posted by lepompier
pleaze help me,
He just gave you all the answers you could ever need, I've seen a very similar question before, and by searching timers and eject etc you'll find all you need to build the script.
Reply
#5

I did but its not

new Float:health;
GetVehicleHealth(GetPlayerVehicleID(playerid), health);

if(floatround(value/1000) >= 132 && health == 500)
{
RemovePlayerFromVehicle(playerid);
}

timer blablabla...
Reply
#6

What's this all about?:

if(floatround(value/1000) >= 132 && health == 500)
Reply
#7

if(floatround(value/1000) >= 132
is the speed,

&& health == 500 and the health of the car

and not eject player
Reply
#8

I would use < or =< not ==.
Reply
#9

as it's

if(floatround(value/1000) >= 132 && health <= 400)
{
RemovePlayerFromVehicle(playerid);
}
Reply
#10

Add this on the top of script.
pawn Код:
forward EjectIfDamaged();
Add this in GameModeInit
pawn Код:
SetTimer("EjectIfDamaged",100,1);
Add at the botton of the script
pawn Код:
public EjectIfDamaged(){
    new i;
    for(i=0;i<=MAX_PLAYERS;i++){
      if(IsPlayerInAnyVehicle(i)){
        new Float:health;
            GetVehicleHealth(GetPlayerVehicleID(i),health);
            if(health<=200){
                RemovePlayerFromVehicle(i);
            }
      }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)