Disable A Vehicle
#1

I'm trying to figure out how to disable a vehicle from being driven if it's HP is at a certain level.

I run a heavy roleplay server and would like this achieved. This is what I have come up with:

pawn Код:
public CrashCar()
{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
                {
                        new vehicle[MAX_PLAYERS];
                        vehicle[i] = GetPlayerVehicleID(i);
                        new Float:health;
                        GetVehicleHealth(vehicle[i], health);
                        if (health <= 500)
                        {
                                if (carcrashed[i] == 0)
                                {
                                    TogglePlayerControllable(i, 0);
                                    GameTextForPlayer(i, "~w~Your car is~n~~p~Broken", 3500, 1);
However, it seems that all someone has to do, is press their button to exit the vehicle, then they do, and then they can get back in and drive off.
Any ideas?
Reply


Messages In This Thread
Disable A Vehicle - by DJ_Shocker - 27.01.2013, 01:35
Re: Disable A Vehicle - by Roach_ - 27.01.2013, 07:33
Re: Disable A Vehicle - by Threshold - 27.01.2013, 07:47

Forum Jump:


Users browsing this thread: 1 Guest(s)