Created
March 6, 2014 10:37
-
-
Save Southclaws/9387094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*============================================================================== | |
Infinite Ammo | |
Dependencies: | |
tickcountfix: https://github.com/Southclaw/ScavengeSurvive/blob/master/gamemodes/SS/utils/tickcountfix.pwn | |
AdvancedWeaponData: https://github.com/Southclaw/AdvancedWeaponData | |
==============================================================================*/ | |
static | |
ammo_LastShot[MAX_PLAYERS], | |
ammo_ShotCounter[MAX_PLAYERS]; | |
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) | |
{ | |
if(GetTickCountDifference(ammo_LastShot[playerid], GetTickCount()) < 1000) | |
{ | |
ammo_ShotCounter[playerid]++; | |
if(ammo_ShotCounter[playerid] > GetWeaponMagSize(weaponid)) | |
{ | |
// Your own admin report function | |
TellAllTheAdmins(" > %p fired %d bullets from a %w without reloading.", playerid, ammo_ShotCounter[playerid], weaponid); | |
return 0; | |
} | |
} | |
else | |
{ | |
ammo_ShotCounter[playerid] = 1; | |
} | |
ammo_LastShot[playerid] = GetTickCount(); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment