Anti-Cheat banning random players when connection (sometimes) -
Andy_McKinley - 07.07.2010
A friend made anti-cheat a while ago. I removed it because it was banning random players at connecting. Now I re-created it by myself with help (looking at other anti-cheat systems). And again the same problem, banning some players at connection. Yes, it is working > banning hackers with minigun/heat seaker.
pawn Код:
//********************************************Urban Fighters Anti-Cheat********************************************
public weaponCheck(playerid)
{
new wep = GetPlayerWeapon(playerid);
new reason[64], output[128];
if(wep == 36 || wep == 38)
{
switch(wep)
{
case 36: format(reason, sizeof(reason), "Heat Seaker");
case 38: format(reason, sizeof(reason), "Minigun");
}
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(output, sizeof(output), "[UFA-C] %s was caught using forbidden weapon [%s] and was banned.", pName, reason);
SendClientMessageToAll(COLOR_UFAC, output);
format(output, sizeof(output), "[UFA-C] You were caught using forbidden weapon [%s] and you have been banned.", reason);
SendClientMessage(playerid, COLOR_UFAC, output);
TogglePlayerControllable(playerid, false);
Ban(playerid);
}
return 1;
}
Can someone tell me what's wrong?
Re: Anti-Cheat banning random players when connection (sometimes) -
dice7 - 07.07.2010
Activate the anticheat for player 10 seconds after he connects
Re: Anti-Cheat banning random players when connection (sometimes) - WackoX - 07.07.2010
Then these 'random people' are hacking.
Re: Anti-Cheat banning random players when connection (sometimes) -
Andy_McKinley - 07.07.2010
Quote:
Originally Posted by dice7
Activate the anticheat for player 10 seconds after he connects
|
Why would that work? :\ Btw, how?
Quote:
Originally Posted by WackoX
Then these 'random people' are hacking.
|
No... It's like:
''[UF]DarkPhoenix has joined the server."
''[UFA-C] [UF]DarkPhoenix was caught using forbidden weapon [MINIGUN] and was banned."
''[UF]DarkPhoenix has left the server. (Leaving)''
Re: Anti-Cheat banning random players when connection (sometimes) -
dice7 - 07.07.2010
Since you claim that they get banned on connection, then they wont since 10 seconds would have passed since they connected. And use a timer
https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
Re: Anti-Cheat banning random players when connection (sometimes) -
Andy_McKinley - 07.07.2010
Quote:
Originally Posted by dice7
|
Check this out;
pawn Код:
public OnPlayerConnect(playerid)
{
checkpointTimer[playerid] = SetTimerEx("rangeCheck", 1000, 1, "i", playerid);
SetPlayerColor(playerid, COLOR_LIGHTGREY);
weaponTimer[playerid] = SetTimerEx("weaponCheck", 1000, 1, "i", playerid);
I bet same is going to happen when I move it to OnPlayerSpawn or something...
Re: Anti-Cheat banning random players when connection (sometimes) -
Mr187 - 07.07.2010
Well first of all, There's a bug with SA-MP an sometimes it believes somebody has a minigun or such while on player class or specing, My best bet would be if you got a player class to not allow to run until the player is out of the class, Or if you got a login system wait till after they login and have spawned, Pretty much wait till they spawn.
Re: Anti-Cheat banning random players when connection (sometimes) -
Burridge - 07.07.2010
Quote:
Originally Posted by Andy_McKinley
pawn Код:
weaponTimer[playerid] = SetTimerEx("weaponCheck", 1000, 1, "i", playerid);
|
Wouldn't that create a new timer each time a player enters the server though?
Re: Anti-Cheat banning random players when connection (sometimes) -
Hiddos - 07.07.2010
Quote:
Originally Posted by Burridge
Wouldn't that create a new timer each time a player enters the server though?
|
Yep.
I'd suggest doing a PVar when he spawns.
Re: Anti-Cheat banning random players when connection (sometimes) -
Andy_McKinley - 07.07.2010
What's the best option?