20.01.2014, 12:51
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);