new client = GetEntPropEnt(weapon, Prop_Send, "m_hOwnerEntity"); if ( !(client > 0 && client <= MaxClients) ) return;
new active = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); if (weapon == active) return;
if ( (GetGameTime()-flHolsterTime) > flSecondsDelay ) /*if flSecondsDelay = 3.0, then u gotta wait 3.0 seconds before function will reload. Obviously this function needs to work in a timer/think function */ { flHolsterTime = GetGameTime(); if (GetWeaponAmmo(weapon) < 1) return; if (GetWeaponClip(weapon) < ClipTable[weapon]) { if (GetWeaponAmmo(weapon) < ReloadInterval) ReloadInterval = GetWeaponAmmo(weapon);
public Action OnWeaponSpawned(Handle timer, any ref) { int wep = EntRefToEntIndex(ref); if ( IsValidEntity(wep) && IsValidEdict(wep) ) { int client = GetEntPropEnt(wep, Prop_Send, "m_hOwnerEntity"); if ( !(client > 0 && client <= MaxClients) ) return Action:0; flHolstered[wep] = GetGameTime(); AmmoTable[wep] = GetWeaponAmmo(wep); ClipTable[wep] = GetWeaponClip(wep); } return Action:0; }
stock void BackPackReload(int weapref, float flHolsterTime, float flSecondsDelay, bool SingleReload = false, int ReloadInterval) { int weapon = EntRefToEntIndex(weapref); if ( weapon <= 0 || !IsValidEntity(weapon) ) return;
int client = GetEntPropEnt(weapon, Prop_Send, "m_hOwnerEntity"); if ( !(client > 0 && client <= MaxClients) ) return;
int active = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); if (weapon == active) return;
if ( (GetGameTime()-flHolsterTime) > flSecondsDelay ) /*if flSecondsDelay = 3.0, then u gotta wait 3.0 seconds before function will reload. Obviously this function needs to work in a timer/think function */ { //CPrintToChat(client, "{olive}[VSH-TEST]{default} (GetGameTime()-flHolsterTime = %f) > flSecondsDelay = %f, flHolsterTime = %f", GetGameTime()-flHolsterTime, flSecondsDelay, flHolsterTime); flHolsterTime = GetGameTime(); if (GetWeaponAmmo(weapon) < 1) return; if (GetWeaponClip(weapon) < ClipTable[weapon]) { if (GetWeaponAmmo(weapon) < ReloadInterval) ReloadInterval = GetWeaponAmmo(weapon);
it remakes the HL2 backpack reload where, if u had a weapon that wasn't fully reloaded but it's not active for 3 seconds, it'll be fully reloaded by the time you switch back to it.
Only certain weapons in HL2 had this feature.
This basically is a remake of the entire mechanic.