How to do rcon ban with time out - 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: How to do rcon ban with time out (
/showthread.php?tid=369249)
How to do rcon ban with time out -
[EnErGyS]KING - 16.08.2012
Hi i want to do Rcon ban but not write Kicked/Banned I need to write Timed outed( i don't want to change reason). This is like When you login in rcon and 3 incorennct password timed out and banned...
Re : How to do rcon ban with time out -
Naruto_Emilio - 16.08.2012
pawn Код:
#include <a_samp>
new Attemp[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Attemp[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Attemp[playerid] = 0;
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
new string[128];
if(!success)
{
new pName[MAX_PLAYER_NAME];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(Attemp[i] > 2)
{
format(string, 256, "SERVER: %s left the server [Timeout]", pName);
SendClientMessageToAll(-1, string);
Attemp[i] ++;
Ban(i); // this will ban him use /kick if you want to kick him Kick(i);
}
return 1;
}
}
else
{
for(new i=0; i<MAX_PLAYERS; i++)
{
Attemp[i] = 0;
}
}
return 1;
}