ReGameDLL_CS
ReGameDLL_CS copied to clipboard
[Feature Request] mp_weapons_map_count
My suggestion is to add a new cvar to control the weapons count that spawn with the map, allowing the ability to have infinite weapon count without the need to modify the map.
- Default behaviour (do nothing).
- Make the weapons count infinite.
use this
#define IsPlayer(%1) (1 <= (%1) <= MaxClients)
#define CanRestart(%1) (pev(%1, pev_effects) & EF_NODRAW)
public plugin_init()
{
register_plugin("Armoury CSDM Restart", "0.1", "Vaqtincha")
RegisterHam(Ham_Think, "armoury_entity", "CArmoury_Think", .Post = true)
RegisterHam(Ham_Touch, "armoury_entity", "CArmoury_Touch", .Post = true)
}
public CArmoury_Touch(const pArmoury, const pPlayer)
{
if (IsPlayer(pPlayer) && pArmoury > 0 && CanRestart(pArmoury)) {
set_entvar(pArmoury, var_nextthink, get_gametime() + 10.0) // respawn time 10 sec
}
}
public CArmoury_Think(const pArmoury)
{
if (!is_nullent(pArmoury))
{
ExecuteHamB(Ham_CS_Restart, pArmoury)
// emit_sound(pArmoury, CHAN_WEAPON, "items/suitchargeok1.wav", 0.6, ATTN_NORM, 0, 150) // respawn sound
}
}```