Hello.
I have function which place mine (like bomb etc) . Mine should be almost invisibility - it works. But how can i make if - which make mine invisible for all players - but visible when player has class == mage ? My code:
Code:
public PlaceMine(id)
{
if (!mines_amount[id])
{
client_print(id, print_center, "U have used all your mines!");
return PLUGIN_CONTINUE;
}
if(player_inteligence[id] < 1)
client_print(id, print_center, "More inteligence = more dmg");
mines_amount[id]--;
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
new ent = create_entity("info_target");
entity_set_string(ent ,EV_SZ_classname, "Mine");
entity_set_edict(ent ,EV_ENT_owner, id);
entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);
entity_set_origin(ent, origin);
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
entity_set_model(ent, "models/mine.mdl");
entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});
drop_to_floor(ent);
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
for(new i=0;i<33;i++)
{
if(player_class[i] == Mage)
set_rendering (ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 );
else
set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,50);
}
return PLUGIN_CONTINUE;
}
Other parts of code is not important in my case - i only please about make visible / invisible. Now mines are invisible 4 all players