Помогите с регистрацией/авторизация
#5

вот берите пожалуйста)

PHP код:
stock OnPlayerLogged(playeridpassword[])
{
    new 
string[100];
    
format(string,sizeof(string),PS,GN(playerid));
    new 
iniFile ini_openFile (string);
    
ini_getString(iniFile,"Password"string);
    if(
strcmp(stringpasswordtrue10) == 0)
    {
        
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
        
ini_getInteger(iniFile,"Admin",PlayerInfo[playerid][pAdmin]);
        
ini_getInteger(iniFile,"Char",PlayerInfo[playerid][pChar]);
        
ini_getInteger(iniFile,"Ban",PlayerInfo[playerid][pBan]);
        
ini_getInteger(iniFile,"Warn",PlayerInfo[playerid][pWarn]);
        
ini_getInteger(iniFile,"Mute",PlayerInfo[playerid][pMute]);
        
ini_getInteger(iniFile,"Score",PlayerInfo[playerid][pScore]);
        
ini_getInteger(iniFile,"Exp",PlayerInfo[playerid][pExp]);
        
ini_getInteger(iniFile,"Drugs",PlayerInfo[playerid][pDrugs]);
        
ini_getInteger(iniFile,"Cash",PlayerInfo[playerid][pCash]);
        
ini_getInteger(iniFile,"Member",PlayerInfo[playerid][pMember]);
        
ini_getInteger(iniFile,"Leader",PlayerInfo[playerid][pLeader]);
        
ini_getInteger(iniFile,"Bank",PlayerInfo[playerid][pBank]);
        
ini_getInteger(iniFile,"House",PlayerInfo[playerid][pHouse]);
        
ini_getInteger(iniFile,"Kills",PlayerInfo[playerid][pKills]);
        
ini_getInteger(iniFile,"Death",PlayerInfo[playerid][pDeath]);
        
ini_closeFile(iniFile);
        
PlayerInfo[playerid][pLogged] = true;
        if(
PlayerInfo[playerid][pMember] == 0) return ShowPlayerDialog(playerid,d_member,DIALOG_STYLE_LIST,"{00ffa6}Выберите банду{ffffff}","Grove Street Gang\nThe Ballas Gang\nLos Santos Vagos Gang\nThe Rifa Gang\nVarios Los Aztecas Gang","Выбрать","");
        
SetPlayerSkin(playerid,PlayerInfo[playerid][pChar]);
        
SpawnPlayer(playerid);
    }
    else
    {
        if(
PlayerInfo[playerid][pPLogged] == 2) return  Kick(playerid);
        
PlayerInfo[playerid][pPLogged] += 1;
        switch(
PlayerInfo[playerid][pPLogged])
        {
        case 
1SendClientMessage(playerid,COLOR_RED,"Вы ввели неверный пароль. Осталось 2 попытки");
        case 
2SendClientMessage(playerid,COLOR_RED,"Вы ввели неверный пароль. Осталось 1 попытка");
        }
        
ShowPlayerLoginDialog(playerid);
        
ini_closeFile(iniFile);
    }
    return 
true;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)