Dialog skips other dialog?
#1

I have 3 dialogs under OnPlayerConnect. 2 for Logging in/Registration and 1 for Choosing Team.

Код:
public OnPlayerConnect(playerid)
{
        new query[200],pName[30];
	GetPlayerName(playerid,pName,30);
	format(query,sizeof(query),"Select * from Users where Username='%s'",pName);
	mysql_query(query);
	mysql_store_result();
	if(mysql_num_rows() == 1)
	{
	    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Enter your password to login","Login","");
	}
	
	else
	{
	    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Enter your password to Register","Register","");
	}
	mysql_free_result();
	ShowPlayerDialog(playerid,DIALOG_CHOOSETEAM,DIALOG_STYLE_LIST,"Team Selection","1. Groove Street Families \n2. Ballas \n3.Varios Los Aztecas","Select","Quit");
	cycleSkin[playerid]=0;
	return 1;
}
When i comment or delete the Team Selection Dialog, Login/Register dialogs shows up. But when i add the team selection dialog, like in above code, it simply skips the Login/Register Dialogs and shows Team Selection Dialog directly.
Reply
#2

You can't show them all at once,
OnDialogResponse and when player login's then show him the Team Dialog.
Reply
#3

It is because you can't show up more than one dialog at once, and you are trying to show up two dialogs at the same time by having team selection to appear in any way.
Remove it from onplayerconnect and maybe trigger it when a player logins/registers.

EDIT: I'm too slow, Rudy_ beated me xD
Reply
#4

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
You can't show them all at once,
OnDialogResponse and when player login's then show him the Team Dialog.
Thats What i'm trying to do. Player Logs in and then Team Selection Dialog Shows up.
Reply
#5

I guess you have something like .
new LoggedIn[MAX_PLAYERS];
if not make one so if player is Loggedin, then don't spawn him.Show him the Team selection using this.
LoggedIn[playerid] = 1; (After player logins succesfully)
if you know about these then you can fix it if not reply
Reply
#6

Alright, i placed it in separate function and it worked. Thanks for your help guys. I really appreciate it.
Reply
#7

Welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)