car define
#1

how can i define if is in the X car? if is not in X car he can't start mission?
Reply
#2

you mean know if the player is in a car ? well use IsPlayerInAnyVehicle
Reply
#3

When creating that specific vehicle, assign the ID to a variable. When the player does whatever he does to trigger the mission, check if the ID of his current vehicle (GetPlayerVehicleID) matches that in the variable.
pawn Код:
new g_Car;
// OnGameModeInit
g_Car = CreateVehicle(...);
// Trigger mission
if(GetPlayerVehicleID(playerid) == g_Car)
{
    // they are in the car
}
Reply
#4

thanks
Reply
#5

No. Do you mean a particular VEHICLE MODEL or vehicle ID? What Bakr gave is used for a specific VEHICLE ID.

For a specific vehicle ID (Example - ID 0 - First created vehicle on the server)
pawn Код:
new g_Car;
// OnGameModeInit
g_Car = CreateVehicle(...);
// Trigger mission
if(GetPlayerVehicleID(playerid) == g_Car)
{
    // they are in the car
}
To check if they are in a SPECIFIC VEHICLE (Example - Infernus)
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
{
        // they are in a infernus
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)