Checking what car a player's in
#1

This code:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new carmodel;
    carmodel = GetPlayerVehicleID(playerid);
    if(carmodel = 498) {
        SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
    }
    return 1;
}
Sends that clientmessage every time I enter ANY car.
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new carmodel, vehid;
    vehid = GetPlayerVehicleID(playerid); //getting the vehicle id (unique id a server uses to identify each car). no vehicle id is the same as any other on one server
    carmodel = GetVehicleModel(vehid); //getting the model. this can be the same, eg 2 infernuses
    if(carmodel == 498) {
        SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
    }
   
    //or just
   
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498) {
        SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
    }
    return 1;
}
Reply
#3

I've got this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498) {
        SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
    }
    //===========================================START OF POLICE===============================================
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 599 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 598) {
      if(!PlayerInfo[playerid][pFaction] == 1) {
        RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_WHITE, "This is a faction only car!");
      }
    }
    return 1;
}
Yet I can enter the vehicle on a new account.
Reply
#4

which vehicle ?
Reply
#5

599 (ranger) or 598 (Las Venturas cop car).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)