Hey,Guys please give me cvar for the "respawn" time and respawn turn on / and turn off plugin
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich>
#define PLUGIN "Knife Mod + respawn"
#define VERSION "0.4"
#define AUTHOR "LaSsHhH & vL."
new plugin_on
// Macros
#if cellbits == 32
#define OFFSET_BZ 235
#else
#define OFFSET_BZ 268
#endif
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
plugin_on = register_cvar("knife_mod", "1");
RegisterHam(Ham_Spawn, "player", "Fwd_Ham_Spawn_Post", 1); // Spawns
register_message(get_user_msgid("StatusIcon" ), "MsgStatusIcon" ); // BuyZone Icon
// Remove buyzone on map
remove_entity_name("info_map_parameters");
remove_entity_name("func_buyzone");
// Create own entity to block buying
new iEntity = create_entity("info_map_parameters");
DispatchKeyValue(iEntity, "buying", "3");
DispatchSpawn(iEntity);
}
public Fwd_Ham_Spawn_Post(id)
{
if(get_pcvar_num(plugin_on)) // If your cvar is on
{
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
}
}
}
public MsgStatusIcon(msg_id, msg_dest, id)
{
new szIcon[8];
get_msg_arg_string(2, szIcon, 7);
static const BuyZone[ ] = "buyzone";
if(equal(szIcon, BuyZone))
{
set_pdata_int(id, OFFSET_BZ, get_pdata_int(id, OFFSET_BZ, 5) & ~(1 << 0), 5)
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}