SA-MP Forums Archive
Help on player enter vehicle show dialog - 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: Help on player enter vehicle show dialog (/showthread.php?tid=644734)



Help on player enter vehicle show dialog - AgusZ - 13.11.2017

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;




Re: Help on player enter vehicle show dialog - TomRedlake - 13.11.2017

Код:
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;
}



Re: Help on player enter vehicle show dialog - AgusZ - 13.11.2017

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.


Re: Help on player enter vehicle show dialog - Eoussama - 13.11.2017


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.


Re: Help on player enter vehicle show dialog - AgusZ - 13.11.2017

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.