[AJUDA]Trocar Registro de Dialog para Comando
#1

Galeraa vim aqui pedir a ajuda de vocкs mais uma vez, gostaria de trocar esse Sistema de Registro Por Dialog para Comando Ex: /registrar e /login (: ai estгo as Public's

OnPlayerConnect [ACHO QUE NГO PRECISA *-*]
PHP код:
public OnPlayerConnect(playerid)
{
        
logado[playerid] = 0;
   new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(filesizeof(file), "%s.ini"name);
    if (!
dini_Exists(file))
    {
       
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Registro""Bem-vindo, Vocк nгo й registrado\nPorfavor insira uma senha abaixo para se registrar.""Registrar""Sair");
    }
    if(
fexist(file))
    {
       
ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Login""Bem-vindo Novamente\nInsira sua senha abaixo para Logar !""Logar""Sair");
    }
    if(
PlayerInfo[playerid][Warns] == 5)
    {
        
SendClientMessage(playerid0xFF00CC"Vocк foi kickado por errar sua senha 5 vezes !");
                
Kick(playerid);
        }

OnPlayerDisconnect [ACHO QUE NГO PRECISA *-*]
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
#if Leavemessages == true
    
switch (reason)
    
GetPlayerName(playerid,name,24);
    
format(file,sizeof(file),"%s.ini",name);
    if(
dini_Exists(file))
    {
        
dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
        
dini_IntSet(file,"Score",GetPlayerScore(playerid));
        
dini_IntSet(file,"Level",PlayerInfo[playerid][Admin]);
        
dini_IntSet(file,"GATLevel",PlayerInfo[playerid][GAT]);
        
dini_IntSet(file,"Warns",PlayerInfo[playerid][Warns]);
        
logado[playerid] = 0;
        }
        {
                case 
0:
        {
            if(
SilentBanKick[playerid] == 0)
            {
                                
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
                                
format(string256"%s(%i) saiu do server! (Crash/Conexгo)"PlayerName);
                                
SendClientMessageToAll(leavemessagecolorstring);
                        }
                }
                case 
1:
                {
                        if(
SilentBanKick[playerid] == 0)
            {
                                
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
                                
format(string256"%s(%i) saiu do server! (Saindo...)"PlayerName);
                                
SendClientMessageToAll(leavemessagecolorstring);
                        }
                }
                case 
2:
                {
                        if(
SilentBanKick[playerid] == 0)
            {
                                
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
                                
format(string256"%s(%i) saiu do server! (Kickado/Banido)"PlayerName);
                                
SendClientMessageToAll(leavemessagecolorstring);
                        }
    if(
strfind(Nome"con"true) == -1)
    {
        
SendClientMessage(playerid0xFFFFFFFF"Cheirou dorgas? quer hackiar o server nй? vai ficar querendo segura o kick.");
        
Kick(playerid);
                }
        }
            return 
1;
    }
    return 
1;
    
#endif

OnDialogResponse
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
if (
dialogid == 1)
        {
                new 
name[MAX_PLAYER_NAME], string[128];
                
GetPlayerName(playeridnamesizeof(name));
                
format(filesizeof(file), "%s.ini"name);
                if(!
response) return Kick(playerid);
                if(!
strlen(inputtext)) return
                
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Registro""Bem-vindo, Vocк nгo й Registrado\nPorfavor insira uma senha abaixo para se registrar.""Registrar""Sair");
                
dini_Create(file);
                
dini_IntSet(file"Password"udb_hash(inputtext));
                
dini_IntSet(file"Level",PlayerInfo[playerid][Admin] = 0);
                
dini_IntSet(file"Cash",PlayerInfo[playerid][Cash] = 500);
                
dini_IntSet(file"Score",PlayerInfo[playerid][Score] = 0);
                
dini_IntSet(file"GATLevel",PlayerInfo[playerid][GAT] = 0);
                
dini_IntSet(file"Warns",PlayerInfo[playerid][Warns] = 0);
                
format(string128"[GTE]INFROMA: Parabйns vocк se registrou com o Nick %s e com a Senha %s, Guarde bem estб senha !"nameinputtext);
                
SendClientMessage(playerid0xFF00CCstring);
                
logado[playerid] = 1;
        }
if (
dialogid == 2)
        {
      new 
name[MAX_PLAYER_NAME];
      
GetPlayerName(playeridnamesizeof(name));
      
format(filesizeof(file), "%s.ini"name);
      if(!
response) return Kick(playerid);
      if (!
strlen(inputtext)) return ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Login""Bem-vindo Novamente\nInsira sua senha abaixo para Logar !""Logar""Sair");
      new 
tmp;
      
tmp dini_Int(file"Password");
      if(
udb_hash(inputtext) != tmp) {
      
SendClientMessage(playerid0xFF0000FF"[ERRO] Senha Incorreta !");
      
ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Login""Bem-vindo Novamente\nInsira sua senha abaixo para Logar !""Logar""Sair");
      }
      else
      {
                
logado[playerid] = 1;
        
SetPlayerMoney(playeriddini_Int(file"Cash"));
        
SetPlayerScore(playeriddini_Int(file"Score"));
        
SetPlayerColor(playeriddini_Int(file"Color"));
        
PlayerInfo[playerid][Admin] = dini_Int(file"Level");
        
PlayerInfo[playerid][GAT] = dini_Int(file"GATLevel");
        
PlayerInfo[playerid][Warns] = dini_Int(file"Warns");
        
SendClientMessage(playerid,0xFF00CC"[GTE]INFORMA: Vocк se logou com sucesso !!");
        }
        return 
1;
     }
    return 
0;

Reply
#2

Man melhor vocк usar este sistema jб pronto ai
https://sampforum.blast.hk/showthread.php?tid=108030

Espero ter ajudado.
Reply
#3

Nгo mano nгo ajudam, quero que troque o Comando Por DIALOG para CMD
Reply
#4

Ok, tentei ajudar, vamos vкr se alguйm ajuda!

UP!
Reply
#5

AJUDEM AК PRECISO MUITO MUDAR ISSO PARA CRIAR MENUS DEPOIS QUE USAR O COMANDO /REGISTRAR
Reply
#6

Porque nгo pegar e coloca o dialog para aparecer assim que terminar de logar?
Reply
#7

Tipo to criando um server de torcidas #RIAIRAIRAI, ae tipo quando o cara se registrar apareзe o Menu de qual torcidas ele quer ser
Reply
#8

PHP код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!
strcmp(cmdtext,"/logar",true))
    {
        new 
name[MAX_PLAYER_NAME]; 
        
GetPlayerName(playeridnamesizeof(name)); 
        
format(filesizeof(file), "%s.ini"name); 
        if(!
fexist(file)) return SendClientMessage(playerid0xFF00CC"Registre-se antes de logar /registrar");
        
ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Login""Bem-vindo Novamente\nInsira sua senha abaixo para Logar !""Logar""Sair");    
        return 
true;
    }
    if(!
strcmp(cmdtext,"/registrar",true))
    {
        new 
name[MAX_PLAYER_NAME]; 
        
GetPlayerName(playeridnamesizeof(name)); 
        
format(filesizeof(file), "%s.ini"name); 
        if(
fexist(file)) return SendClientMessage(playerid0xFF00CC"Logue-se, vocк ja estб registrado /logar");
        
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Registro""Bem-vindo, Vocк nгo й registrado\nPorfavor insira uma senha abaixo para se registrar.""Registrar""Sair");     
        if(
PlayerInfo[playerid][Warns] == 5SendClientMessage(playerid0xFF00CC"Vocк foi kickado por errar sua senha 5 vezes !"),Kick(playerid);
        return 
true;
    }
    return 
false;

...
Reply
#9

Entгo mantem em dialog e faz isso:
No inicio:
pawn Код:
forward EscolherTorcida(Playerid);
pawn Код:
public EscolherTorcida(Playerid)
{
    if(IsPlayerConnected(playerid))
        {
      ShowPlayerDialog(playerid, 188, DIALOG_STYLE_LIST, "Torcida", "Flamengo\nCorinthians\nEtc... !", "Escolher", "Sair");
//Cada \n й um iten na lista
        }
    return 1;
}
Depois do cara digitar a senha e for logar basta adicionar
EscolherTorcida(Playerid); isso ao codigo

Ja no OnDialogResponse Adicione isso
pawn Код:
if(dialogid == 188)
    {
        if(response)
        {
            if(listitem == 0)
            {
//Se ele escolher o primeiro item da lista anterior
            }
            if(listitem == 1)
            {
//Segundo item da lista
            }
        }
    }
Reply
#10

Mais quero tirar tambйm a Dialog ta dando muito erro :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)