SA-MP Forums Archive
LOGIN /REGISTER Question [REP+] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: LOGIN /REGISTER Question [REP+] (/showthread.php?tid=537385)



LOGIN /REGISTER Question [REP+] - AwokenNeoX - 15.09.2014

Hello guys,

I want to say the player if he clicks the ok button after he has register. But only if he not gets the Error Message

This Message:

PHP код:
SendClientMessage(playerid,COLOR_YELLOW,"* Your Account have been successfully registered in the database!"); 
Thats my Code:

PHP код:
    if(dialogid==DIALOG_REGISTER)
    {
        if(
response)
        {
            new 
name[MAX_PLAYER_NAME],query[128],password[35];
            
GetPlayerName(playerid,name,sizeof(name));
            if(
strlen(inputtext)>3)
            {
                
mysql_escape_string(inputtext,password,dbhandle);
                
format(query,sizeof(query),"INSERT INTO user (Username,Password) VALUES ('%s','%s') ",name,password);
                
mysql_function_query(dbhandle,query,false,"","");
            }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"Your Password needs to be minimum 4 letters!");
                
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Welcome to UltimateFS\n\nPlease enter a Password","OK","Cancel");
            }
        }
        else
        {
            
Kick(playerid);
        }
        return 
1;
    }
    return 
1



AW: LOGIN /REGISTER Question [REP+] - AwokenNeoX - 15.09.2014

no rply


Re: LOGIN /REGISTER Question [REP+] - DavidBilla - 15.09.2014

pawn Код:
if(dialogid==DIALOG_REGISTER)
    {
        if(response)
        {
            new name[MAX_PLAYER_NAME],query[128],password[35];
            GetPlayerName(playerid,name,sizeof(name));
            if(strlen(inputtext)>3)
            {
                mysql_escape_string(inputtext,password,dbhandle);
                format(query,sizeof(query),"INSERT INTO user (Username,Password) VALUES ('%s','%s') ",name,password);
                mysql_function_query(dbhandle,query,false,"","");
                SendClientMessage(playerid,COLOR_YELLOW,"* Your Account have been successfully registered in the database!");
            }
            else
            {
                SendClientMessage(playerid,COLOR_RED,"Your Password needs to be minimum 4 letters!");
                ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Welcome to UltimateFS\n\nPlease enter a Password","OK","Cancel");
            }
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    return 1;