is there such a thing.
#1

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.
Reply
#2

it needs a timer..

or it wont work
Reply
#3

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

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

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
Reply
#6

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.
Reply
#7

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

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)