SA-MP Forums Archive
3 wrong Passwords = Kick? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 3 wrong Passwords = Kick? (/showthread.php?tid=450335)



3 wrong Passwords = Kick? - Blackazur - 12.07.2013

Hello, how can i make in my register/login system, that when an user typed 3 wrong passwords that he get kicked then?


Respuesta: 3 wrong Passwords = Kick? - JimmyCh - 12.07.2013

Better if you show your codes so we can add to it.
Anyway, you'll need to add something like this:
pawn Код:
new NumAttempt[MAX_PLAYERS];
NumAttempt[playerid] ++;
if(NumAttempt[playerid] == 3)
{
SendClientMessage(playerid, -1,"You have typed your password wrong 3 times and got kicked by the server!");
Kick(playerid);
return 1;
}
Hope it helped.


Re: 3 wrong Passwords = Kick? - RALL0 - 12.07.2013

Ontop add this variable,
new Attempts[MAX_PLAYERS];

Then under your wrong login attempt dialog add this
Attempt[playerid] ++1;
if(Attempt[playerid] == 3) kick(playerid);

Oh yeah and under OnPlayerConnect add Attempt[playerid] = 0;


AW: 3 wrong Passwords = Kick? - Blackazur - 12.07.2013

At OnDialogResponse or OnPlayerConnect?


Re: Respuesta: 3 wrong Passwords = Kick? - RALL0 - 12.07.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
Better if you show your codes so we can add to it.
Anyway, you'll need to add something like this:
pawn Код:
new NumAttempt[MAX_PLAYERS];
NumAttempt[playerid] ++1;
if(NumAttempt[playerid] == 3)
{
SendClientMessage(playerid, -1,"You have typed your password wrong 3 times and got kicked by the server!");
Kick(playerid);
return 1;
}
Hope it helped.
Wow, weak bro, you just edit your post and basicly copied my code.


Re: AW: 3 wrong Passwords = Kick? - RALL0 - 12.07.2013

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
At OnDialogResponse or OnPlayerConnect?
You only need to add this under OnPlayerConnect - Attempt[playerid] = 0;
And the rest excluding the variable under your fail attempt dialog.


AW: 3 wrong Passwords = Kick? - Blackazur - 12.07.2013

new NumAttempt[MAX_PLAYERS];

"invalid functoin or decleration" Can you help me with that?


Re: Respuesta: 3 wrong Passwords = Kick? - ThePhenix - 12.07.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
NumAttempt[playerid] ++1;
Hope it helped.
The 1 should not be there.

Just:
PHP код:
NumAttempt[playerid] ++; 



Re: 3 wrong Passwords = Kick? - RALL0 - 12.07.2013

pawn Код:
//On the top of the script, with the other variables
new Attempt[MAX_PLAYERS];

//OnPlayerConnect
Attempt[playerid] = 0;

//OnDialogResponse, DIALOG_ID
Attempt[playerid] ++1;
if(Attempt[playerid] == 3) kick(playerid);



Re: Respuesta: 3 wrong Passwords = Kick? - RALL0 - 12.07.2013

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
The 1 should not be there.

Just:
PHP код:
NumAttempt[playerid] ++; 
Yea, it's my sluggish mistake, but the guy had to edit his post to copy my code. Thats the weakest thing you can pretty much do.