SA-MP Forums Archive
[FilterScript] [SMALL] Anti Fight - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [SMALL] Anti Fight (/showthread.php?tid=202493)



[SMALL] Anti Fight - Kwarde - 24.12.2010

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);



Re: [SMALL] Anti Fight - TheArcher - 24.12.2010

Nice release it will be useful


Re: [SMALL] Anti Fight - Luka_Black - 24.12.2010

Nice worl man!
Downloading


Re: [SMALL] Anti Fight - Luka_Black - 24.12.2010

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


Re: [SMALL] Anti Fight - Aleks10 - 24.12.2010

where check "in vehicle" ??
and other...


Re: [SMALL] Anti Fight - Mean - 24.12.2010

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.


Re: [SMALL] Anti Fight - [nB]Flow - 24.12.2010

Nice


Re: [SMALL] Anti Fight - Sweet_Mafia™ - 25.12.2010

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


Re: [SMALL] Anti Fight - HyperZ - 25.12.2010

Great work.


Re: [SMALL] Anti Fight - Haydz - 25.12.2010

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.