help dialog
#5

Try this. Added an else statement.

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 

    if(
dialogid == DIALOG_CLASS_POLICIER
    { 
         switch(
listitem
        { 
            case 
0GivePlayerWeapon(playerid229999); 
        } 
    } 
     switch(
dialogid
    { 
        case 
LoginDialog
        { 
            if(!
responseKick(playerid); 
            new 
hashpass[129], query[100], playername[MAX_PLAYER_NAME]; 
            
GetPlayerName(playeridplayernamesizeof(playername)); 
            
WP_Hash(hashpasssizeof(hashpass), inputtext); 
            if(!
strcmp(hashpassPlayer[playerid][Password])) 
            { 
                
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1"playername); 
                
mysql_tquery(mysqlquery"OnAccountLoad""i"playerid); 
            } 
            else 
            { 
                
SendClientMessage(playerid, -1"Tu as entrйe un mauvais mot de pass!"); 
                
ShowPlayerDialog(playeridLoginDialogDIALOG_STYLE_INPUT"Connection""Bonjour!\nVous etes dйjа enregistrer. si te plait connecte toi:""Login""Quit"); 
            } 
        } 
        case 
RegisterDialog
        { 
            if(!
response) return Kick(playerid); 
            if(
strlen(inputtext) < 5
            { 
                
SendClientMessage(playerid, -1"Ton mot de pass doit avoir au moin 4 caractиres."); 
                return 
ShowPlayerDialog(playeridRegisterDialogDIALOG_STYLE_INPUT"Enregistrement""Bonjour!!\nTon compte n'est pas enregistrer connecte toi avec un mot de pass de ton choix:""Register""Quit"); 
            } 
            new 
query[512], playername[MAX_PLAYER_NAME], playerip[16]; 
            
GetPlayerName(playeridplayernamesizeof(playername)); 
            
GetPlayerIp(playeridplayeripsizeof(playerip)); 
            
WP_Hash(Player[playerid][Password], 129inputtext); 
            
mysql_format(mysqlquerysizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `Level`, `Infamie`) VALUES ('%e', '%e', '%e', 0, 0, 0, 0, 0)"playernamePlayer[playerid][Password], playeripSPAWN_XSPAWN_YSPAWN_ZSPAWN_A); 
            
mysql_tquery(mysqlquery"OnAccountRegister""i"playerid); 
        } 
    } 
    return 
1

Reply


Messages In This Thread
help dialog - by Eymeric69 - 22.06.2016, 11:04
Re: help dialog - by mjay768 - 22.06.2016, 13:44
Re: help dialog - by Eymeric69 - 22.06.2016, 13:46
Re: help dialog - by Stinged - 22.06.2016, 13:53
Re: help dialog - by mjay768 - 22.06.2016, 13:54
Re: help dialog - by Eymeric69 - 22.06.2016, 17:03
Re: help dialog - by F1N4L - 22.06.2016, 17:09
Re: help dialog - by Eymeric69 - 22.06.2016, 17:12
Re: help dialog - by Stinged - 22.06.2016, 17:35
Re: help dialog - by Eymeric69 - 22.06.2016, 18:31

Forum Jump:


Users browsing this thread: 2 Guest(s)