01.08.2012, 17:05
Here is login command from GF gamemode
And this is OnDialogReponse,(I'm trying to make it in Dialogs reg/log)
And it dosen't work, what is the problem?
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;
}
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");
}
}
}


