kick after 3 attempts
#1

Hi everybody
I want to make a connection system I already do but I would like that when the player puts his password after 3 attempts ehouй his kick but I can not get you help me please
Reply
#2

PHP код:
//new variable
new Attempts[MAX_PLAYERS];
//OnPlayerConnect
Attempts[playerid] = 0;
//Enters password wrong
Attempts[playerid]++;
if(
Attempts[playerid] == 3) return Kick(playerid); 
Reply
#3

This should work:

PHP код:
#define COLOR_RED 0xAA3333AA // At the top of your gamemode.
new PassAttempt[MAX_PLAYERS];
Pass Attempt[playerid] ++;
if(
PassAttempt[playerid] == 3)
{
SendClientMessage(playeridCOLOR_RED,"Warning: You were kicked from the server due to multiple password input failure.");
Kick(playerid);
return 
1;

Reply
#4

Quote:
Originally Posted by Michael B
Посмотреть сообщение
This should work:

PHP код:
#define COLOR_RED 0xAA3333AA // At the top of your gamemode.
new PassAttempt[MAX_PLAYERS];
Pass Attempt[playerid] ++;
if(
PassAttempt[playerid] == 3)
{
SendClientMessage(playeridCOLOR_RED,"Warning: You were kicked from the server due to multiple password input failure.");
Kick(playerid);
return 
1;

No it doesnt work, because you dont reset variable, after someone has tried to enter password and failed and disconnects.
Reply
#5

It does not work
Reply
#6

This is one of those rare occasions that you might actually want to use PVars, if we assume that most players will put their password correctly the first time around.
Reply
#7

Please to avoid abuses
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
This is one of those rare occasions that you might actually want to use PVars, if we assume that most players will put their password correctly the first time around.
Why would you use PVars if the dialogs are to be handled in one individual script.
Reply
#9

Because you don't want to create a MAX_PLAYER array if 99% of it is just going to be 0 all the time.
Reply
#10

How the code please ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)