Need to fix a Bug
#5

try this n tell me if it worked :
PHP код:
if(strcmp(cmd"/register"true) == 0)
    {
        
tmp strtok(cmdtextidx);
        if(
strlen(tmp) == 0) return SendClientMessage(playeridERROR"Use: /register [PASSWORD]");
        
format(file,sizeof(file),"%s.ini"name);
        if(!
fexist(file))
        {
            
dini_Create(file);
            
dini_IntSet(file"Password"udb_hash(tmp));
            
dini_IntSet(file"Money"2500);
            
dini_IntSet(file"Score"1);
            
dini_IntSet(file"Bank"1000);
            
dini_IntSet(file"RobSkill"1);
            
dini_IntSet(file"TerSkill"1);
            
dini_IntSet(file"Admin"0);
            
dini_IntSet(file"Warnings"0);
            
dini_IntSet(file"WantedLevel"0);
            
dini_IntSet(file"Jail"0);
            
dini_IntSet(file"RentalOwner"0);
            
dini_IntSet(file"Drugs"0);
            
dini_IntSet(file"C4"0);
            
dini_IntSet(file"Skin"0);
            
SendClientMessage(playeridGREY"Thanks for registering!");
            
SendClientMessage(playeridGREY"You may now login.");
            
SendClientMessage(playeridGREY"To do so, type: /login [PASSWORD]");
            
GameTextForPlayer(playerid"~r~Registered!"30001);
        }
        else 
SendClientMessage(playeridERROR"This account is already registered in our system. Use: /login [PASSWORD]");
        return 
true;
    }
    if(
strcmp(cmd"/login"true) == 0)
    {
        new 
tmp2[256];
        
tmp strtok(cmdtextidx);
        if(
strlen(tmp) == 0) return SendClientMessage(playeridERROR"Use: /login [PASSWORD]");
        else
        {
            if(
IsPlayerLogged[playerid] == 1) return SendClientMessage(playeridERROR"You are already logged in.");
            else
            {
                if(
fexist(file))
                {
                    
tmp2 dini_Get(file"Password");
                      if(
udb_hash(tmp) != strval(tmp2)) return SendClientMessage(playeridERROR"Invalid password.");
                    else
                    {
                         
IsPlayerLogged[playerid] = 1;
                         
SetPlayerMoney(playeriddini_Int(file"Money"));
                         
SetPlayerScore(playeriddini_Int(file"Score"));
                        
PlayerSkin[playerid] = dini_Int(file,"Skin");
                         
SetPlayerWantedLevel(playeriddini_Int(file"WantedLevel"));
                        
SendClientMessage(playeridGREEN"You are now logged in.you have continue your stats has been automatique saved.");
                        
GameTextForPlayer(playerid"~r~Logged In!"30001);
                    }
                }
                else return 
SendClientMessage(playeridERROR"This username was not found on our database. Use: /register [PASSWORD]");
            }
        }
        return 
true;
    } 
Reply


Messages In This Thread
Need to fix a Bug - by SnipeRz0r - 25.07.2013, 13:46
Re: Need to fix a Bug - by arjanforgames - 25.07.2013, 13:49
Re : Need to fix a Bug - by AmirRFCNR - 25.07.2013, 13:52
Re: Need to fix a Bug - by SnipeRz0r - 25.07.2013, 14:32
Re : Need to fix a Bug - by AmirRFCNR - 25.07.2013, 15:24
Re: Need to fix a Bug - by Binx - 25.07.2013, 15:27
Re : Need to fix a Bug - by AmirRFCNR - 25.07.2013, 15:37
Re: Need to fix a Bug - by SnipeRz0r - 25.07.2013, 15:38
Re: Re : Need to fix a Bug - by Binx - 25.07.2013, 15:40
Re : Need to fix a Bug - by AmirRFCNR - 25.07.2013, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)