OnPlayerEnterVehicle problem
#1

I was trying to make something like , when a player enters a ambulance, he gets full health .. but it wasnt working..
can anyone just give me a sample, it doesnt have to be an ambulance.. i can hcange that myself .. but just give me the structure..
Reply
#2

Dont use OnPlayerEnterVehicle - that will check when you press the ENTER key to enter the vehicle, not when your in it yet. So use OnPlayerStateChange

pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        new veh = GetVehicleModel(GetPlayerVehicleID(playerid));
        if (veh == ambulanceid) // Change ambulanceid to any vehicle id you want
        {
            return SetPlayerHealth(playerid,100.00);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)