19.07.2012, 01:27
bom .. voltei a fazer o Login e Registro em Dialog, tб pronto, mais quando eu entro no servidor fica lб
e fica nisso, ele "congela" quando vai carregar o dialog, carrega tudo acima do dialog ..
parte dele do OnPlayerConnect
e no OnDialogResponse
Код:
[22:22:29] Connected. Joining the game... [22:22:29] » {FF0000}Lucas (ID:0) Entrou {FFFFFF}no {66FF33}Servidor! [22:22:29] ********************************************************************************** [22:22:29] Bem vindo [22:22:29] Tipos de Partidas [22:22:29] AAD | Arena's | Team Death Match [22:22:29] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [22:22:29] Para ver seus stats digite /Stats
parte dele do OnPlayerConnect
pawn Код:
new file[64];
GetPlayerName(playerid,file,sizeof(file));
format(file,sizeof(file),DOF2_File(file));
if(DOF2_FileExists(file))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Bem Vindo Novamente, Logue-se","{FFFFFF}Coloque sua {00FF22}senha {FFFFFF}Para logar!","Log-in","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registre-se para poder jogar!","{FFFFFF}Coloque sua {00FF22}senha {FFFFFF}Para registrar!","Register","Quit");
}
pawn Код:
switch(dialogid) {
case DIALOG_REGISTER:
{
if(!response) Kick(playerid);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registre-se para poder jogar!","{FFFFFF}Coloque sua {00FF22}senha {FFFFFF}Para registrar!","Register","Quit");
if(response) {
new file[64];
GetPlayerName(playerid,file,sizeof(file));
format(file,sizeof(file),DOF2_File(file));
DOF2_CreateFile(file, inputtext);
DOF2_SetInt (file, "Kills", 0);
DOF2_SetInt (file, "Deaths", 0);
DOF2_SetInt (file, "AdminLevel", 0);
DOF2_SaveFile();
}
}
case DIALOG_LOGIN: {
if(!response) Kick(playerid);
if(response) {
new file[64];
GetPlayerName(playerid,file,sizeof(file));
format(file,sizeof(file),DOF2_File(file));
if(DOF2_FileExists(file)) {
if(DOF2_CheckLogin(file,inputtext)) {
PlayerInfo[playerid][pKills] = DOF2_GetInt(file,"Kills");
PlayerInfo[playerid][pDeaths] = DOF2_GetInt(file,"Deaths");
PlayerInfo[playerid][pAdmin] = DOF2_GetInt(file,"AdminLevel");
return 1;
}
else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Senha Incorreta!","{F81414}Vocк digitou uma senha errada\n{FFFFFF}Digite sua senha aqui para entrar !","Log-in","Quit");
return 1;
}
}
}
}
}