Help with login dialog
#2

replace your code with this
PHP код:
stock AdminRanks(playerid)
{
    new 
strings[270];
    switch(
pInfo[playerid][Admin])
    {
        case 
0strings "Normal Player";
        case 
1strings "Trial Moderator";
        case 
2strings "Server Owner";
    }
    return 
strings;
}
if(
dialogid == dlogin)
    {
//then
        
if(!response){
        
SendClientMessage(playerid, -"{FF0000}* You have been kicked for not logging in !");
        
SetTimerEx("OnPlayerKicked"100false"i"playerid);
        }
        if(
response)
        {
//then
            
new hashpass[129];
            
WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!
strcmp(hashpass,pInfo[playerid][Pass]))
            {
//then
                
INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra true, .extra playerid);
                
SetPlayerScore(playerid,pInfo[playerid][Score]);
                new 
str[500], name[MAX_PLAYER_NAME];
                
GetPlayerName(playeridname,sizeof(name));
                 
format(str,sizeof(str),"{00FFFF}(INFO) Successfully logged in! Welcome back {FFFFFF}%s",name);
                
SendClientMessage(playerid, -1str);
                 
format(str,sizeof(str),"{00FFFF}* Points: {FFFFFF}%i {00FFFF}| Score: {FFFFFF}%i {00FFFF}| Deaths: {FFFFFF}%i {00FFFF}| Kills: {FFFFFF}%i",pInfo[playerid][Points],pInfo[playerid][Score], pInfo[playerid][Deaths], pInfo[playerid][Kills]);
                
SendClientMessage(playerid, -1str);
                if (
pInfo[playerid][Admin] != 0)
                {
                    
format(string16"* Admin Level: %d [%s]"pInfo[playerid][Admin], AdminRanks(playerid));
                    
SendClientMessage2(playeridCOLOR_REDstring);
                    
format(tmp2sizeof(tmp2), "* %s (Id%d) has logged in as admin level %d."playernameplayeridpInfo[playerid][Admin]);
                    for (new 
0PLAYERSi++)
                    {
                        if (!
IsPlayerConnected(i)) continue;
                        if (
pInfo[i][Admin] != && != playeridSendClientMessage(i, -1tmp2);
                    }
                }
                
TogglePlayerSpectating(playerid0);
            }
            else
            {
//then
                
SendClientMessage(playerid, -"{FF0000}* You didn't entered any password or you entered wrong password, for security purposes you must relog fool!");
                
SetTimerEx("OnPlayerKicked"100false"i"playerid);
                return 
1;
            }
        }
    } 
rep if helped ok
Reply


Messages In This Thread
Help with login dialog - by wallen - 28.01.2018, 14:42
Re: Help with login dialog - by BulletRaja - 28.01.2018, 15:05
Re: Help with login dialog - by wallen - 28.01.2018, 15:45
Re: Help with login dialog - by BulletRaja - 28.01.2018, 15:53

Forum Jump:


Users browsing this thread: 1 Guest(s)