[FilterScript] [Filterscript] Anti Weapon Cheating System (v.0.2 ) (Tested..Operates!)
#1

Anti Weapon Cheating System, v.0.2 (Bug fixed)

developing!!!

Author: illay

pawn Код:
#include <a_samp>

/*Latest Update 03/04/09*/

forward public WeaponCheating();
forward public BanPlayer();

new TheWeapon[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Anti-Weapon Cheat by illay");
    print(" Version V.0.2 (Tested) l.updt: 03/04/09");
    print("--------------------------------------\n");
    SetTimer("WeaponCheating",1000,true);
    return 1;
}

public WeaponCheating() { //by illay
    for(new i=0;i<MAX_PLAYERS;i++) {
      TheWeapon[i]=GetPlayerWeapon(i);
      if(TheWeapon[i]==35 /*thower*/ ||TheWeapon[i]==36 /*Rpg*/|| TheWeapon[i]==37 /* h_rpg*/|| TheWeapon[i]==38 /*minigun*/|| TheWeapon[i]==43 /*camera*/|| TheWeapon[i]==44/*Glasses*/|| TheWeapon[i]==45/*Glasses*/) {
        SendClientMessage(i, 0xE60000FF, "No cheating in server! You have BANNED!");
        return SetTimerEx("BanPlayer",500,false,"i","i");//Against causeless bannings
        }
    }
    return 1; //return WeaponCheating() /retrurn WeaponCheating()/
}

public BanPlayer() { //by illay
  for(new i=0;i<MAX_PLAYERS;i++) {
    return BanEx(i,"WEAPON CHEATING");//samp.ban file reason "In game ban => WEAPON CHEATING
    }
    /*
    Forbidding agendum:
    ------------------
    ip (hidden) [03/04/09 | 15:19:33] Player - WEAPON CHEATING <= reason
    ------------------
    */

    return 1;
}
Reply
#2

if it found the weapons in server ?
Reply
#3

This should be in the useful snippets thread, it's hardly a system.

PS. When forwarding you don't add the "public".

(Your code won't even work, GetPlayerWeapon(i) has to be called after || still and your BanPlayer() function will ban the entire server, i recommend you remove this immediately.)
Reply
#4

Use GetPlayerWeaponData...
GetPlayerWeapon shows only the weapon that player is holding at the moment..
and what if i take out a weapon that you didnt wrote in here? so i still can use weapon hacks
with this FS, if you want to block weapons i suggest you to use 'SetDisabledWeapons' in ongamemodeinit...
Reply
#5

Yuval_Baruch,

Yes let him not receive, but never therewith ban..

_TeRmiNaToR_ ,

The organ you stretch at that time you take that gun the script the ordinal number

Norn,

There is written his essence all the same how
Reply
#6

nice try, but it is not anticheat... add more things to it, like ammo detector or somethin... it's fucknhard to say to you, but it's good work for novice
Reply
#7

It will ban all players ;o?
for(new i=0;i<MAX_PLAYERS;i++) {
return BanEx(i,"WEAPON CHEATING");//Reason to samp.ban file
}

or just id 0? (because of return)
But i think it will not work.
Reply
#8

haha xD
return can be used here if
for(new i=0; i<MAX_PLAYERS; i++)
{
if(banid==i) return something
}
but it's stupid, and needs to TimerEx
try... just this

forward BanPlayer(playerid);
public WeaponCheating() {
for(new i=0;i<MAX_PLAYERS;i++) {
if(GetPlayerWeapon(i)==35||36||37||38||43||44||45) {
SendClientMessage(i, 0xE60000FF, "No cheating in server! BANNED!");
//return SetTimerEx("BanPlayer",1000,false,"i","i"); do not use it when not if expression
SetTimerEx("BanPlayer",1000,false,"i","i");
return 1;
}
}
return 1;
}

public BanPlayer(playerid)
{
BanEx(playerid,"WEAPON CHEATING");//Reason to samp.ban file
return 1;
}

somthn like this
Reply
#9

Quote:
Originally Posted by G_ROW_Chez
haha xD
return can be used here if
((blab blah))

somthn like this
you should use SetTimerEx this way :
SetTimerEx("BanPlayer",1000,false,"i",i);

but why you used it? just put BanEx under SendClientMessage and it will ban and show message.
Reply
#10

he needs 1 second wait... =) i did 1 second timer =)
and TimerEx works fine even with this
SetTimerEx("public", time, false, "%d", "money");
so i write right too =)
Reply
#11

I prefer use functions like it was written...
You dont need % in formatting. and you should use correct types of variables
"money" is string, money is integer
Reply
#12

hey, pipl, maybe we will not try to disput? =) i'm not a noob, you too... so lets just forgot about try of this newbie guy, ok?
Reply
#13

#include <a_samp>

public OnPlayerUpdate(playerid) if(GetPlayerWeapon(playerid)==35||36||37||38||43|| 44||45) SendClientMessage(playerid, 0xE60000FF, "No cheating in server! BANNED!"), BanEx(playerid,"WEAPON CHEATING");

author lol...
Reply
#14

wont work.
GetPlayerWeapon(playerid)==35||36||37||38||43||44| |45
is bit swapping.
You should use { and } because you can just use ONE func without it.
Reply
#15

Everyone!

Functional bugs now already faultlessly operates I repaired feel sorry for this
Reply
#16

return SetTimerEx("BanPlayer",500,false,"i","i");//Against causeless bannings

Give me a reason why it should work. ("i" is string, i is integer, formatting 'i' makes func gets integer)
Reply
#17

_TeRmiNaToR_ ,

pawn Код:
public OnPlayerConnect(playerid)
{
if(playerid == 0) //If player id = 0 -> Kick. That how do the organ step up this? ;)
{
Kick(playerid);
}
}
Fake thrice at that time rates if joins in inside ten second playful
Reply
#18

Luby,

i = playerid shortly. i = integer but non herein.

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++) { /*Here code*/ }
else
for(new playerid=0;playerid<MAX_PLAYERS;playerid++) { /*Here code*/ }
Reply
#19

why you didn't use :
return SetTimerEx("BanPlayer",500,false,"i",i);//Against causeless bannings
??
Reply
#20

Luby,

Both operates version. If do you like it you do not rewrite thus
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)