SA-MP Forums Archive
[MAKE] Anti Weapon Hax - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [MAKE] Anti Weapon Hax (/showthread.php?tid=193366)



[MAKE] Anti Weapon Hax - Larsey123IsMe - 25.11.2010

Is it possible to make this?:

When an player use weapon: One of those
pawn Код:
36 //Flamethrower
37 //Rocket
38 //Minigun
39 //Satchel Charge
Then this messange get send to an admin:

pawn Код:
SendClientMessage(playerid, COLOR, "(PLAYER NAME + ID) is now using (WEAPON)!");
Example:
pawn Код:
SendClientMessage(playerid, COLOR, "Larsey123(5) is now using Flamethrower!");
//or
SendClientMessage(playerid, COLOR, "Larsey123(5) is now using Rocket!");
//or
//ect...



Re: [MAKE] Anti Weapon Hax - XoSarahMoX - 25.11.2010

I think its something like this:
Код:
SendClientMessage(playerid, COLOR, "%s is now using %d!");
Not sure how to get it to the admin though probably something like this:
Код:
if(pAdminLevel >= 1)
{
SendClientMessage(playerid, COLOR, "%s is now using %d!");
}
Again im sorry since I am not fully sure :P.


Re: [MAKE] Anti Weapon Hax - XoSarahMoX - 25.11.2010

Sorry for double post I also want to say you can make something like this:
Код:
if(weapon == 36 && ammo >= 0)
{
ResetPlayerWeapons(playerid);
SendClientMessage(palyerid, COLOR, "[HACK DETECTED]: Do Not Use Weapon Hacks!");
Kick(playerid);
}
Код:
if(weapon == 37 && ammo >= 0)
{
ResetPlayerWeapons(playerid);
SendClientMessage(palyerid, COLOR, "[HACK DETECTED]: Do Not Use Weapon Hacks!");
Kick(playerid);
}
Код:
if(weapon == 38 && ammo >= 0)
{
ResetPlayerWeapons(playerid);
SendClientMessage(palyerid, COLOR, "[HACK DETECTED]: Do Not Use Weapon Hacks!");
Kick(playerid);
}
Код:
if(weapon == 39 && ammo >= 0)
{
ResetPlayerWeapons(playerid);
SendClientMessage(palyerid, COLOR, "[HACK DETECTED]: Do Not Use Weapon Hacks!");
Kick(playerid);
}
And you can make a global message so the admins online can know who hacked and talk to him after he relogs. Not sure or you can make it just Ban or BanEx the person :P. Sorry about double post.


Re: [MAKE] Anti Weapon Hax - Kitten - 25.11.2010

pawn Код:
new aWeaponNames[][32] = {
    {"Unarmed (Fist)"}, // 0
    {"Brass Knuckles"}, // 1
    {"Golf Club"}, // 2
    {"Night Stick"}, // 3
    {"Knife"}, // 4
    {"Baseball Bat"}, // 5
    {"Shovel"}, // 6
    {"Pool Cue"}, // 7
    {"Katana"}, // 8
    {"Chainsaw"}, // 9
    {"Purple Dildo"}, // 10
    {"Big White Vibrator"}, // 11
    {"Medium White Vibrator"}, // 12
    {"Small White Vibrator"}, // 13
    {"Flowers"}, // 14
    {"Cane"}, // 15
    {"Grenade"}, // 16
    {"Teargas"}, // 17
    {"Molotov"}, // 18
    {"Empty Slot 1"}, // 19
    {"Empty Slot 2"}, // 20
    {"Empty Slot 3"}, // 21
    {"Colt 45"}, // 22
    {"Colt 45 (Silenced)"}, // 23
    {"Desert Eagle"}, // 24
    {"Normal Shotgun"}, // 25
    {"Sawnoff Shotgun"}, // 26
    {"Combat Shotgun"}, // 27
    {"Micro Uzi (Mac 10)"}, // 28
    {"MP5"}, // 29
    {"AK47"}, // 30
    {"M4"}, // 31
    {"Tec9"}, // 32
    {"Country Rifle"}, // 33
    {"Sniper Rifle"}, // 34
    {"Rocket Launcher"}, // 35
    {"Heat-Seeking Rocket Launcher"}, // 36
    {"Flamethrower"}, // 37
    {"Minigun"}, // 38
    {"Satchel Charge"}, // 39
    {"Detonator"}, // 40
    {"Spray Can"}, // 41
    {"Fire Extinguisher"}, // 42
    {"Camera"}, // 43
    {"Night Vision Goggles"}, // 44
    {"Infrared Vision Goggles"}, // 45
    {"Parachute"}, // 46
    {"Fake Pistol"} // 47
};
pawn Код:
new senderName[MAX_PLAYER_NAME];
   new string[256];
   GetPlayerName(playerid, senderName, sizeof(senderName));
   format(string, sizeof(string),"Player %d[%d] is now using %d", text, playerid, aWeaponNames);
   SendClientMessageToAlll(playerid,COLOR, string);



Re: [MAKE] Anti Weapon Hax - Larsey123IsMe - 25.11.2010

Whats wrong :S

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

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

public OnGameModeInit()
{
    new aWeaponNames[][32] = {
    {"Unarmed (Fist)"}, // 0
    {"Brass Knuckles"}, // 1
    {"Golf Club"}, // 2
    {"Night Stick"}, // 3
    {"Knife"}, // 4
    {"Baseball Bat"}, // 5
    {"Shovel"}, // 6
    {"Pool Cue"}, // 7
    {"Katana"}, // 8
    {"Chainsaw"}, // 9
    {"Purple Dildo"}, // 10
    {"Big White Vibrator"}, // 11
    {"Medium White Vibrator"}, // 12
    {"Small White Vibrator"}, // 13
    {"Flowers"}, // 14
    {"Cane"}, // 15
    {"Grenade"}, // 16
    {"Teargas"}, // 17
    {"Molotov"}, // 18
    {"Empty Slot 1"}, // 19
    {"Empty Slot 2"}, // 20
    {"Empty Slot 3"}, // 21
    {"Colt 45"}, // 22
    {"Colt 45 (Silenced)"}, // 23
    {"Desert Eagle"}, // 24
    {"Normal Shotgun"}, // 25
    {"Sawnoff Shotgun"}, // 26
    {"Combat Shotgun"}, // 27
    {"Micro Uzi (Mac 10)"}, // 28
    {"MP5"}, // 29
    {"AK47"}, // 30
    {"M4"}, // 31
    {"Tec9"}, // 32
    {"Country Rifle"}, // 33
    {"Sniper Rifle"}, // 34
    {"Rocket Launcher"}, // 35
    {"Heat-Seeking Rocket Launcher"}, // 36
    {"Flamethrower"}, // 37
    {"Minigun"}, // 38
    {"Satchel Charge"}, // 39
    {"Detonator"}, // 40
    {"Spray Can"}, // 41
    {"Fire Extinguisher"}, // 42
    {"Camera"}, // 43
    {"Night Vision Goggles"}, // 44
    {"Infrared Vision Goggles"}, // 45
    {"Parachute"}, // 46
    {"Fake Pistol"} // 47
};


public OnPlayerCommandText(playerid, cmdtext[])
{
     if(IsPlayerAdmin(playerid))
     {
     new senderName[MAX_PLAYER_NAME];
     new string[256];
     GetPlayerName(playerid, senderName, sizeof(senderName));
     format(string, sizeof(string),"Player %d[%d] is now using %d", text, playerid, aWeaponNames);
     SendClientMessageToAlll(playerid,COLOR, string);
       }
    }
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(67) : warning 217: loose indentation
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(67) : error 029: invalid expression, assumed zero
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(67) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(69) : error 017: undefined symbol "playerid"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(73) : error 017: undefined symbol "playerid"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(74) : error 017: undefined symbol "text"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(75) : error 017: undefined symbol "SendClientMessageToAlll"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.



Re: [MAKE] Anti Weapon Hax - XoSarahMoX - 25.11.2010

Please put the lines here :P so we know which is which ^-^
Also fix the extra l in all .


Re: [MAKE] Anti Weapon Hax - Kitten - 26.11.2010

this goes at top of ur script.
pawn Код:
new aWeaponNames[][32] = {
    {"Unarmed (Fist)"}, // 0
    {"Brass Knuckles"}, // 1
    {"Golf Club"}, // 2
    {"Night Stick"}, // 3
    {"Knife"}, // 4
    {"Baseball Bat"}, // 5
    {"Shovel"}, // 6
    {"Pool Cue"}, // 7
    {"Katana"}, // 8
    {"Chainsaw"}, // 9
    {"Purple Dildo"}, // 10
    {"Big White Vibrator"}, // 11
    {"Medium White Vibrator"}, // 12
    {"Small White Vibrator"}, // 13
    {"Flowers"}, // 14
    {"Cane"}, // 15
    {"Grenade"}, // 16
    {"Teargas"}, // 17
    {"Molotov"}, // 18
    {"Empty Slot 1"}, // 19
    {"Empty Slot 2"}, // 20
    {"Empty Slot 3"}, // 21
    {"Colt 45"}, // 22
    {"Colt 45 (Silenced)"}, // 23
    {"Desert Eagle"}, // 24
    {"Normal Shotgun"}, // 25
    {"Sawnoff Shotgun"}, // 26
    {"Combat Shotgun"}, // 27
    {"Micro Uzi (Mac 10)"}, // 28
    {"MP5"}, // 29
    {"AK47"}, // 30
    {"M4"}, // 31
    {"Tec9"}, // 32
    {"Country Rifle"}, // 33
    {"Sniper Rifle"}, // 34
    {"Rocket Launcher"}, // 35
    {"Heat-Seeking Rocket Launcher"}, // 36
    {"Flamethrower"}, // 37
    {"Minigun"}, // 38
    {"Satchel Charge"}, // 39
    {"Detonator"}, // 40
    {"Spray Can"}, // 41
    {"Fire Extinguisher"}, // 42
    {"Camera"}, // 43
    {"Night Vision Goggles"}, // 44
    {"Infrared Vision Goggles"}, // 45
    {"Parachute"}, // 46
    {"Fake Pistol"} // 47
};



Re: [MAKE] Anti Weapon Hax - Larsey123IsMe - 26.11.2010

:S

?
pawn Код:
#include <a_samp>

#define FILTERSCRIPT

    new aWeaponNames[][32] =
{
    {"Unarmed (Fist)"}, // 0
    {"Brass Knuckles"}, // 1
    {"Golf Club"}, // 2
    {"Night Stick"}, // 3
    {"Knife"}, // 4
    {"Baseball Bat"}, // 5
    {"Shovel"}, // 6
    {"Pool Cue"}, // 7
    {"Katana"}, // 8
    {"Chainsaw"}, // 9
    {"Purple Dildo"}, // 10
    {"Big White Vibrator"}, // 11
    {"Medium White Vibrator"}, // 12
    {"Small White Vibrator"}, // 13
    {"Flowers"}, // 14
    {"Cane"}, // 15
    {"Grenade"}, // 16
    {"Teargas"}, // 17
    {"Molotov"}, // 18
    {"Empty Slot 1"}, // 19
    {"Empty Slot 2"}, // 20
    {"Empty Slot 3"}, // 21
    {"Colt 45"}, // 22
    {"Colt 45 (Silenced)"}, // 23
    {"Desert Eagle"}, // 24
    {"Normal Shotgun"}, // 25
    {"Sawnoff Shotgun"}, // 26
    {"Combat Shotgun"}, // 27
    {"Micro Uzi (Mac 10)"}, // 28
    {"MP5"}, // 29
    {"AK47"}, // 30
    {"M4"}, // 31
    {"Tec9"}, // 32
    {"Country Rifle"}, // 33
    {"Sniper Rifle"}, // 34
    {"Rocket Launcher"}, // 35
    {"Heat-Seeking Rocket Launcher"}, // 36
    {"Flamethrower"}, // 37
    {"Minigun"}, // 38
    {"Satchel Charge"}, // 39
    {"Detonator"}, // 40
    {"Spray Can"}, // 41
    {"Fire Extinguisher"}, // 42
    {"Camera"}, // 43
    {"Night Vision Goggles"}, // 44
    {"Infrared Vision Goggles"}, // 45
    {"Parachute"}, // 46
    {"Fake Pistol"} // 47
}

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

public OnPlayerCommandText(playerid, cmdtext[])
{
     if(IsPlayerAdmin(playerid))
     {
     new senderName[MAX_PLAYER_NAME];
     new string[256];
     GetPlayerName(playerid, senderName, sizeof(senderName));
     format(string, sizeof(string),"Player %d[%d] is now using %d", text, playerid, aWeaponNames);
     SendClientMessageToAlll(playerid,COLOR, string);
     }
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(57) : error 001: expected token: ";", but found "public"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(72) : error 017: undefined symbol "text"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WeaponAntiHax.pwn(73) : error 017: undefined symbol "SendClientMessageToAlll"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.



Re: [MAKE] Anti Weapon Hax - Freddi-25 - 26.11.2010

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

    new aWeaponNames[][32] =
{
    {"Unarmed (Fist)"}, // 0
    {"Brass Knuckles"}, // 1
    {"Golf Club"}, // 2
    {"Night Stick"}, // 3
    {"Knife"}, // 4
    {"Baseball Bat"}, // 5
    {"Shovel"}, // 6
    {"Pool Cue"}, // 7
    {"Katana"}, // 8
    {"Chainsaw"}, // 9
    {"Purple Dildo"}, // 10
    {"Big White Vibrator"}, // 11
    {"Medium White Vibrator"}, // 12
    {"Small White Vibrator"}, // 13
    {"Flowers"}, // 14
    {"Cane"}, // 15
    {"Grenade"}, // 16
    {"Teargas"}, // 17
    {"Molotov"}, // 18
    {"Empty Slot 1"}, // 19
    {"Empty Slot 2"}, // 20
    {"Empty Slot 3"}, // 21
    {"Colt 45"}, // 22
    {"Colt 45 (Silenced)"}, // 23
    {"Desert Eagle"}, // 24
    {"Normal Shotgun"}, // 25
    {"Sawnoff Shotgun"}, // 26
    {"Combat Shotgun"}, // 27
    {"Micro Uzi (Mac 10)"}, // 28
    {"MP5"}, // 29
    {"AK47"}, // 30
    {"M4"}, // 31
    {"Tec9"}, // 32
    {"Country Rifle"}, // 33
    {"Sniper Rifle"}, // 34
    {"Rocket Launcher"}, // 35
    {"Heat-Seeking Rocket Launcher"}, // 36
    {"Flamethrower"}, // 37
    {"Minigun"}, // 38
    {"Satchel Charge"}, // 39
    {"Detonator"}, // 40
    {"Spray Can"}, // 41
    {"Fire Extinguisher"}, // 42
    {"Camera"}, // 43
    {"Night Vision Goggles"}, // 44
    {"Infrared Vision Goggles"}, // 45
    {"Parachute"}, // 46
    {"Fake Pistol"} // 47
};

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



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerAdmin(playerid))
    {
        new senderName[MAX_PLAYER_NAME];
        new string[256];
        GetPlayerName(playerid, senderName, sizeof(senderName));
        format(string, sizeof(string),"Player %d[%d] is now using %d", cmdtext, playerid, aWeaponNames);
        SendClientMessageToAll(playerid,COLOR, string);
        return 1;
    }
    return 0;
}



Re: [MAKE] Anti Weapon Hax - mmrk - 26.11.2010

Why you use OnPlayerCommandText?

Just make a timer to check it every X seconds or just use OnPlayerKeyStateChange to check if player presses fire key with those weapons.

pawn Код:
SendClientMessageToAll(playerid,COLOR, string); - False
SendClientMessageToAll(COLOR, string); - Correct