SA-MP Forums Archive
onPlayerEnterVehicle message doesnt work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: onPlayerEnterVehicle message doesnt work (/showthread.php?tid=508482)



onPlayerEnterVehicle message doesnt work - Pepino960 - 22.04.2014

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;




Re: onPlayerEnterVehicle message doesnt work - Conradus - 22.04.2014

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; 
}



Re: onPlayerEnterVehicle message doesnt work - Konstantinos - 22.04.2014

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;
}



Re: onPlayerEnterVehicle message doesnt work - Conradus - 22.04.2014

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!


Re: onPlayerEnterVehicle message doesnt work - Pepino960 - 22.04.2014

Thanks