Anti Weapon Hacks, Flooding Chat -
UnknownGamer - 03.12.2012
Hey guys, When someone weapon hacks, or false alarm. It sends messages, one after another.
Could you take a look at code, please, and fix?
pawn Код:
public PeterAC()
{
new weaponid, ammo;
new plname[64], string[256];
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
GetPlayerName(i, plname, sizeof(plname));
if(AntiWeaponHack == 1)
{
if (PlayerGotSpottedRecently[i] == 0)
{
if(ScriptWeaponsUpdated[i] == 0)
{
for (new c = 0; c < 13; c++)
{
GetPlayerWeaponData(i, c, weaponid, ammo);
if (weaponid != 0 && ammo != 0)
{
if (ScriptWeapons[i][c] != weaponid)
{
new weapon[24]; GetWeaponName(weaponid, weapon, 24);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "[AC]: %s (%d) Is possibly Using Weapon Hacks; Use /spec and check him!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
}
}
}
}
}
}
Re: Anti Weapon Hacks, Flooding Chat -
gtakillerIV - 03.12.2012
Never send messages inside a loop.
Re: Anti Weapon Hacks, Flooding Chat -
N0FeaR - 03.12.2012
This is from ravens AC right?
Re: Anti Weapon Hacks, Flooding Chat -
UnknownGamer - 03.12.2012
Yep, what best way am I to re do this?
Re: Anti Weapon Hacks, Flooding Chat -
Randy More - 03.12.2012
pawn Код:
public PeterAC()
{
new weaponid, ammo;
new plname[64], string[256];
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
GetPlayerName(i, plname, sizeof(plname));
if(AntiWeaponHack == 1)
{
if (PlayerGotSpottedRecently[i] == 0)
{
if(ScriptWeaponsUpdated[i] == 0)
{
for (new c = 0; c < 13; c++)
{
GetPlayerWeaponData(i, c, weaponid, ammo);
if (weaponid != 0 && ammo != 0)
{
if (ScriptWeapons[i][c] != weaponid)
{
new weapon[24]; GetWeaponName(weaponid, weapon, 24);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "[AC]: %s (%d) Is possibly Using Weapon Hacks; Use /spec and check him!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
return 1;
}
}
}
}
}
}
Re: Anti Weapon Hacks, Flooding Chat -
UnknownGamer - 05.12.2012
Quote:
Originally Posted by Randy More
pawn Код:
public PeterAC() { new weaponid, ammo; new plname[64], string[256]; new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && !IsPlayerNPC(i)) { GetPlayerName(i, plname, sizeof(plname)); if(AntiWeaponHack == 1) { if (PlayerGotSpottedRecently[i] == 0) { if(ScriptWeaponsUpdated[i] == 0) { for (new c = 0; c < 13; c++) { GetPlayerWeaponData(i, c, weaponid, ammo); if (weaponid != 0 && ammo != 0) { if (ScriptWeapons[i][c] != weaponid) { new weapon[24]; GetWeaponName(weaponid, weapon, 24); GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "[AC]: %s (%d) Is possibly Using Weapon Hacks; Use /spec and check him!", plname, i); SendAdminMessage(COLOR_YELLOW, string); return 1; } } } } } }
|
Still spams chat :/
Re: Anti Weapon Hacks, Flooding Chat -
Kreyg - 05.12.2012
You should just ditch this and rewrite a new anti cheat system from scratch by yourself. The stock ravens AC is just a mess.
We ended up writing our own on my server. No spam, and it works better.
Re: Anti Weapon Hacks, Flooding Chat -
UnknownGamer - 05.12.2012
Quote:
Originally Posted by Kreyg
You should just ditch this and rewrite a new anti cheat system from scratch by yourself. The stock ravens AC is just a mess.
We ended up writing our own on my server. No spam, and it works better.
|
Actually, I have just started that, I'm still having trouble with the 25-30 player mark, the server goes boom. If you know issue, could you inbox me it please?
+Rep.
Re: Anti Weapon Hacks, Flooding Chat -
LarzI - 05.12.2012
Quote:
Originally Posted by UnknownGamer
Still spams chat :/
|
You could break the loop when you've found the cheater anyway, as there's no need to check through the rest of the weapons.
Like this:
pawn Код:
for (new c = 0; c < 13; c++)
{
GetPlayerWeaponData(i, c, weaponid, ammo);
if (weaponid != 0 && ammo != 0)
{
if (ScriptWeapons[i][c] != weaponid)
{
new weapon[24]; GetWeaponName(weaponid, weapon, 24);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "[AC]: %s (%d) Is possibly Using Weapon Hacks; Use /spec and check him!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
break;
}
}
}
Re: Anti Weapon Hacks, Flooding Chat -
UnknownGamer - 05.12.2012
Quote:
Originally Posted by LarzI
You could break the loop when you've found the cheater anyway, as there's no need to check through the rest of the weapons.
Like this:
pawn Код:
for (new c = 0; c < 13; c++) { GetPlayerWeaponData(i, c, weaponid, ammo); if (weaponid != 0 && ammo != 0) { if (ScriptWeapons[i][c] != weaponid) { new weapon[24]; GetWeaponName(weaponid, weapon, 24); GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "[AC]: %s (%d) Is possibly Using Weapon Hacks; Use /spec and check him!", plname, i); SendAdminMessage(COLOR_YELLOW, string); break; } } }
|
That still spams....