AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Mine - visibility (https://forums.alliedmods.net/showthread.php?t=140037)

Change377 10-08-2010 10:48

Mine - visibility
 
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

zirualas 10-08-2010 11:08

Re: Mine - visibility
 
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

Change377 10-08-2010 12:20

Re: Mine - visibility
 
Heh, i want, that for mage it will be visible - so your change cant work, can it?

naven 10-08-2010 12:31

Re: Mine - visibility
 
zirualas you are actually setting rendering on entity, doesn't matter who is looking on it. It won't work that way.

Change377 10-08-2010 16:29

Re: Mine - visibility
 
I think so, but how can i do it?

Hunter-Digital 10-08-2010 22:25

Re: Mine - visibility
 
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 :P

Change377 10-09-2010 05:43

Re: Mine - visibility
 
I want to mages will se them, others - not. So how can i do it? :)

zirualas 10-09-2010 06:12

Re: Mine - visibility
 
You want what mages be Visible but other players be Invisible?

naven 10-09-2010 06:21

Re: Mine - visibility
 
Mage can see 100% of the mine
Other players see 10% of the mine(default value)

zirualas 10-09-2010 06:26

Re: Mine - visibility
 
Now i understand ;P


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

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