[SOLVED]anti hack banning sometimes people that join the server ;s -
`FuTuRe- - 18.01.2010
I always thought that players were weapon hacking in the server... but yesterday it happend to me. I joined server "Connected blablalbla" en 1 sec later Server closed the connection...
My m8 was in so he told me i was banned for weapon hacking... it happens now and then. This is the code:
pawn Код:
public AntiWeaponHack()
{
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
switch(GetPlayerWeapon(i))
{
case 9, 11, 12, 13, 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
{
GetPlayerName(i, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking.", tmpname);
SendClientMessageToAll(GAME_ENGINE, string);
print(string);
BanEx(i, weapon);
}
}
}
return 1;
}
I hope somebody can help me fixing this.
Re: anti hack banning sometimes people that join the server ;s -
`FuTuRe- - 19.01.2010
bump
Re: anti hack banning sometimes people that join the server ;s -
Nakash - 19.01.2010
at the top
pawn Код:
new PlayerSpawned[MAX_PLAYERS];
OnPlayerSpawn
pawn Код:
PlayerSpawned[playerid] = 1;
OnPlayerConnect
pawn Код:
PlayerSpawned[playerid] = 0;
pawn Код:
public AntiWeaponHack()
{
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
switch(GetPlayerWeapon(i))
{
case 9, 11, 12, 13, 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
{
if(PlayerSpawned[playerid]==1)
{
GetPlayerName(i, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking.", tmpname);
SendClientMessageToAll(GAME_ENGINE, string);
print(string);
BanEx(i, weapon);
}
}
}
}
return 1;
}
UNTESTED!
Re: anti hack banning sometimes people that join the server ;s -
`FuTuRe- - 19.01.2010
Thanks... not sure if it's working to but we have to wait...
Re: anti hack banning sometimes people that join the server ;s -
Nakash - 19.01.2010
Quote:
Originally Posted by `FuTuRe-
Thanks... not sure if it's working to but we have to wait...
|
That should work,it won't kick him if the player is not spawned.
The player can not use weapon cheats if he is not spawned,i mean
the weapons will not be spawned if the player is not spawned.
Re: anti hack banning sometimes people that join the server ;s -
`FuTuRe- - 19.01.2010
It's not banning weapon hackers anymore.
Re: anti hack banning sometimes people that join the server ;s -
Nakash - 19.01.2010
Quote:
Originally Posted by `FuTuRe-
It's not banning weapon hackers anymore.
|
What do you mean? even if they cheat?
Re: anti hack banning sometimes people that join the server ;s -
`FuTuRe- - 19.01.2010
Yes. someone just had a minigun. then some heat seaking rockets. he didn't got banned by the system.
Re: anti hack banning sometimes people that join the server ;s -
Miguel - 19.01.2010
Where are you using that callback? (timer, OnPlayerUpdate
, etc).
Re: anti hack banning sometimes people that join the server ;s - [03]Garsino - 19.01.2010
You would need a timer for that function to work properly.