OnPlayerEnterVehicle
#1

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new vehid;
    vehid = GetPlayerVehicleID(playerid);
    if(vehid == 574)
    {
        SendClientMessage(playerid, -1, "test");
    }
    return 1;
}
Why is this not giving me a message?
Reply
#2

If the player is entering the vehicle he still isnt in the vehicle, GetPlayerVehicleID will return 0
You need to use the vehicleid from the header

Also how do you know the exect vehicleid ?, i think you wanted to check for the model
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new
        modelid = GetVehicleModel(vehicleid)
    ;
    if(modelid == 574)
    {
        SendClientMessage(playerid, -1, "test");
    }
    return 1;
}
Reply
#3

Are you sure you're inside the Sweeper (ID 574)?
Reply
#4

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
If the player is entering the vehicle he still isnt in the vehicle, GetPlayerVehicleID will return 0
You need to use the vehicleid from the header

Also how do you know the exect vehicleid ?, i think you wanted to check for the model
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new
        modelid = GetVehicleModel(vehicleid)
    ;
    if(modelid == 574)
    {
        SendClientMessage(playerid, -1, "test");
    }
    return 1;
}
Working, thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)