Godfather login
#1

Here is login command from GF gamemode
Code:
if (strcmp(cmd, "/login", true) ==0 )
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new tmppass[64];
			if(gPlayerLogged[playerid] == 1)
			{
				SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
				return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /login [password]");
				return 1;
			}
			strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
			Encrypt(tmppass);
			OnPlayerLogin(playerid,tmppass);
		}
		return 1;
	}
And this is OnDialogReponse,(I'm trying to make it in Dialogs reg/log)
Code:
case DIALOG_LOGIN:
		{
		    if(!response) return Kick(playerid);
		    if(response)
		    {
		        new tmppass[64];
		        if(udb_hash(tmppass) == PlayerInfo[playerid][pKey])
		        {
		            OnPlayerLogin(playerid,tmppass);
		            Encrypt(tmppass);
		        	SetSpawnInfo(playerid, 0, 0, 145.0953,-1815.7118,2.1, 90, 0, 0, 0, 0, 0, 0);
                	SpawnPlayer(playerid);
				}
				else
				{
				    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Godfather Roleplay - Login","Welcome back!\nType in your password!","Login","Cancel");
				}
			}
		}
And it dosen't work, what is the problem?
Reply


Messages In This Thread
Godfather login - by Alex.Cone - 01.08.2012, 17:05
Re: Godfather login - by Roko_foko - 01.08.2012, 17:08
Respuesta: Godfather login - by Alex.Cone - 01.08.2012, 17:09
Re: Godfather login - by Roko_foko - 01.08.2012, 17:13
Respuesta: Godfather login - by Alex.Cone - 01.08.2012, 17:20
Re: Godfather login - by Aprezt - 01.08.2012, 17:22
Respuesta: Re: Godfather login - by Alex.Cone - 01.08.2012, 17:31
Respuesta: Godfather login - by Alex.Cone - 01.08.2012, 18:13

Forum Jump:


Users browsing this thread: 2 Guest(s)