SA-MP Forums Archive
is there such a thing. - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: is there such a thing. (/showthread.php?tid=85701)



is there such a thing. - BP13 - 09.07.2009

is there such thing as a auto repairer that does not use timers?

or how do I make it so when someone enters a car their car gets a ridiculously high amount of health.


Re: is there such a thing. - HydraX - 09.07.2009

it needs a timer..

or it wont work


Re: is there such a thing. - ledzep - 09.07.2009

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  SetVehicleHealth(vehicleid, 10000000.0000);
}



Re: is there such a thing. - yezizhu - 09.07.2009

Enter vehicle sometimes doesn't work.
use OnPlayerStateChange(.. & if(newstate == PLAYER_STATE_DRIVER


Re: is there such a thing. - ғαιιοцт - 09.07.2009

Quote:
Originally Posted by HydraX
it needs a timer..

or it wont work
No, it will work when you set the vehicle's health to 10000000000 (i think)
but it won't work for planes. Thet blow when they have colission :P


Re: is there such a thing. - ledzep - 09.07.2009

Quote:
Originally Posted by yezizhu
Enter vehicle sometimes doesn't work.
use OnPlayerStateChange(.. & if(newstate == PLAYER_STATE_DRIVER
Enter vehicle works. It is called when a player presses their ENTER_VEHICLE_KEY near an unlocked vehicle.
However, entering a vehicle can easily be canceled by pressing KEY_UP, KEY_DOWN, etc... while the character is running to the vehicle.


Re: is there such a thing. - Marcel - 09.07.2009

Or do it in OnPlayerUpdate:
pawn Код:
public OnPlayerUpdate( playerid )
{
    if( IsPlayerInAnyVehicle( playerid ) )
    {
        new vID = GetPlayerVehicleID( playerid );
        SetVehicleHealth( vID , 10000000.0000 );
    }
    return 1;
}



Re: is there such a thing. - ledzep - 09.07.2009

That is definitely the best way if you don't mind the extra bandwidth/load.


Re: is there such a thing. - Vince - 09.07.2009

Use inifinite health if you want your car to never get broke:

pawn Код:
#define INFINITY (Float:0x7F800000)
SetVehicleHealth(vehicleid, INFINITY);