move some weapon drop modules
This commit is contained in:
parent
0836381de9
commit
2a90d06d90
@ -13,8 +13,6 @@
|
||||
#error "This module requires weapon data functions"
|
||||
#endif
|
||||
|
||||
#define WEAPON_DROP_ENABLED
|
||||
|
||||
/* ** Definitions ** */
|
||||
#define MAX_WEAPON_DROPS ( 100 )
|
||||
|
||||
@ -41,6 +39,12 @@ hook OnGameModeInit( )
|
||||
return 1;
|
||||
}
|
||||
|
||||
hook OnServerUpdate( )
|
||||
{
|
||||
ClearInactiveWeaponDrops( );
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined AC_INCLUDED
|
||||
hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart )
|
||||
#else
|
||||
@ -394,7 +398,7 @@ stock CreateWeaponPickup( weaponid, ammo, slotid, Float: X, Float: Y, Float: Z,
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearInactiveWeaponDrops( gettime( ) );
|
||||
ClearInactiveWeaponDrops( );
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
@ -409,8 +413,11 @@ stock DestroyWeaponPickup( handle )
|
||||
return 1;
|
||||
}
|
||||
|
||||
stock ClearInactiveWeaponDrops( global_timestamp )
|
||||
stock ClearInactiveWeaponDrops( )
|
||||
{
|
||||
new
|
||||
global_timestamp = GetServerTime( );
|
||||
|
||||
foreach ( new dropid : weapondrop ) if ( g_weaponDropData[ dropid ] [ E_EXPIRE_TIMESTAMP ] != 0 && global_timestamp > g_weaponDropData[ dropid ] [ E_EXPIRE_TIMESTAMP ] )
|
||||
{
|
||||
new
|
||||
|
@ -948,11 +948,6 @@ public OnServerUpdateTimer( )
|
||||
// Restore and Replenish Stuff
|
||||
if ( g_iTime > g_RestoreRobberiesBribes )
|
||||
{
|
||||
#if defined WEAPON_DROP_ENABLED
|
||||
// Replenish Weapon Drops
|
||||
ClearInactiveWeaponDrops( g_iTime );
|
||||
#endif
|
||||
|
||||
// Replenish Vaults
|
||||
for( new i = 0; i < sizeof( g_bankvaultData ); i++ ) if ( g_bankvaultData[ i ] [ E_DISABLED ] && g_iTime > g_bankvaultData[ i ] [ E_TIMESTAMP_CLOSE ] )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user