getting vehicle name
#1

is there any function like
isplayerinvehicleinfernus bla bla..

i want the code that to know is the player in infernus or not.


thanks in advance
Reply
#2

You can make any macro like this?

pawn Код:
#define IsPlayerInInfernus(%0) (GetVehicleModel(%0) == 411)
Sample usage:

pawn Код:
// check if the player is sitting in infernus
static pvID = GetPlayerVehicleID(playerid);
if(IsPlayerInInfernus(pvID))
{
   
}

// check if the player is not sitting in infernus
static pvID = GetPlayerVehicleID(playerid);
if(!IsPlayerInInfernus(pvID))
{
   
}
Reply
#3

pawn Код:
stock IsPlayerInVehicle(playerid, model)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
        if(vehmodel == model)
        {
            return 1;
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)