Weapon Detection
#1

Hello again,

I am looking for an anti-weapon hack but in my server i have dms. I create new world for all dms but the main world (0) i want to create a script that will detect and clear weapons and return to player "Weapon hack detected - Weapons removed" and send message to admins "%s try to weapon hack".

Also if is possible in the Dm world (1) i give specific weapons, so detect other weapons and remove them.
Reply
#2

Instead of this:
U can make a anti ban system for this. The server checks the player if he is holding the weapon and if he bought , or hacked it. If he bought it, it would not ban the player. If he hacked it, the server will recognize that the player didnt buy it and bans the player.

the make something cool out of it with something like this
pawn Код:
SendClientMessageToAll(COLOR_RED," [ %s ] HAS BEEN BANNED BY THIS SERVERS SECURITY SYSTEM! [ REASON ] ( MINIGUN ) );
or w/e
Reply
#3

@ the guy above hu?


@Author
well just use an existing anti-weapons cheat and add the code into to check what world they are in.
if your looking for someone to make this
your in the wrong topic, this is a request and should be posted in the request script thread
Reply
#4

Quote:

add the code into to check what world they are in.

What do you mean?
Reply
#5

i mean before the weapon cheat is applied,
im sure some of them don't apply to admins so use that code to see
how they let some players not have them and admins have them,

but in your case would depend on what world they are in.

use this to get the virtual world
https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld

other wise you need to make one with rule sets.
which i don't know if one exist or not
Reply
#6

As i wrote in the first post i have already 2 Worlds, Driftworld(0) and DMworld(1).

I will try what you said. What anti weapon is the best for this situation?
Reply
#7

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Hello again,

I am looking for an anti-weapon hack but in my server i have dms. I create new world for all dms but the main world (0) i want to create a script that will detect and clear weapons and return to player "Weapon hack detected - Weapons removed" and send message to admins "%s try to weapon hack".

Also if is possible in the Dm world (1) i give specific weapons, so detect other weapons and remove them.
pawn Код:
new weaponchecktimer;// creating a variable

Under OnGameModeInit
pawn Код:
for(new i; i<MAX_PLAYERS; i++)
    {
    weaponchecktimer = SetTimerEx("Weaponchecktimer", 1000, 1,"i",i); //weapon check timer
    }

Put these callbacks somewhere in your script, you can modify according to your preferance.
pawn Код:
forward Weaponcheck();
public Weaponcheck()
{

    for(new i; i<MAX_PLAYERS; i++)
    {
        new playerid;
        new illegalwep = 38;      
        new illegalwep1 = 38;    
        new illegalwep2 = 38;   // list of weapon ids which are to be prohibited
        new illegalwep3 = 38;    
        new illegalwep4 = 38;
        new illegalwep5 = 38;    

        new weapon = GetPlayerWeapon(i);
        GetPlayerWeapon(i);
        if(weapon == illegalwep||weapon == illegalwep1||weapon == illegalwep2||weapon == illegalwep3||weapon == illegalwep4||weapon == illegalwep5)
        {
        SendClientMessage(i, COLOR_RED, "Anti cheat caught you with minigun ! You got Disarmed !");
        ResetPlayerWeapons(playerid);
        return 1;
        }
    return 1;
    }
    return 1;
}


forward Weaponchecktimer(playerid);
public Weaponchecktimer(playerid)
{
    Weaponcheck();
    return 1;
}
Reply
#8

How i can make it for only VirtualWorld 0?

I find something different from this and i work on it, this ONE, i think is better because i can choose in my DM teleports that i give specific weapon.

If i find problem, i will posted here.
Reply
#9

Sorry for double post, i have some errors:

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#pragma tabsize 0

new brass[MAX_PLAYERS]; //1
new golf[MAX_PLAYERS];//2
new nightstick[MAX_PLAYERS];//3
new knife[MAX_PLAYERS];//4
new baseball[MAX_PLAYERS];//5
new shovel[MAX_PLAYERS];//6
new pool[MAX_PLAYERS];//7
new katana[MAX_PLAYERS];//8
new chainsaw[MAX_PLAYERS];//9
new ddildo[MAX_PLAYERS];//10
new dildo[MAX_PLAYERS];//11
new vibrator[MAX_PLAYERS];//12
new svibrator[MAX_PLAYERS];//13
new flowers[MAX_PLAYERS];//14
new cane[MAX_PLAYERS];//15
new grenade[MAX_PLAYERS];//16
new tear[MAX_PLAYERS];//17
new molotov[MAX_PLAYERS];//18
new ninemm[MAX_PLAYERS];//22
new sninemm[MAX_PLAYERS];//23
new desert[MAX_PLAYERS];//24
new shotgun[MAX_PLAYERS];//25
new sshotgun[MAX_PLAYERS];//26
new cshotgun[MAX_PLAYERS];//27
new uzi[MAX_PLAYERS];//28
new mp5[MAX_PLAYERS];//29
new ak47[MAX_PLAYERS];//30
new m4[MAX_PLAYERS];//31
new tec[MAX_PLAYERS];//32
new crifle[MAX_PLAYERS];//33
new srifle[MAX_PLAYERS];//34
new rpg[MAX_PLAYERS];//35
new rocket[MAX_PLAYERS];//36
new flame[MAX_PLAYERS];//37
new minigun[MAX_PLAYERS];//38
new charge[MAX_PLAYERS];//39
new detonator[MAX_PLAYERS];//40
new spray[MAX_PLAYERS];//41
new fire[MAX_PLAYERS];//42
new camera[MAX_PLAYERS];//43
new nvission[MAX_PLAYERS];//44
new tvission[MAX_PLAYERS];//45



forward WeaponCheck( );

forward MessageToAdmins(color,const string[]);

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Anti Weapon hack - LOADED");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Anti Weapon hack - UNLOADED");
    print("--------------------------------------\n");
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public WeaponCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerWeapon(i) == 1 && brass[i] == 0||GetPlayerWeapon(i) == 2 && golf[i] == 0||GetPlayerWeapon(i) == 3 && nightstick[i] == 0||GetPlayerWeapon(i) == 4 && knife[i] == 0||GetPlayerWeapon(i) == 5 && baseball[i] == 0||GetPlayerWeapon(i) == 6 && shovel[i] == 0||GetPlayerWeapon(i) == 7 && pool[i] == 0||GetPlayerWeapon(i) == 8 && katana[i] == 0||GetPlayerWeapon(i) == 9 && chainsaw[i] == 0||GetPlayerWeapon(i) == 10 && ddildo[i] == 0
            ||GetPlayerWeapon(i) == 11 && dildo[i] == 0||GetPlayerWeapon(i) == 12 && vibrator[i] == 0||GetPlayerWeapon(i) == 13 && svibrator[i] == 0||GetPlayerWeapon(i) == 14 && flowers[i] == 0||GetPlayerWeapon(i) == 15 && cane[i] == 0||GetPlayerWeapon(i) == 16 && grenade[i] == 0||GetPlayerWeapon(i) == 17 && tear[i] == 0||GetPlayerWeapon(i) == 18 && molotov[i] == 0||GetPlayerWeapon(i) == 22 && ninemm[i] == 0
            ||GetPlayerWeapon(i) == 23 && sninemm[i] == 0||GetPlayerWeapon(i) == 24 && desert[i] == 0||GetPlayerWeapon(i) == 25 && shotgun[i] == 0||GetPlayerWeapon(i) == 26 && sshotgun[i] == 0||GetPlayerWeapon(i) == 27 && cshotgun[i] == 0||GetPlayerWeapon(i) == 28 && uzi[i] == 0||GetPlayerWeapon(i) == 29 && mp5[i] == 0||GetPlayerWeapon(i) == 30 && ak47[i] == 0||GetPlayerWeapon(i) == 31 && m4[i] == 0||GetPlayerWeapon(i) == 32 && tec[i] == 0
            ||GetPlayerWeapon(i) == 33 && crifle[i] == 0||GetPlayerWeapon(i) == 34 && srifle[i] == 0)||GetPlayerWeapon(i) == 35 && rpg[i] == 0||GetPlayerWeapon(i) == 36 && rocket[i] == 0||GetPlayerWeapon(i) == 37 && flame[i] == 0||GetPlayerWeapon(i) == 38 && minigun[i] == 0||GetPlayerWeapon(i) == 39 && charge[i] == 0||GetPlayerWeapon(i) == 40 && detonator[i] == 0||GetPlayerWeapon(i) == 41 && spray[i] == 0||GetPlayerWeapon(i) == 42 && fire[i] == 0
            ||GetPlayerWeapon(i) == 43 && camera[i] == 0||GetPlayerWeapon(i) == 44 && nvission[i] == 0||GetPlayerWeapon(i) == 45 && tvission[i] == 0)
        {
            new pname[MAX_PLAYER_NAME], string[91];
            GetPlayerName(i, pname, sizeof(pname));
            format(string, sizeof(string), "Player %s is a weapon hacker, his weapons removed.", pname);
            MessageToAdmins(-1,string);
            ResetPlayerWeapons(i);
        }
    }

    return 1;
}

public MessageToAdmins(color,const string[])
{
    for(new a,b=GetMaxPlayers();a<b;a++)
    {
        if(IsPlayerAdmin(a)) SendClientMessage(a, color, string);
    }
    return 1;
}
And my Errors:

pawn Код:
D:\****\filterscripts\AntiWeap.pwn(94) : error 029: invalid expression, assumed zero
D:\****\filterscripts\AntiWeap.pwn(94 -- 95) : warning 215: expression has no effect
D:\****\filterscripts\AntiWeap.pwn(95) : error 001: expected token: ";", but found ")"
D:\****\filterscripts\AntiWeap.pwn(95) : error 029: invalid expression, assumed zero
D:\****\filterscripts\AntiWeap.pwn(95) : fatal error 107: too many error messages on one line
Line 94-95

pawn Код:
94: ||GetPlayerWeapon(i) == 33 && crifle[i] == 0||GetPlayerWeapon(i) == 34 && srifle[i] == 0)||GetPlayerWeapon(i) == 35 && rpg[i] == 0||GetPlayerWeapon(i) == 36 && rocket[i] == 0||GetPlayerWeapon(i) == 37 && flame[i] == 0||GetPlayerWeapon(i) == 38 && minigun[i] == 0||GetPlayerWeapon(i) == 39 && charge[i] == 0||GetPlayerWeapon(i) == 40 && detonator[i] == 0||GetPlayerWeapon(i) == 41 && spray[i] == 0||GetPlayerWeapon(i) == 42 && fire[i] == 0
95: ||GetPlayerWeapon(i) == 43 && camera[i] == 0||GetPlayerWeapon(i) == 44 && nvission[i] == 0||GetPlayerWeapon(i) == 45 && tvission[i] == 0)
Can anyone help?

EDIT: update.
Reply
#10

Anyone? Help me plz..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)