Raised This Month: $ Target: $400
 0% 

Mine - visibility


Post New Thread Reply   
 
Thread Tools Display Modes
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
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-08-2010 , 11:08   Re: Mine - visibility
Reply With Quote #2

Change this
PHP Code:
        if(player_class[i] == Mage)
        
set_rendering (entkRenderFxGlowShell255,0,0kRenderFxNone255 );
        else
        
set_rendering(ent,kRenderFxNone0,0,0kRenderTransTexture,50);
    } 
To:
PHP Code:
        if(player_class[i] == Mage)
        
set_rendering (entkRenderFxGlowShell255,0,0kRenderFxNone50 );
        else
        
set_rendering(ent,kRenderFxNone0,0,0kRenderTransTexture,255);
    } 
I don't know I think this is right way ;P
__________________
Still studying scripting...

Last edited by zirualas; 10-08-2010 at 11:12.
zirualas is offline
Send a message via Skype™ to zirualas
Change377
Junior Member
Join Date: Aug 2010
Old 10-08-2010 , 12:20   Re: Mine - visibility
Reply With Quote #3

Heh, i want, that for mage it will be visible - so your change cant work, can it?
Change377 is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-08-2010 , 12:31   Re: Mine - visibility
Reply With Quote #4

zirualas you are actually setting rendering on entity, doesn't matter who is looking on it. It won't work that way.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Change377
Junior Member
Join Date: Aug 2010
Old 10-08-2010 , 16:29   Re: Mine - visibility
Reply With Quote #5

I think so, but how can i do it?
Change377 is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-08-2010 , 22:25   Re: Mine - visibility
Reply With Quote #6

So you want only mages to actually SEE the mine ? Because what you're doing is if mages plant a mine, theirs will be visible... to all.

For only mages to see them, you'll need to hook FM_AddToFullPack, search for it to see examples
__________________
Hunter-Digital is offline
Change377
Junior Member
Join Date: Aug 2010
Old 10-09-2010 , 05:43   Re: Mine - visibility
Reply With Quote #7

I want to mages will se them, others - not. So how can i do it?
Change377 is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 06:12   Re: Mine - visibility
Reply With Quote #8

You want what mages be Visible but other players be Invisible?
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-09-2010 , 06:21   Re: Mine - visibility
Reply With Quote #9

Mage can see 100% of the mine
Other players see 10% of the mine(default value)
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 06:26   Re: Mine - visibility
Reply With Quote #10

Now i understand ;P
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
Reply



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