I was trying to write a plugin that will spawn a crowbar in front of you but I can't get it to appear it just says unknown command.
Code:
#include <amxmodx>
#include <engine>
public plugin_init()
{
register_plugin("Crowbar","0.1","JoeCaprini")
register_clcmd("amx_crowbar","createcrowbar",ADMIN_BAN,"- Creates a crowbar")
}
public createcrowbar()
{
// Create the crowbar
new entbar = create_entity("info_target")
// Give it a new name
entity_set_string(entbar,EV_SZ_classname,"crowbar")
// Set the model
entity_set_model(entbar,"models/w_crowbar.mdl")
// Position it
new Float:PVEC[3] = {0.0,0.0,0.0}
entity_set_origin(entbar,PVEC)
// Set some properties I don't understand
entity_set_int(entbar, EV_INT_solid, 1)
entity_set_int(entbar, EV_INT_movetype, 6)
return PLUGIN_CONTINUE
}
// new weaponid, clip, ammo
// weaponid = get_user_weapon(id, clip, ammo)
// if (weaponid == CSW_C4)
// {
// ammo_hud(id, 1)
// entity_set_string(id, EV_SZ_viewmodel, "models/v_crowbar.mdl")
// entity_set_string(id, EV_SZ_weaponmodel, "models/p_crowbar.mdl")
// }
public plugin_precache()
{
precache_model("models/w_crowbar.mdl")
precache_model("models/v_crowbar.mdl")
precache_model("models/p_crowbar.mdl")
}