OnPlayerEnterVehicle help needed!
#1

If I enter a Linerunner, or a SFPD car - none of these messages gets shown in the console!

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleid == 403) // False
    {
        print("The player entered a Linerunner! ");
    }
    else if (vehicleid == 597) // False
    {
        print("The player entered a vehicle other than the linerunner!");
    }
    return 1;
}
Reply
#2

It looks like you're comparing the vehicle ID to the model ID, which won't work? You should be checking the model ID! For example:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 403) // False
    {
        print("The player entered a Linerunner! ");
    }
    else if (GetVehicleModel(vehicleid) == 597) // False
    {
        print("The player entered a vehicle other than the linerunner!");
    }
    return 1;
}
Reply
#3

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if (model == 403) // False
    {
        print("The player entered a Linerunner! ");
    }
    else if (model == 597) // False
    {
        print("The player entered a vehicle other than the linerunner!");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)