AlliedModders

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

KamiN 12-08-2011 09:43

set_entity_visibility
 
I'm having a jailbreak "Days menu" plugin and i decited to make a new day called "invisibility day" in witch CT's becomes invisible and have to kill T's

Heres the code of it

Code:

case DAY_INVIS:
                        {
                                if(IsPlayer(i) && is_user_alive(i))
                                {
                                        switch(cs_get_user_team(i))
                                        {
                                                case CS_TEAM_T:
                                                {
                                                ........
                                                }
                                               
                                                case CS_TEAM_CT:
                                                {
                                                    ...................
                                                        set_entity_visibility (i, 0)
                                                    ...................
                                                        }

                                                }
                                        }

                                }

                                .......................
                        }

When time is 0:00 i want CT's to become visible again so i use this code, but it doesnt work, CTs are still invisible, why? O.o

Code:

#define TASK_timeup 934279423

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

public event_round_start()
{
        set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_timeup)
}

public time_is_up(id)
{       

        if(cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id))
                set_entity_visibility ( id, 1 )

}


KamiN 12-08-2011 13:41

Re: set_entity_visibility
 
Anybody is up for help? O.o

Devil259 12-08-2011 13:45

Re: set_entity_visibility
 
set_entity_visibility ( id, 1.0 )

->

set_entity_visibility ( id, 1 )

...

KamiN 12-08-2011 13:52

Re: set_entity_visibility
 
Still doesnt works..

.Dare Devil. 12-08-2011 14:09

Re: set_entity_visibility
 
set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )

back to visible

set_user_rendering ( id )

KamiN 12-08-2011 14:16

Re: set_entity_visibility
 
Quote:

Originally Posted by .Dare Devil. (Post 1609868)
set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )

back to visible

set_user_rendering ( id )



If players use SOFTWARE renderer they can see "invisible" CTs, thats why im trying to make CT's invisible someother way

ConnorMcLeod 12-08-2011 14:36

Re: set_entity_visibility
 
Use kRenderTransColor instead.

Devil259 12-08-2011 14:56

Re: set_entity_visibility
 
Quote:

Originally Posted by KamiN (Post 1609856)
Still doesnt works..

That was not the only error.

KamiN 12-08-2011 15:23

Re: set_entity_visibility
 
Quote:

Originally Posted by Devil259 (Post 1609891)
That was not the only error.

So can u tell me how to make it work properly?

Devil259 12-08-2011 15:26

Re: set_entity_visibility
 
Quote:

Originally Posted by ConnorMcLeod (Post 1609883)
Use kRenderTransColor instead.

So replace

set_entity_visibility (i, 0)

by

set_user_rendering(i, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)


All times are GMT -4. The time now is 11:49.

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