first timer i guess?
anywho, i moved things around to make it more more readable and added some stuff. Not sure if this will compile though
Code:
/* ================================================================================================= */
====================================================================================================
Cvars: Defualt Settings
bb_enable 1
====================================================================================================
Required Modules:
Engine
====================================================================================================
#include <amxmodx>
#include <engine>
#include <csx>
#define PLUGIN "Baseballbat"
#define VERSION "1.0"
#define AUTHOR "Shane Gallant"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("bb_enable" ,"1")
register_event("CurWeapon", "baseballbat" , "be" , "1=1")
}
public plugin_precache(){
precache_model("models/baseball.mdl")
return PLUGIN_HANDLED
}
public baseballbat(id)
{
if (get_cvar_num("bb_enable") !=1)
return PLUGIN CONTINUE
if(!is_user_alive(id) && !is_user_connected(id))
return PLUGIN_CONTINUE
new weapid = read_data(2)
switch(weapid)
{
case CSW_KNIFE:
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_baseball.mdl")
}
}
return PLUGIN_CONTINUE;
}
__________________