[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


Messages In This Thread
[SMALL] Anti Fight - by Kwarde - 24.12.2010, 11:11
Re: [SMALL] Anti Fight - by TheArcher - 24.12.2010, 11:14
Re: [SMALL] Anti Fight - by Luka_Black - 24.12.2010, 13:31
Re: [SMALL] Anti Fight - by Luka_Black - 24.12.2010, 13:32
Re: [SMALL] Anti Fight - by Aleks10 - 24.12.2010, 14:45
Re: [SMALL] Anti Fight - by Mean - 24.12.2010, 14:52
Re: [SMALL] Anti Fight - by [nB]Flow - 24.12.2010, 23:03
Re: [SMALL] Anti Fight - by Sweet_Mafia™ - 25.12.2010, 02:16
Re: [SMALL] Anti Fight - by HyperZ - 25.12.2010, 10:19
Re: [SMALL] Anti Fight - by Haydz - 25.12.2010, 10:22

Forum Jump:


Users browsing this thread: 1 Guest(s)