[Include] Weapon Limiter
#1

Just a quick include I made, it will limit the time in which shots will be synced and is full adjustable. This is useful for scaling back certain weapons effectiveness when used in combination with a bug like rapid fire c-bug deagle. You can specify the time the milliseconds that a shot would be processed.

pawn Код:
#define         COLT_DELAY_HIT          200
#define         SILENCE_HIT_DELAY       400
#define         DEAGLE_HIT_DELAY        400
#define         SHOTGUN_HIT_DELAY       0
#define         SAWNOFF_HIT_DELAY       300
#define         COMBAT_HIT_DELAY        200
#define         UZI_HIT_DELAY           400
#define         MP5_HIT_DELAY           200
#define         AK_HIT_DELAY            400
#define         M4_HIT_DELAY            400
#define         TEC_HIT_DELAY           300
#define         RIFLE_HIT_DELAY         0
#define         SNIPER_HIT_DELAY        0
#define         MINIGUN_HIT_DELAY       0


static  LastShotTime[MAX_PLAYERS];

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(hittype == BULLET_HIT_TYPE_PLAYER)
    {
        new LastShotDelay = GetTickCount() - LastShotTime[playerid];
        switch(weaponid)
        {
            // Colt 45
            case 22: if(LastShotDelay < COLT_DELAY_HIT) return 0;
            case 23: if(LastShotDelay < SILENCE_HIT_DELAY) return 0;
            case 24: if(LastShotDelay < DEAGLE_HIT_DELAY) return 0;
            case 25: if(LastShotDelay < SHOTGUN_HIT_DELAY) return 0;
            case 26: if(LastShotDelay < SAWNOFF_HIT_DELAY) return 0;
            case 27: if(LastShotDelay < COMBAT_HIT_DELAY) return 0;
            case 28: if(LastShotDelay < UZI_HIT_DELAY) return 0;
            case 29: if(LastShotDelay < MP5_HIT_DELAY) return 0;
            case 30: if(LastShotDelay < AK_HIT_DELAY) return 0;
            case 31: if(LastShotDelay < M4_HIT_DELAY) return 0;
            case 32: if(LastShotDelay < TEC_HIT_DELAY) return 0;
            case 33: if(LastShotDelay < RIFLE_HIT_DELAY) return 0;
            case 34: if(LastShotDelay < SNIPER_HIT_DELAY) return 0;
            case 38: if(LastShotDelay < MINIGUN_HIT_DELAY) return 0;
        }
    }
    LastShotTime[playerid] = GetTickCount();
    return CallLocalFunction("Limiter_OnPlayerWeaponShot", "iiiifff", playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
}

#if defined _ALS_OnPlayerWeaponShot
    #undef OnPlayerWeaponShot
#else
    #define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot Limiter_OnPlayerWeaponShot

forward Limiter_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
Reply
#2

Great and very useful.
+Rep.

Quote:

This forum requires that you wait 240 seconds between posts. Please try again in 138 seconds.

Reply
#3

Thanks for the tips, it's interesting to see three different ways to do this I appreciate you took the time to point that out. I'll have to start asking myself things if I really need some of the things I use and is there a way I can do it differently that is the same?
Reply
#4

Usefull, new cheat is here for rapid fire on 0.3z if you want protect your server use this system and thanks guy
Reply
#5

Are these the default values which comes with GTA SA? Or did you edit them?

Edit: I got my answer.

Nice release, good job!

These values are not close to the real ones. Can you please improve them?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)