[Ajuda] Botгo SPAWN no login ao errar Password
#1

Nгo botei as imagens no tуpico pq sгo muito grandes

Basicamente ao entrar no servidor meu login й assim ( http://imgur.com/vo31Avx.png ), mas se eu errar a senha ele fica assim ( http://i.imgur.com/svBRU5j.png ) e dб para spawnar como mostra aqui ( http://i.imgur.com/mQdCX3g.jpg )

Alguйm me pode ajudar?

Cуdigo:
PHP код:
public OnPlayerConnect(playerid)
{
    new 
pName[MAX_PLAYER_NAME], dialogTitle[128], string[48 MAX_PLAYER_NAME+1];
        
    
GetPlayerName(playeridpNamesizeof(pName));
    
    
format(dialogTitlesizeof(dialogTitle), "%s"SERVER_NAME);
    
    
format(stringsizeof(string), "{6FDD96}Server: {FFFFFF}%s has joined the server."pName);
    
SendClientMessageToAll(-1string);
    
    if(
fexist(Path(playerid)))
    {
        
INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra true, .extra playerid); //Will load user's data using INI_Parsefile.
        
ShowPlayerDialog(playerid,dLogin,DIALOG_STYLE_PASSWORD,dialogTitle,"Welcome back. Your account is registered in our users database.\nProcceed by typing your password in the blank space below and logging in.","Login","Quit");//Login dialog
    
}
    else
    {
        
ShowPlayerDialog(playerid,dRegister,DIALOG_STYLE_PASSWORD,dialogTitle,"Welcome to our server. Your account is not registered in our users database.\nProcceed by typing your password in the blank space below and registering.","Register","Quit");//Registration dialog
        
return 1;
    }
    
SendClientMessage(playeridCOLOR_YELLOW"[TNT]===========[TRUCK N' TRAILERS]============[TNT]");
    
SendClientMessage(playeridCOLOR_YELLOW"                                                    ");
    
SendClientMessage(playeridCOLOR_YELLOW" Welcome! You are playing on Truck n' Trailers now! ");
    
SendClientMessage(playeridCOLOR_YELLOW"        This server use 0.3.7 SA:MP Version         ");
    
SendClientMessage(playeridCOLOR_YELLOW"                                                    ");
    
SendClientMessage(playeridCOLOR_YELLOW"[TNT]===========[SERVER  ANNOUNCER]============[TNT]");
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == dRegister)
    {
        if(!
response) return Kick(playerid);
        if(
response)
        {
            if(!
strlen(inputtext) || strlen(inputtext) < 4)
            {
                
ShowPlayerDialog(playerid,dRegister,DIALOG_STYLE_PASSWORD,"ERROR: MUST ENTER A PASSWORD","Welcome to our server. Your account is not registered in our users database.\nProcceed by typing your password in the blank space below and registering.","Register","Quit");
                return 
1;
            }
            new 
hashpass[129];
            
WP_Hash(hashpass,sizeof(hashpass),inputtext);
            new 
INI:file INI_Open(Path(playerid));
            
INI_SetTag(file,"Player's Data");
            
INI_WriteString(file,"Password",hashpass);
            
INI_WriteInt(file,"Money",0);
            
INI_WriteInt(file,"Skin",0);
            
INI_WriteInt(file,"Kills",0);
            
INI_WriteInt(file,"Deaths",0);
            
INI_Close(file);
            
newReg[playerid] = true;
            
GivePlayerCash(playerid15000);
            
SendClientMessage(playerid,-1,"{6FDD96}Server: {FFFFFF}You're ready to play. Click the {6FDD96}SPAWN {FFFFFF}button and enjoy the server!");
            return 
1;
        }
    }
    if(
dialogid == dLogin)
    {
        if(!
response) return Kick(playerid);
        if(
response)
        {
            new 
hashpass[129];
            
WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!
strcmp(hashpasspInfo[playerid][Pass], false))
            {
                
INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra true, .extra playerid);
                
Logged[playerid] = true;
                
GivePlayerCash(playeridpInfo[playerid][Money]);
                
SendClientMessage(playerid,-1,"{6FDD96}Server: {FFFFFF}Welcome back. You have successfully logged in!");
            }
            else
            {
                
ShowPlayerDialog(playerid,dLogin,DIALOG_STYLE_PASSWORD,"ERROR: INCORRECT PASSWORD","Welcome back. Your account is registered in our users database.\nProcceed by typing your password in the blank space below and logging in.","Login","Quit");//We will tell to them that they've entered an incorrect password
                
return 1;
            }
        }
    }
    return 
1;

Grato!
Reply


Messages In This Thread
Botгo SPAWN no login ao errar Password - by NikiFor - 04.10.2015, 23:37
Re: Botгo SPAWN no login ao errar Password - by LosLipe - 04.10.2015, 23:47
Re: Botгo SPAWN no login ao errar Password - by NikiFor - 04.10.2015, 23:53
Re: Botгo SPAWN no login ao errar Password - by FanonRiouDiou - 05.10.2015, 00:21
Re: Botгo SPAWN no login ao errar Password - by NikiFor - 05.10.2015, 00:31
Re: Botгo SPAWN no login ao errar Password - by FanonRiouDiou - 05.10.2015, 01:36
Re: Botгo SPAWN no login ao errar Password - by HardWar - 05.10.2015, 01:53
Re: Botгo SPAWN no login ao errar Password - by VeNuZ_ - 05.10.2015, 07:48

Forum Jump:


Users browsing this thread: 1 Guest(s)