Raised This Month: $ Target: $400
 0% 

Mine - visibility


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Change377
Junior Member
Join Date: Aug 2010
Old 10-08-2010 , 10:48   Mine - visibility
Reply With Quote #1

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

Last edited by Change377; 10-08-2010 at 11:03.
Change377 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode