PDA

View Full Version : [HELP] Antihack


NotoriousMOB
11/11/2010, 05:27 AM
Here i go again... sry
I have made a Black Market with guns as Rocket Launcher and such you can buy
but.. may sound wierd but i wan't to allow a weapon to be used cause when a player tryes to by it the anti hack bans him for weapon hack


I been searching around now and i have no idea where the hell those Weap ID's are...
i wan't to allow some weapons so the bot don't ownde them.

GetPlayerWeaponData(i, 7, weaponid, ammo);
new pSpecialAction = GetPlayerSpecialAction(i);
if (weaponid > 1 || pSpecialAction == SPECIAL_ACTION_USEJETPACK)
{
// Illegal weapon
TogglePlayerControllable(i, 0);
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: You have been banned due to suspected cheating.");
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: Please contact an admin oon the forum if you feel this is in error.");
SendClientMessage(i, COLOR_RED, "iBot Anticheat 0.6 by Jofi");
//PlayerInfo[i][pLocked] = 1;
OnPlayerUpdate(i);
//GetPlayerIp(i, banip, sizeof(banip));
//BanAdd(4, PlayerInfo[i][pSQLID], banip, 38);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "AdmCmd: %s was banned by [AntiHack]bot, reason: weapon hack", plname);
Ban(i);
SendClientMessageToAll(COLOR_LIGHTRED, string);

cessil
11/11/2010, 05:32 AM
well that code bans anyone with a weapon in the 7th slot which handles miniguns, rocket launchers and flamethrowers
GetPlayerWeaponData(playerid, slot, variable, variable);

(SF)Noobanatior
11/11/2010, 05:38 AM
when they buy the gun set a value

SetPVarInt(playeird,"HeavyWeapon",1);

then add a condition into the anti hack

GetPlayerWeaponData(i, 7, weaponid, ammo);
new pSpecialAction = GetPlayerSpecialAction(i);
if (weaponid > 1 || pSpecialAction == SPECIAL_ACTION_USEJETPACK && !GetPVarInt(i,"HeavyWeapon")
{
// Illegal weapon
TogglePlayerControllable(i, 0);
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: You have been banned due to suspected cheating.");
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: Please contact an admin oon the forum if you feel this is in error.");
SendClientMessage(i, COLOR_RED, "iBot Anticheat 0.6 by Jofi");
//PlayerInfo[i][pLocked] = 1;
OnPlayerUpdate(i);
//GetPlayerIp(i, banip, sizeof(banip));
//BanAdd(4, PlayerInfo[i][pSQLID], banip, 38);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "AdmCmd: %s was banned by [AntiHack]bot, reason: weapon hack", plname);
Ban(i);
SendClientMessageToAll(COLOR_LIGHTRED, string);

something like that :)

NotoriousMOB
11/11/2010, 05:43 AM
So there's nothing i can do about it then changing the antihack ?
because of the category 7

or what do you suggest i can do.

(SF)Noobanatior
11/11/2010, 05:45 AM
as above

NotoriousMOB
11/11/2010, 06:11 AM
Okay have the :

if (weaponid > 1 || pSpecialAction == SPECIAL_ACTION_USEJETPACK && !GetPVarInt(i,"HeavyWeapon"))

and putted this down at when you buy the gun

SetPVarInt(playerid,"RPG",35);

am i wrong on this?

(SF)Noobanatior
11/11/2010, 06:13 AM
it dont matter what weppon it is just have to be the same so just use

SetPVarInt(playeird,"HeavyWeapon",1);

and that code should work

NotoriousMOB
11/11/2010, 06:26 AM
Damn that's really annoying changed it like you said
but still player gets banned for buying the RocketLauncher.

(SF)Noobanatior
11/11/2010, 06:41 AM
try it like this

if (weaponid > 1 || pSpecialAction == SPECIAL_ACTION_USEJETPACK)
{
if(!GetPVarInt(i,"HeavyWeapon")){
// Illegal weapon
TogglePlayerControllable(i, 0);
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: You have been banned due to suspected cheating.");
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: Please contact an admin oon the forum if you feel this is in error.");
SendClientMessage(i, COLOR_RED, "iBot Anticheat 0.6 by Jofi");
//PlayerInfo[i][pLocked] = 1;
OnPlayerUpdate(i);
//GetPlayerIp(i, banip, sizeof(banip));
//BanAdd(4, PlayerInfo[i][pSQLID], banip, 38);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "AdmCmd: %s was banned by [AntiHack]bot, reason: weapon hack", plname);
Ban(i);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
}

NotoriousMOB
11/11/2010, 07:08 AM
Sorry again but not working this way give's me the SafePlayerPoint errors.

i was thinking about

chaning the :

GetPlayerWeaponData(i, 7, weaponid, ammo);


And making these:
{
if(GetPlayerWeapon(killerid) == 38) Ban(killerid); //Ban if they have a minigun
return 1;
}

if(GetPlayerWeapon(killerid) == 37) Ban(killerid); //Ban if they have a Flame-thrower
return 1;
}


But well i don't know don't understand why it wont work.

(SF)Noobanatior
11/11/2010, 07:13 AM
are these both in the same file or is one a filterscript?

NotoriousMOB
11/11/2010, 07:31 AM
The

{
if(GetPlayerWeapon(killerid) == 38) Ban(killerid); //Ban if they have a minigun
return 1;
}

if(GetPlayerWeapon(killerid) == 37) Ban(killerid); //Ban if they have a Flame-thrower
return 1;
}

Found em' on Wiki.
but the other is in same script..

(SF)Noobanatior
11/11/2010, 07:40 AM
sorry bro way to tyred lol why not just do this

GetPlayerWeaponData(i, 7, weaponid, ammo);
new pSpecialAction = GetPlayerSpecialAction(i);
if (weaponid ==37 || weaponid ==38 || pSpecialAction == SPECIAL_ACTION_USEJETPACK)
{
// Illegal weapon
TogglePlayerControllable(i, 0);
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: You have been banned due to suspected cheating.");
SendClientMessage(i, COLOR_LIGHTRED, "Anticheat: Please contact an admin oon the forum if you feel this is in error.");
SendClientMessage(i, COLOR_RED, "iBot Anticheat 0.6 by Jofi");
//PlayerInfo[i][pLocked] = 1;
OnPlayerUpdate(i);
//GetPlayerIp(i, banip, sizeof(banip));
//BanAdd(4, PlayerInfo[i][pSQLID], banip, 38);
GetPlayerName(i, plname, sizeof(plname));
format(string, sizeof(string), "AdmCmd: %s was banned by [AntiHack]bot, reason: weapon hack", plname);
Ban(i);
SendClientMessageToAll(COLOR_LIGHTRED, string);

:)

mrtrlt
04/09/2011, 09:03 AM
Where can i find an anti hack for all hacks for my server? (bot):confused:

=WoR=Varth
04/09/2011, 11:46 AM
Where can i find an anti hack for all hacks for my server? (bot):confused:

Junk Buster. Find it on FS/Include section.