#include a_samp
#include bIni
#if defined MAX_PLAYERS
#undef MAX_PLAYERS
#endif
#define MAX_PLAYERS 45
#define contas "%s.ini"
#define login "Bem vindo ao servidor %s digite sua senha para logar-se."
#define registro "Bem vindo ao servidor %s registre-se."
enum pInfo
{
pGrana,
pLevel,
};
new playerinfo[MAX_PLAYERS][pInfo];
new
file[50],
nome[24],
paramount[90]
;
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid,nome,24);
format(file,50,contas,nome);
if(fexist(file))
{
GetPlayerName(playerid,nome,24);
format(paramount,90,login,nome);
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor",paramount,"entrar","Sair");
}
else
{
GetPlayerName(playerid,nome,24);
format(paramount,90,registro,nome);
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Servidor",paramount,"registrar","Sair");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9999)
{
if(!response) return Kick(playerid);
if(response)
{
GetPlayerName(playerid,nome,24);
format(file,50,contas,nome);
INI_Open(file);
INI_WriteString("senha",inputtext);
playerinfo[playerid][pLevel] = INI_WriteInt("level",5);
playerinfo[playerid][pGrana] = INI_WriteInt("dinheiro",5000);
INI_Save();
INI_Close();
format(paramount,90,login,nome);
new len = strlen(inputtext);
if(len < 5 || len > 20) return ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Servidor","Senha deve conter no minimo 5 caracteres.","Ok","kick");
return ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor",login,"Ok","fechar");
}
}
if(dialogid == 9998)
{
if(!response) return Kick(playerid);
if(response)
{
new senha[20];
GetPlayerName(playerid,nome,24);
format(senha,20,"%s",strval(inputtext));
format(file,50,contas,nome);
INI_Open(file);
INI_ReadString("senha");
INI_Close();
if(strcmp(senha,inputtext,true) == 0)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor","senha errada, digite a senha correta para logar-se.","Ok","Sair");
return SendClientMessage(playerid,-1,"senha errada.");
}
GetPlayerName(playerid,nome,24);
format(file,28,contas,nome);
INI_Open(file);
SetPlayerScore(playerid,INI_ReadInt("level"));
GivePlayerMoney(playerid,INI_ReadInt("dinheiro"));
INI_Close();
}
else
{
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor","senha errada, insira a senha correta.","Ok","Sair");
SendClientMessage(playerid,-1,"senha errada.");
}
}
}
return 1;
}
#include a_samp
#include DOF2
#if defined MAX_PLAYERS
#undef MAX_PLAYERS
#endif
#define MAX_PLAYERS 45
#define contas "%s.ini"
#define login "Bem vindo ao servidor %s digite sua senha para logar-se."
#define registro "Bem vindo ao servidor %s registre-se."
enum pInfo
{
pGrana,
pLevel,
};
new playerinfo[MAX_PLAYERS][pInfo];
new
arquivo[50],
nome[24],
paramount[90]
;
public OnFilterScriptExit()
{
DOF2_Exit();
return 1;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid,nome,24);
format(arquivo,50,contas,nome);
if(fexist(arquivo))
{
GetPlayerName(playerid,nome,24);
format(paramount,90,login,nome);
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor",paramount,"entrar","sair");
}
else
{
GetPlayerName(playerid,nome,24);
format(paramount,90,registro,nome);
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Servidor",paramount,"registrar","sair");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9999)
{
if(!response) return Kick(playerid);
if(response)
{
GetPlayerName(playerid,nome,24);
format(arquivo,50,contas,nome);
DOF2_CreateFile(arquivo);
DOF2_SetString(arquivo,"senha",inputtext);
playerinfo[playerid][pLevel] = DOF2_SetInt(arquivo,"level",5);
playerinfo[playerid][pGrana] = DOF2_SetInt(arquivo,"dinheiro",5000);
format(paramount,90,login,nome);
new len = strlen(inputtext);
if(len < 5 || len > 20) return ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Servidor","Senha deve conter no minimo 5 caracteres.","Ok","kick");
return ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor",login,"ok","fechar");
}
}
if(dialogid == 9998)
{
if(!response) return Kick(playerid);
if(response)
{
new senha[20];
GetPlayerName(playerid,nome,24);
format(arquivo,50,contas,nome);
format(senha,20,"%s",strval(inputtext));
if(strcmp(inputtext,DOF2_GetString(arquivo,"senha"),true) == 0)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor","senha errada, digite a senha correta para logar-se.","ok","sair");
return SendClientMessage(playerid,-1,"senha errada.");
}
GetPlayerName(playerid,nome,24);
format(arquivo,28,contas,nome);
SetPlayerScore(playerid,DOF2_GetInt(arquivo,"level"));
GivePlayerMoney(playerid,DOF2_GetInt(arquivo,"dinheiro"));
}
else
{
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor","senha errada, insira a senha correta.","ok","sair");
SendClientMessage(playerid,-1,"senha errada.");
}
}
}
return 1;
}
#include a_samp
#include SII
#if defined MAX_PLAYERS
#undef MAX_PLAYERS
#endif
#define MAX_PLAYERS 45
#define contas "%s.ini"
#define login "Bem vindo ao servidor %s digite sua senha para logar-se."
#define registro "Bem vindo ao servidor %s registre-se."
enum pInfo
{
pGrana,
pLevel,
};
new playerinfo[MAX_PLAYERS][pInfo];
new
file[50],
nome[24],
paramount[90]
;
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid,nome,24);
format(file,50,contas,nome);
if(fexist(file))
{
GetPlayerName(playerid,nome,24);
format(paramount,90,login,nome);
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor",paramount,"entrar","sair");
}
else
{
GetPlayerName(playerid,nome,24);
format(paramount,90,registro,nome);
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Servidor",paramount,"registrar","sair");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9999)
{
if(!response) return Kick(playerid);
if(response)
{
GetPlayerName(playerid,nome,24);
format(file,50,contas,nome);
INI_Open(file);
INI_WriteString("senha",inputtext);
playerinfo[playerid][pLevel] = INI_WriteInt("level",5);
playerinfo[playerid][pGrana] = INI_WriteInt("dinheiro",5000);
INI_Save();
INI_Close();
format(paramount,90,login,nome);
new len = strlen(inputtext);
if(len < 5 || len > 20) return ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Servidor","Senha deve conter no minimo 5 caracteres.","Ok","kick");
return ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor",login,"ok","fechar");
}
}
if(dialogid == 9998)
{
if(!response) return Kick(playerid);
if(response)
{
new senha[20];
GetPlayerName(playerid,nome,24);
format(senha,20,"%s",strval(inputtext));
format(file,50,contas,nome);
INI_Open(file);
INI_ReadString(senha,"senha");
INI_Close();
if(strcmp(senha,inputtext,true) == 0)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor","senha errada, digite a senha correta para logar-se.","ok","sair");
return SendClientMessage(playerid,-1,"senha errada.");
}
GetPlayerName(playerid,nome,24);
format(file,28,contas,nome);
INI_Open(file);
SetPlayerScore(playerid,INI_ReadInt("level"));
GivePlayerMoney(playerid,INI_ReadInt("dinheiro"));
INI_Close();
}
else
{
ShowPlayerDialog(playerid,9998,DIALOG_STYLE_INPUT,"Servidor","senha errada, insira a senha correta.","ok","sair");
SendClientMessage(playerid,-1,"senha errada.");
}
}
}
return 1;
}
This forum requires that you wait 120 seconds between posts. Please try again in 32 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 22 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 3 seconds.
voce devia de por as includes ente < > e nao ha solta,mas mesmo assim,esta bom.
PHP код:
PHP код:
PHP код:
|
voce devia de por as includes ente < > e nao ha solta,mas mesmo assim,esta bom.
PHP код:
PHP код:
PHP код:
|