Game mod help.
#9

The problem might be here but idk how to fix this shit i cant understand this its mysql.

PHP код:
    if(dialogid == 1//Dialog Register
    
{
        if(
response)
        {
            if(!
strlen(inputtext) || strlen(inputtext) > 20)
            {
                
SendClientError(playerid"You need to login, otherwise you can not spawn");
                
Kick(playerid);
            }
            else if(
strlen(inputtext) > && strlen(inputtext) < 20)
            {
                new 
escpass[20];
                
mysql_real_escape_string(inputtextescpass);
                
MySQL_Register(playeridescpass);
            }
        }
        if(!
response)
        {
                
SendClientInfo(playerid"You need to login before you can play here");
                
Kick(playerid);
        }
    }
    if(
dialogid == 2//Dialog login
    
{
        if(!
response//If they click the cancel button
        
{
                   
SendClientError(playerid"You must login before you spawn!"); //Sends the client a error message
                
Kick(playerid);
        }
        if(
response//If the player clicked login
        
{
            new 
query[200], pname[24], escapepass[100];
            
GetPlayerName(playeridpname24); //Gets the players name
            
mysql_real_escape_string(inputtextescapepass); //We escape the inputtext to avoid SQL injections.
            
format(querysizeof(query), "SELECT `user` = '%s' FROM `PlayerInfo` WHERE `user` = '%s' AND password = '%s'"pnamepnameescapepass);
            
mysql_query(query);
            
mysql_store_result();
            new 
numrows mysql_num_rows();
            if(
numrows == 1MySQL_Login(playerid);
            if(!
numrowsMySQL_LoginFailed(playerid);
            
mysql_free_result();
        }
    } 
Reply


Messages In This Thread
Game mod help. - by TheLegend1 - 31.07.2015, 10:57
Re: Game mod help. - by alistair_hawk - 31.07.2015, 12:49
Re: Game mod help. - by Grundig - 31.07.2015, 13:48
Re: Game mod help. - by TheLegend1 - 31.07.2015, 14:03
Re: Game mod help. - by TheLegend1 - 31.07.2015, 18:10
Re: Game mod help. - by ChristolisTV - 31.07.2015, 18:17
Re: Game mod help. - by TheLegend1 - 31.07.2015, 23:18
Re: Game mod help. - by TheSnaKe - 01.08.2015, 03:03
Re: Game mod help. - by TheLegend1 - 01.08.2015, 10:48

Forum Jump:


Users browsing this thread: 2 Guest(s)