onPlayerEnterVehicle message doesnt work
#1

Hello lads,
Its me again!

Tday ive wanted that a Message should ("Your entered a damaged Vehicle!") come, but it doesnt work?

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
vehicle;
    
vehicle GetPlayerVehicleID(playerid);
    if(
vehicle == 604)
    {
        
SendClientMessage(playerid4"Your are in a damaged Vehicle.");
        return 
1;
    }
    return 
1;

ive tryd 2 Kind of types, but both wont work....

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
GetPlayerVehicleID == 604)
    {
        
SendClientMessage(playerid4"Your are in a damaged Vehicle.");
        return 
1;
    }
    return 
1;

Reply
#2

Try this, you have to check for the modelid of the vehicle:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) 
{ 
    new vehicle; 
    vehicle = GetPlayerVehicleID(playerid); 
    if(GetVehicleModel(vehicle) == 604) 
    { 
        SendClientMessage(playerid, 4, "Your are in a damaged Vehicle."); 
        return 1; 
    } 
    return 1; 
}
Reply
#3

This callback is called when a player starts to enter the vehicle but he's not in yet so GetPlayerVehicleID returns 0.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 604) SendClientMessage(playerid, 4, "Your are in a damaged Vehicle.");
    return 1;
}
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
This callback is called when a player starts to enter the vehicle but he's not in yet so GetPlayerVehicleID returns 0.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 604) SendClientMessage(playerid, 4, "Your are in a damaged Vehicle.");
    return 1;
}
You're right, I totally missed that!
Reply
#5

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)