Login screen attempt tries
#1

Tittle is clear, so I made a script it requires the user to login everything works fine!

The problem is, let's say that I type the wrong password, my server will kick me I want to make some wrong password attempt tries so the user gets kicked after 3 wrong tries!

I can post any codes that you may need and I will rep the best answer ty.
Reply
#2

Код:
new gAttempts[MAX_PLAYERS]; // A global array to store how many attempts the player has had

// When the player enters his password
// CHECK IF IT WAS INCORRECT
{
    gAttempts[playerid]++; // Adds 1 to the attempts count
    If (gAttempts[playerid] == 3) return Kick(playerid); // If the attempts equal 3, it kicks
    ShowPlayerDialog(Your incorrect dialog here)
}
Don't forget to reset gAttempts[playerid] (set it to 0) when the player connects or disconnects.
Reply
#3

PHP код:
// Top of script
new Attempts [MAX_PLAYERS];
// In your code 
Attempts[playerid]++;
if(
Attempts [playerid] == 3) {
Attempts[playerid] = 0;
Kick(playerid);} 
Reply
#4

Thanks both of these work fine, repped ya guys for your fast support!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)