- Код: Выделить всё
#include < amxmodx >
#include < zombieplague >
#include < engine >
#define PLUGIN "Hat"
#define VERSION "1.0"
#define AUTHOR "pRoxxx"
new Ent[33]
new const g_model[] =
{
"models/hats/Olen4er.mdl" ,
"models/hats/menti_ny.mdl" ,
"models/hats/santahat2.mdl"
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Battery", "armor", "be")
}
public plugin_precache()
{
precache_model( g_model )
}
public armor(id)
{
new arm = read_data(1)
if(zp_get_user_zombie(id))
{
remove_hat(id)
return
}
if(arm < 1)
{
if(Ent[id] > 0)
{
remove_hat(id)
}
}
else if(arm > 0)
{
if(Ent[id] < 1)
{
Ent[id] = create_entity("info_target")
if(is_valid_ent(id))
{
entity_set_model(Ent[id] , g_model)
entity_set_int(Ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_edict(Ent[id], EV_ENT_aiment, id)
}
}
}
}
public remove_hat(id)
{
if(Ent[id] > 0)
{
remove_entity(Ent[id])
Ent[id] = 0
}
}
public client_connect(id)
{
remove_hat(id)
}
public client_disconnect(id)
{
remove_hat(id)
}
So I got this code, but its not workin randomly. It gets only first Olen4er.mdl model when ur armoring. Can u do this to change randomly by three hats models please?