Help please
#1

Hey guys. I'm entering a trashmaster and it should show a textdraw.
It doesn't have any effect.
What's wrong?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(playerid == 408)) // Trashmaster
    {
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    }
    return 1;
}
Reply
#2

Quote:
Originally Posted by bartje01
Посмотреть сообщение
Hey guys. I'm entering a trashmaster and it should show a textdraw.
It doesn't have any effect.
What's wrong?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(playerid == 408)) // Trashmaster
    {
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    }
    return 1;
}
This function return the model of the vehicleid, so, you have what get the ID from vehicle of playerid.
How?
Your function will stay like this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 408)
    {
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    }
    return 1;
}
Reply
#3

Easier will be like this i think, but cynics code works too i guess.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == 408)
    {
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    }
    return 1;
}
Reply
#4

The ideal is put this code in the OnPlayerStateChange because if a player press the key ENTER and cancel the entrance on vehicle, the textdraw will be showed to player and will not hide more.
Like this:
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate ==  PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 408)
    {
    //your functions
    }
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)