Weapon check - 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: Weapon check (
/showthread.php?tid=353530)
Weapon check -
habl - 23.06.2012
Hi all,
I got a gamemode running which also checks for weapons and bans if you got certain weapons. Now I always thought the script was working fine, but always got some complaints from people who say they didn't have any weapons and still got banned.
I didn't made the script myself, so I'm not sure if it really works, so I was hoping somebody could tell me if this script is bugged or looking fine.
http://pastebin.com/XQswfZ2X
Re: Weapon check -
[KHK]Khalid - 23.06.2012
Uhm why don't you test it by yourself (In-game)? I mean maybe those people lie. Anyway I checked it and here's what it (probably) does (I explained everything in comments):
pawn Код:
// assuming that the public Guns is forwared and called by a timer probably
public Guns()
{
for(new i;i<MAX_PLAYERS;i++) // loops through all the players
{
if(!IsPlayerAdmin(i)) // checks if the player isn't admin
{
// he/she isn't admin
new WeData[13][2]; // this line and the line below gets the data of the player's weapons
GetPlayerWeaponData(i, 7, WeData[7][0], WeData[7][1]); // ^
// The line below checks if he/she has a Satchel Charge, Minigun, Minigun (Again dunno why you repeated it), Flamethrower, HS Rocket or RPG
if(WeData[7][0] == 39 || WeData[7][0] == 38 || WeData[7][0] == 38 || WeData[7][0] == 37 || WeData[7][0] == 36 || WeData[7][0] == 35)
{
// here he/she has any of the weapons mentioned above
//SendClientMessageToAllLang(82,0xFF0000FF,Player(i));
SendClientMessage(i, 0xC6BEBDFF, "Post at forum.andromada.net in ban apeal board for unban request!");
BanMsg(i, "Weapon cheat."); // Ban
}
}
}
}
Re: Weapon check -
SuperViper - 23.06.2012
Looks fine but inefficient to me. If you want a really good anticheat, use the one I made:
https://sampforum.blast.hk/showthread.php?tid=338516. The way you're doing it will still allow players to spawn other things besides miniguns, flamethrowers, and rocket launchers.
Re: Weapon check -
habl - 23.06.2012
Thanks guys.
I did check it myself and it worked fine for me. But I got a lot of reports from players who say the ban wasn't fair they didn't cheat blah blah. I know most cheaters do that, but sometimes players from whom I didn't expect also report it. So I wasn't sure if this system was bugged or not.
The reason the script only checks for certain weapons is because there are also deathmatch minigames. The weapons the script checks for are the only weapons which aren't used by the gamemode itself.
But if the script itself works, I know enough. Probably it were cheaters who are just trying to get unbanned.