SA-MP Forums Archive
Need help.. Dialog not showing up.. (Giving + rep) - 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: Need help.. Dialog not showing up.. (Giving + rep) (/showthread.php?tid=312166)



Need help.. Dialog not showing up.. (Giving + rep) - trapped1 - 20.01.2012

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
 	{
 		ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, "Vehicle Controls", "Lights\nTrunk\nHood\nAlarm", "Select", "Cancel");
  	}
   	return 1;
}
So the problem is when player enters cars dialog don't popup so need help with it.. Please some one .....


Re: Need help.. Dialog not showing up.. (Giving + rep) - sabretur - 20.01.2012

OnPlayerEnterVehicle() is called when player has just clicked button to enter to a car, and his state isn't PLAYER_STATE_DRIVER in that moment.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER) ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, "Vehicle Controls", "Lights\nTrunk\nHood\nAlarm", "Select", "Cancel");
    return 1;
}



Re: Need help.. Dialog not showing up.. (Giving + rep) - [HiC]TheKiller - 20.01.2012

OnPlayerEnterVehicle is called when the player starts entering the vehicle. PLAYER_STATE_DRIVER is the state when the player is actually the driver, not entering as the driver. Using OnPlayerStateChange and checking if the newstate is driver is better.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER) ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, "Vehicle Controls", "Lights\nTrunk\nHood\nAlarm", "Select", "Cancel");
    return 1;
}



Re: Need help.. Dialog not showing up.. (Giving + rep) - trapped1 - 20.01.2012

LOVE YA Both of you (NO HOMO) Thanks >>>>>