Help on player enter vehicle show dialog
#1

i enter vehicle with id 574 and dialog wont show, what's wrong with this code?

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
SweeperSideJob[playerid] == 1)
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
         {
            if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                 
ShowPlayerDialog(playeridDIALOG_SWEEPERSIDEJOBDIALOG_STYLE_LIST"Sidejob""Route A (Ganton)""Select""Cancel");
            }
         }
    }
    return 
0;

Reply
#2

Код:
return 0;
change it to
Код:
return 1;
any try this:
Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) 
{ 
ShowPlayerDialog(playerid, DIALOG_SWEEPERSIDEJOB, DIALOG_STYLE_LIST, "Sidejob", "Route A (Ganton)", "Select", "Cancel"); 
return 1;
}
Reply
#3

Quote:
Originally Posted by TomRedlake
Посмотреть сообщение
Код:
return 0;
change it to
Код:
return 1;
any try this:
Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) 
{ 
ShowPlayerDialog(playerid, DIALOG_SWEEPERSIDEJOB, DIALOG_STYLE_LIST, "Sidejob", "Route A (Ganton)", "Select", "Cancel"); 
return 1;
}
still not work dude.
Reply
#4


see that?
before you display the dialog, you're checking if the player is already in the driver seat, which he's not at the moment this callback is triggered. thus this condition if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) is never met.
Reply
#5

Quote:
Originally Posted by Eoussama
Посмотреть сообщение

see that?
before you display the dialog, you're checking if the player is already in the driver seat, which he's not at the moment this callback is triggered. thus this condition if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) is never met.
Thank you, i didnt see onplayerentervehicle message on samp wiki.

I use onplayerstatechange, dialog showing.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)