No login in time = Kick (Help +Rep)
#1

pawn Код:
forward AKICK(playerid);
public AKICK(playerid)
{
    GameTextForPlayer(playerid, "You have ~g~10~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK9", 1000, false, "i", playerid);

    if(PlayerInfo[playerid][LoggedIn] == 1)
    {
        new string[128];
        format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level] );
        return SendClientMessage(playerid,green,string);
        KillTimer(playerid);
    }
    return 1;
}
forward AKICK9(playerid);
public AKICK9(playerid)
{

    GameTextForPlayer(playerid, "You have ~g~9~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK8", 1000, false, "i", playerid);

}
forward AKICK8(playerid);
public AKICK8(playerid)
{

    GameTextForPlayer(playerid, "You have ~g~8~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK7", 1000, false, "i", playerid);

}
forward AKICK7(playerid);
public AKICK7(playerid)
{

    GameTextForPlayer(playerid, "You have ~y~7~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK6", 1000, false, "i", playerid);

}
forward AKICK6(playerid);
public AKICK6(playerid)
{

    GameTextForPlayer(playerid, "You have ~y~6~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK5", 1000, false, "i", playerid);

}
forward AKICK5(playerid);
public AKICK5(playerid)
{

    GameTextForPlayer(playerid, "You have ~b~5~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK4", 1000, false, "i", playerid);

}
forward AKICK4(playerid);
public AKICK4(playerid)
{

    GameTextForPlayer(playerid, "You have ~b~4~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK3", 1000, false, "i", playerid);

}
forward AKICK3(playerid);
public AKICK3(playerid)
{

    GameTextForPlayer(playerid, "You have ~r~3~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK2", 1000, false, "i", playerid);

}
forward AKICK2(playerid);
public AKICK2(playerid)
{

    GameTextForPlayer(playerid, "You have ~r~2~w~ seconds to login!", 5000, 6);
    SetTimerEx("AKICK1", 1000, false, "i", playerid);

}
forward AKICK1(playerid);
public AKICK1(playerid)
{

    GameTextForPlayer(playerid, "You have ~r~1~w~ seconds to login!", 5000, 6);
    Kick(playerid);

}

Login CMD:

pawn Код:
CMD:login(playerid,params[])
{
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"ACCOUNT: You are already logged in.");
    if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"ACCOUNT: Account doesn't exist, please use '/register [password]'.");
    if (strlen(params)==0) return SendClientMessage(playerid,red,"ACCOUNT: Correct usage: '/login [password]'");
    if (udb_CheckLogin(PlayerName2(playerid),params))
    {
        new file[256], tmp3[100], string[128];
        format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
        GetPlayerIp(playerid,tmp3,100);
        dini_Set(file,"ip",tmp3);
        LoginPlayer(playerid);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        if(PlayerInfo[playerid][Level] > 0)
        {
            SetTimerEx("AKICK", 5000, false, "i", playerid);
            return 1;


        } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In");
    }
    else {
        PlayerInfo[playerid][FailLogin]++;
        printf("LOGIN: %s has failed to login, Wrong password (%s) Attempt (%d)", PlayerName2(playerid), params, PlayerInfo[playerid][FailLogin] );
        if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
        {
            new string[128]; format(string, sizeof(string), "%s has been kicked (Failed Logins)", PlayerName2(playerid) );
           
            SendClientMessageToAll(grey, string);
            print(string);
            Kick(playerid);
        }
        return SendClientMessage(playerid,red,"ACCOUNT: Login failed! Incorrect Password");
    }
}
If player logins KillTimer? How Please help
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)