[FilterScript] [SMALL] Anti Fight
#1

Jo!
I was bored, so I decided to make an anti-fight script :P - It's for servers/places where you may not fight.
You can edit it, for jail or something. Whatever it does do this:

* When you have any weapon, it will be removed (all the weapons).
* When you press KEY_FIRE, you'll be frozen and you'll get a msg. After 3 secs, unfrozen
* If you press KEY_AIM and KEY_SECONDARY_ATTACK you'll get the same as KEY_FIRE (example: Holding RMB then tap ENTER)

It's small, easy, but it works.
Here goes the code. I don't need any credits. It took me about 30 seconds :')

pawn Код:
#include <a_samp>

#define KEY_AIM 128

forward UnfreezePlayer(playerid);

public OnFilterScriptInit() return 1;
public OnFilterScriptExit() return 1;

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if( (newkeys & KEY_FIRE) || ( (newkeys & KEY_AIM) && (oldkeys & KEY_AIM) && (newkeys & KEY_SECONDARY_ATTACK) ) )
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Don't fight here!");
        TogglePlayerControllable(playerid, false);
        SetTimerEx("UnfreezePlayer", 3000, false, "i", playerid);
        return 1;
    }
    return 1;
}

public OnPlayerUpdate(playerid)
    if(GetPlayerWeapon(playerid) != 0)
        SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: No weapons here!"), ResetPlayerWeapons(playerid);

public UnfreezePlayer(playerid)
    return TogglePlayerControllable(playerid, true);
Reply
#2

Nice release it will be useful
Reply
#3

Nice worl man!
Downloading
Reply
#4

work**
(Sorry i new in SAMP forums and idk how Edit )
Reply
#5

where check "in vehicle" ??
and other...
Reply
#6

Quote:
Originally Posted by Luka_Black
Посмотреть сообщение
work**
(Sorry i new in SAMP forums and idk how Edit )
Edit with a little button that looks like a pencil.
Reply
#7

Nice
Reply
#8

uselles, people tend to press the fire button for no reason at times, if there doing a stunt, and they press, they freeze? sorry but the freezze is stupid
Reply
#9

Great work.
Reply
#10

Quote:
Originally Posted by Sweet_Mafia™
Посмотреть сообщение
uselles, people tend to press the fire button for no reason at times, if there doing a stunt, and they press, they freeze? sorry but the freezze is stupid
Yeh, agreed.

suggestion - once they get caught a certain amount of times they get kicked or killed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)