Login And Register Dialog Bug!!! Please i need help. . .
#1

So, what is the problem??

I want to open login or register dialog, and i did that, but there is another problem.
If it load one from that dialogs, it don't load dialog with left, right and Spawn button, so when player login he/she need to press on Spawn, how to fix it?

Here is the code:

Code:
public OnPlayerConnect(playerid)
{
  new
		string[128],
		pName[MAX_PLAYER_NAME],
		f;
	GetPlayerName(playerid,pName,sizeof(pName));
	if(strfind(pName,"_",true,1)!=-1)
	{
		f=1;
	}
	if(pName[strlen(pName)-1]=='_')
  {
		f=0;
	}
	for(new i=0;i<strlen(pName);i++)
	{
		if((pName[i]<='9')&&(pName[i]>='0'))
		{
			f=0;
		}
	}
	if(!f)
	{
		format(string, sizeof(string), "You have been kicked, Reason: Firstname_Lastname format.", pName);
		SendClientMessage(playerid, COLOR_RED, string);
		format(string, sizeof(string), "SERVER: %s was kicked from the server, reason: Firstname_Lastname format.", pName);
		SendClientMessageToAll(COLOR_RED, string);
		Kick(playerid);
	}

	for(new bn = 0; bn < sizeof(Sopranos); bn++)
	{
		if(!strcmp(Sopranos[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: We aren't in The Sopranos series. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(ViceCity); bn++)
	{
		if(!strcmp(ViceCity[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint Vice City. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(GTA3); bn++)
	{
		if(!strcmp(GTA3[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint GTA III. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(SA); bn++)
	{
		if(!strcmp(SA[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint GTA:SA . (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(GF); bn++)
	{
		if(!strcmp(GF[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint The Godfather . (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(Famous); bn++)
	{
		if(!strcmp(Famous[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Yeah yeah of course, see you in Hollywood. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(SmackD); bn++)
	{
		if(!strcmp(SmackD[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Go SmackDown somewhere else. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(BadName); bn++)
	{
		if(!strcmp(BadName[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Your name is lame. Gtfo. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	sOldState[playerid] = GetPlayerState(playerid);
	showspeedo[playerid] = 1;
  IsLogged[playerid] = 0;
  new name[256], queryconn[256], result, fname[2][128];
  	new Float:mx, Float:my, Float:mz;
	GetPlayerName(playerid, name, sizeof(name));
	split(name, fname, '_');
	format(queryconn, sizeof(queryconn), "SELECT * FROM players WHERE name = '%s'", name);
	result = mysql_query(queryconn);
	mysql_store_result();
	if(mysql_num_rows() == 0){
	format(string, sizeof(string), "Welcome %s to Lost Heaven: RolePlay [v%s by Coa_Psy © 2010], Please register.", fname[0], VERSION_0);
	SendClientMessage(playerid, COLOR_YELLOW, string);
	GetPlayerPos(playerid, mx, my, mz);
	PlayerPlaySound(playerid, 1185, 0, 0, 0);
	Registerdialog(playerid);
	return 1;
	}else{
  format(string, sizeof(string), "Welcome %s to Lost Heaven: RolePlay [v%s by Coa_Psy © 2010] , Please login.", fname[0], VERSION_0);
  SendClientMessage(playerid, COLOR_YELLOW, string);
  PlayerPlaySound(playerid, 1185, 0, 0, 0);
  Logindialog(playerid);
  	return 1;
	}
}
So, does any one know how to fix it?
Reply
#2

hmmmm i read code but why u put GTA ViceCity Kick And GTA3 Kick And That

Is It To Kick A Name With That Name? Or Something
Reply
#3

yes it is, but the problem is not there, i just don't want to spawn the player after he login
Reply
#4

Do You Mean Like Say

As Soon As The Person Connects He Gets A Dialog Box That Says Login/Register

Then He Enters Password /Login To Account
Reply
#5

Like Change This

Code:
public OnPlayerConnect(playerid)
{
		new string[128],
		new pName[MAX_PLAYER_NAME];
        new f;
	GetPlayerName(playerid,pName,sizeof(pName));
	if(strfind(pName,"_",true,1)!=-1)
	{
		f=1;
	}
	if(pName[strlen(pName)-1]=='_')
  {
		f=0;
	}
	for(new i=0;i<strlen(pName);i++)
	{
		if((pName[i]<='9')&&(pName[i]>='0'))
		{
			f=0;
		}
	}
	if(!f)
	{
		format(string, sizeof(string), "You have been kicked, Reason: Firstname_Lastname format.", pName);
		SendClientMessage(playerid, COLOR_RED, string);
		format(string, sizeof(string), "SERVER: %s was kicked from the server, reason: Firstname_Lastname format.", pName);
		SendClientMessageToAll(COLOR_RED, string);
		Kick(playerid);
	}

	for(new bn = 0; bn < sizeof(Sopranos); bn++)
	{
		if(!strcmp(Sopranos[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: We aren't in The Sopranos series. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(ViceCity); bn++)
	{
		if(!strcmp(ViceCity[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint Vice City. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(GTA3); bn++)
	{
		if(!strcmp(GTA3[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint GTA III. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(SA); bn++)
	{
		if(!strcmp(SA[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint GTA:SA . (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(GF); bn++)
	{
		if(!strcmp(GF[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint The Godfather . (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(Famous); bn++)
	{
		if(!strcmp(Famous[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Yeah yeah of course, see you in Hollywood. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(SmackD); bn++)
	{
		if(!strcmp(SmackD[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Go SmackDown somewhere else. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	for(new bn = 0; bn < sizeof(BadName); bn++)
	{
		if(!strcmp(BadName[bn][0],pName,true,sizeof(pName)))
		{
			format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Your name is lame. Gtfo. (kicked)", pName);
			SendClientMessageToAll(COLOR_RED, string);
			Kick(playerid);
			return 1;
		}
	}
	sOldState[playerid] = GetPlayerState(playerid);
	showspeedo[playerid] = 1;
  IsLogged[playerid] = 0;
  new name[256], queryconn[256], result, fname[2][128];
 	new Float:mx, Float:my, Float:mz;
	GetPlayerName(playerid, name, sizeof(name));
	split(name, fname, '_');
	format(queryconn, sizeof(queryconn), "SELECT * FROM players WHERE name = '%s'", name);
	result = mysql_query(queryconn);
	mysql_store_result();
	if(mysql_num_rows() == 0){
	format(string, sizeof(string), "Welcome %s to Lost Heaven: RolePlay [v%s by Coa_Psy © 2010], Please register.", fname[0], VERSION_0);
	SendClientMessage(playerid, COLOR_YELLOW, string);
	GetPlayerPos(playerid, mx, my, mz);
	PlayerPlaySound(playerid, 1185, 0, 0, 0);
	Registerdialog(playerid);
	return 1;
	}else{
  format(string, sizeof(string), "Welcome %s to Lost Heaven: RolePlay [v%s by Coa_Psy © 2010] , Please login.", fname[0], VERSION_0);
  SendClientMessage(playerid, COLOR_YELLOW, string);
  PlayerPlaySound(playerid, 1185, 0, 0, 0);
  Logindialog(playerid);
 	return 1;
	}
}
Reply
#6

Quote:
Originally Posted by Azzerking
Do You Mean Like Say

As Soon As The Person Connects He Gets A Dialog Box That Says Login/Register

Then He Enters Password /Login To Account
yes, but he gets that dialog, and don't get dialog with <-- --> Spawn buttons, so when he login it don't want to spawn him.
I i put in script Spawn Player
Reply
#7

Show Picture Of The Logindialog
Reply
#8


This is when i connect, but there is not the Spawn Button on the bottom:



This is after player insert his password and press ok:



And this is after player connect and press ESC button, there is Spawn dialog on the bottom:



And after that player can insert password and spawn:

Reply
#9

Dude, Spawn button comes up on player request class and not before that.
Reply
#10

Quote:
Originally Posted by DJDhan
Dude, Spawn button comes up on player request class and not before that.
Oh thank you. . . if i meet you some day i will kiss you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)