Problems with OnPlayerKeyStateChange
#1

Good evening.

First i must say: Sorry for my bad english.

I despair at just one thing ...

In fact I would like if a player is in a certain position and while pressing spacebar then show him a dialogue.

All works fine in the first try.
And when i'am trying this a second time then its shows me the dialogue, but when i close the dialogue it shows me the dialogue again..

Here is my code:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
 	if(newkeys & KEY_SPRINT){
	    if(IsPlayerInRangeOfPoint(playerid, 2.0, -3055.8394, 469.5962, 10.3126)){ 
            SetPlayerPos(playerid, 384.808624, 173.804992, 1008.382812);
			SetPlayerInterior(playerid, 3);
		}else if(IsPlayerInRangeOfPoint(playerid, 2.0, -3055.8394, 469.5962, 10.3126)){ 
            ShowPlayerDialog(playerid, DIALOG_STADTHALLE, DIALOG_STYLE_LIST, "Stadthalle", "Berufe\nArbeitslosen Geld\nHeiratsgenehmigung", "Weiter", "Abbrechen");
		}else if(IsPlayerInRangeOfPoint(playerid, 1.0, -1862.4856, -145.2338, 11.8984)){ 
            ShowPlayerDialog(playerid, DIALOG_BERUFE_1, DIALOG_STYLE_MSGBOX, "StraЯenreiniger", "Willst du den Beruf StraЯenreiniger annehmen?\nDer Vertrag dauert 1 Stunde.", "Ja", "Nein");
		}else if(IsPlayerInRangeOfPoint(playerid, 1.0, -2234.1150, 117.0917, 35.3203)){ 
            ShowPlayerDialog(playerid, DIALOG_BERUFE_2, DIALOG_STYLE_MSGBOX, "Lieferant", "Willst du den Beruf Lieferant annehmen?\nDer Vertrag dauert 1 Stunde.", "Ja", "Nein");
		}
	}
	return 1;
}
I hope anyone can help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)