pawn Код:
Ao entrar:
public OnPlayerRequestClass(playerid, classid)
{
if(pInfo[playerid][Logado] == false)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(Arquivo, 40, "Contas/%s.ini", name);
if(DOF2_FileExists(Arquivo))
{
format(String, sizeof(String),"{FFFFFF}------------ [ Brasil Fire Street v4.0 ] ------------\n\nSua conta ESTБ registrada!\nNick: %s\nLevel: %d\nClique em Logar para poder jogar!\n\n------------ [ Brasil Fire Street v4.0 ] ------------", PlayerName(playerid), pInfo[playerid][Level]);
ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "Logando conta", String, "Logar", "Cancelar");
}
else
{
format(String, sizeof(String),"{FFFFFF}------------ [ Brasil Fire Street v4.0 ] ------------\n\nSua conta NГO ESTБ registrada!\nNick: %s\nLevel: %d\nClique em Registrar para poder jogar!\n\n------------ [ Brasil Fire Street v4.0 ] ------------", PlayerName(playerid), pInfo[playerid][Level]);
ShowPlayerDialog(playerid, D_REGISTRO, DIALOG_STYLE_PASSWORD, "Registrando conta", String, "Registrar", "Cancelar");
}
}
InterpolateCameraPos(playerid, -2397.553710, 1436.038452, 140.798019, -2876.055175, 1382.189697, 159.150161, 17000);
InterpolateCameraLookAt(playerid, -2401.776855, 1438.431640, 139.599197, -2872.188964, 1384.818359, 157.377395, 17000);
InterpolateCameraTeste(playerid, 1481.2673,-1788.5336,156.7533, 1436.5804,-1377.2772,154.8182, 1000);
return 1;
}
Login/Registro (DialogResponse):
case D_REGISTRO:
{
if(response)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 16 &&!strlen(inputtext))
{
SendClientMessage(playerid, COR_CEU, "• Digite uma Senha com no Minimo 5 caracteres ou no Maximo 16");
format(String, sizeof(String),"{FFFFFF}------------ [ Brasil Fire Street v4.0 ] ------------\n\nSua conta NГO ESTБ registrada!\nNick: %s\nLevel: %d\nClique em Registrar para poder jogar!\n\n------------ [ Brasil Fire Street v4.0 ] ------------", PlayerName(playerid), pInfo[playerid][Level]);
ShowPlayerDialog(playerid, D_REGISTRO, DIALOG_STYLE_PASSWORD, "Registrando conta", String, "Registrar", "Cancelar");
return 1;
}
DOF2_CreateFile(Arquivo);
DOF2_SetString(Arquivo, "Nome", PlayerName(playerid));
DOF2_SetString(Arquivo, "Senha", inputtext);
DOF2_SetInt(Arquivo, "Profissao", DESEMPREGADO);
DOF2_SetInt(Arquivo, "Dinheiro", 500);
DOF2_SetInt(Arquivo, "Level", 0);
DOF2_SetInt(Arquivo, "Skin", 23);
DOF2_SetInt(Arquivo, "Sexo", -1);
DOF2_SetInt(Arquivo, "AdminL", 0);
DOF2_SetInt(Arquivo, "Administrador", 0);
DOF2_SetInt(Arquivo, "Moderador", 0);
DOF2_SetInt(Arquivo, "Ajudante", 0);
DOF2_SetInt(Arquivo, "Corregedor", 0);
DOF2_SetInt(Arquivo, "ContaBanco", 0);
DOF2_SaveFile();
pInfo[playerid][Logado] = true;
new
linha_1[] = "{00FF00}» {FFFFFF} Sexo.\n",
linha_2[] = "M-Masculino.",
linha_3[] = "F-Feminino.",
stg[512]
;
format(stg, sizeof(stg), "%s\n%s\n%s\n%s\n%s", linha_1, linha_2, linha_3);
ShowPlayerDialog(playerid, D_SEXO, DIALOG_STYLE_MSGBOX, "Sou do sexo...", stg, "M", "F");
return 1;
}
else
{
format(String, sizeof(String),"• O Jogador(a) %s foi Kickado do Servidor | Motivo: N/A Registrou |", PlayerName(playerid), IP(playerid));
SendClientMessageToAll(COR_ERRO, String);
Kick(playerid);
}
}
case D_LOGIN:
{
if(response)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, COR_CEU, "• Vocк precisa digitar Sua Senha para Logar.");
format(String, sizeof(String),"{FFFFFF}------------ [ Brasil Fire Street v4.0 ] ------------\n\nSua conta ESTБ registrada!\nNick: %s\nLevel: %d\nClique em Logar para poder jogar!\n\n------------ [ Brasil Fire Street v4.0 ] ------------", PlayerName(playerid), pInfo[playerid][Level]);
ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "Logando conta", String, "Logar", "Cancelar");
return 1;
}
if(!strcmp(inputtext,DOF2_GetString(Arquivo,"Senha"),false))
{
CarregarFile(playerid);
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, 0);
pInfo[playerid][Logado] = true;
return 1;
}
else
{
SendClientMessage(playerid, COR_CEU, "• Atenзгo vocк digitou sua senha Errado, Digite-a Novamente.");
format(String, sizeof(String),"{FFFFFF}------------ [ Brasil Fire Street v4.0 ] ------------\n\nSua conta ESTБ registrada!\nNick: %s\nLevel: %d\nClique em Logar para poder jogar!\n\n------------ [ Brasil Fire Street v4.0 ] ------------", PlayerName(playerid), pInfo[playerid][Level]);
ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "Logando conta", String, "Logar", "Cancelar");
ERRO[playerid]++;
if(ERRO[playerid] == 3)
{
format(String, sizeof(String),"• O Jogador(a) %s foi Kickado do Servidor | Motivo: Limite de Erro |", PlayerName(playerid), IP(playerid));
SendClientMessageToAll(COR_ERRO, String);
Kick(playerid);
return 1;
}
}
}
else
{
format(String, sizeof(String),"• O Jogador(a) %s foi Kickado do Servidor | Motivo: N/A Registrou |", PlayerName(playerid), IP(playerid));
SendClientMessageToAll(COR_ERRO, String);
Kick(playerid);
}
}