pawn Код:
public OnPlayerConnect(playerid)
{
new str[80];
ClearChatbox(playerid, 9);
format(str,sizeof(str),"1° Welcome to %s account is being charged . . .",Nome);
SendClientMessage(playerid, -1, str);
new String[500];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String), "Contas/%s.ini", Nome);
if(!DOF2_FileExists(String))
{
format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Advanced PlayHard RP,й sua primeira vez entгo se registre\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o registro:", Nome);
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Registro", String, "Registrar", "Cancelar");
}
else
{
format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Advanced PlayHard RP, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Registro Com Sucesso", String, "Logar", "Cancelar");
}
return true;
}
if(dialogid == DIALOG_REGISTRO)
{
if(response)
{
if(!strlen(inputtext))
{
new String[1000];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Advanced PlayHard RP, й sua primeira vez entгo se registre\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o registro:", Nome);
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Registro", String, "Registrar", "Cancelar");
SendClientMessage(playerid,0x1E90FFAA,"Senha incorreta !!");
return 1;
}
new String[700];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String), "Contas/%s.ini", Nome);
DOF2_CreateFile(String);
//TitoInfo[playerid][pSenha] = inputtext;
TitoInfo[playerid][pSenha] = DOF2_GetInt(String, "Senha");
TitoInfo[playerid][pAdmin] = 0;
TitoInfo[playerid][pDinheiro] = 1000;
TitoInfo[playerid][pScore] = 1;
TitoInfo[playerid][pAviso] = 0;
TitoInfo[playerid][pTut] = 0;
TemCarteira[playerid] = false;
SpawnPlayer(playerid);
SetPlayerScore(playerid, 1);
GivePlayerMoney(playerid, 10000);
DOF2_CreateFile(String);
DOF2_SaveFile();
SalvarConta(playerid);
format(String,sizeof(String),"Hello %s, you just desired record is level 1 & won $1000 in cash.",Nome);
SendClientMessage(playerid, -1, String);
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Advanced PlayHard RP, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", String, "Logar", "Cancelar");
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Voce Foi Kickado!");
Kick(playerid);
return 1;
}
}
if(dialogid == DIALOG_LOGIN)
{
if(response)
{
if(!strlen(inputtext))
{
new String[1000];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Advanced PlayHard RP, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Registro", String, "Logar", "Cancelar");
SendClientMessage(playerid,0x1E90FFAA,"Senha Incorreta !");
return 1;
}
new String[100], str[200];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String), "Contas/%s.ini", Nome);
if(!strcmp(inputtext,DOF2_GetString(String,"Senha"),false))
{
ClearChatbox(playerid, 50);
CarregarConta(playerid);
format(str,sizeof(str),"Seja Bem Vindo , %s .", Nome);
SendClientMessage(playerid, -1, str);
SendClientMessage(playerid, -1,"Advanced PlayHard RP");
format(str,sizeof(str),"~g~Seja Bem Vindo~n~ ~y~ %s", Nome);
GameTextForPlayer(playerid, str, 2000, 1);
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid,0x00FF00AA,"Senha incorreta digite-a novamente");
format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Advanced PlayHard RP, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Registro", String, "Logar", "Cancelar");
}
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Voce Foi Kickado!");
Kick(playerid);
return 1;
}
}
stock SalvarConta(playerid)
{
new String[99];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String), "Contas/%s.ini", Nome);
DOF2_SetInt(String, "Senha", TitoInfo[playerid][pSenha]);
DOF2_SetInt(String, "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(String, "Banco", TitoInfo[playerid][pBank]);
DOF2_SetInt(String, "Score", GetPlayerScore(playerid));
DOF2_SetInt(String, "AdiminLevel", TitoInfo[playerid][pAdmin]);
DOF2_SetInt(String, "Emprego", TitoInfo[playerid][pJob]);
DOF2_SetInt(String, "Tutorial", TitoInfo[playerid][pTut]);
DOF2_SetInt(String, "Cash", TitoInfo[playerid][pCash]);
DOF2_SetInt(String, "Respeito", TitoInfo[playerid][pRespeito]);
DOF2_SetInt(String, "Aviso", TitoInfo[playerid][pAviso]);
DOF2_SetInt(String, "Mora", TitoInfo[playerid][pMora]);
DOF2_SaveFile();
return 1;
}
stock CarregarConta(playerid)
{
new String[99];
GetPlayerName(playerid, Nome,sizeof(Nome));
format(String, sizeof(String), "Contas/%s.ini", Nome);
TitoInfo[playerid][pSenha] = DOF2_GetInt(String, "Senha");
TitoInfo[playerid][pDinheiro] = DOF2_GetInt(String, "Dinheiro");
TitoInfo[playerid][pBank] = DOF2_GetInt(String, "Banco");
TitoInfo[playerid][pScore] = DOF2_GetInt(String, "Score");
TitoInfo[playerid][pAdmin] = DOF2_GetInt(String, "AdiminLevel");
TitoInfo[playerid][pJob] = DOF2_GetInt(String, "Emprego");
TitoInfo[playerid][pTut] = DOF2_GetInt(String, "Tutorial");
TitoInfo[playerid][pCash] = DOF2_GetInt(String, "Cash");
TitoInfo[playerid][pRespeito] = DOF2_GetInt(String, "Respeito");
TitoInfo[playerid][pAviso] = DOF2_GetInt(String, "Aviso");
TitoInfo[playerid][pMora] = DOF2_GetInt(String, "Mora");
return 1;
}