Need help.. Dialog not showing up.. (Giving + rep)
#1

Код:
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 .....
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)