I maked this:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Test Change c4"
#define VERSION "1.0"
#define AUTHOR "SAMURAI"
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_c4model","change_c4model",ADMIN_RCON,"message etc...");
}
public change_c4model(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new argv[64]
read_argv(1,argv,63)
new g_model[128]
if(argv[0])
{
format(g_model, 127, "models/%s.mdl", argv)
}
else
{
copy(g_model,127,"models/w_c4.mdl")
}
new target = -1, classname[] = "func_bomb_target"
while ((target = fm_find_ent_by_class(target, classname)))
{
engfunc(EngFunc_SetModel,"func_bomb_target")
}
return PLUGIN_HANDLED;
}
But doesen't change the model when i use command . It's something wrong on my code ?