OnPlayerVehicleDamage help please!
#1

only the driver but the passenger seat is not compromised!
Help please , Why do not you want to be good? I tried many ways but failed..
if you can answer!

public OnPlayerVehicleDamage(playerid, vehicleid, Floatamage)
{
new Float: HP;
GetPlayerHealth(playerid, HP);
if(IsPlayerInVehicle(playerid, vehicleid) && GetPlayerState(playerid) == 2) //<<passenger not convulse(is not compromised)
{
if( Damage > 165.0 && 195.0 )
{
Cselekves(playerid,"convulse.");
SetPlayerDrunkLevel(playerid, 5000);
SetPlayerHealth(playerid, HP - 20);
}
}
return 1;
}

(Sorry bad english)
Reply
#2

i want to help you but i really realyl dident get this line

PHP код:
if(IsPlayerInVehicle(playeridvehicleid) && GetPlayerState(playerid) == 2
Just tell me what you want in some way .. , i cant understand your english sorry ..
Reply
#3

pawn Код:
public OnPlayerVehicleDamage(playerid, vehicleid, Floatamage)
{
    new Float: HP;
    GetPlayerHealth(playerid, HP);
    if(IsPlayerInVehicle(playerid, vehicleid))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
        {
            if(Damage > 165.0 && 195.0)
            {
                Cselekves(playerid, "convulse.");
                SetPlayerDrunkLevel(playerid, 5000);
                SetPlayerHealth(playerid, HP - 20);
            }
        }
    }
    return 1;
}
Reply
#4

not work
Reply
#5

You would have to check the vehicles ID and than loop IsPlayerInAnyVehicle for that vehicle id.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)