AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   check if a user is rendering(glowing) (https://forums.alliedmods.net/showthread.php?t=323966)

Ynet 05-02-2020 15:04

check if a user is rendering(glowing)
 
is there a way to check if a person is glowing?


here is an example of how i want to check it



PHP Code:

public KillRender()
{
    
    
    new 
players[32], num;
    
get_playersplayersnum"ch" );
    for( new 
0numi++ )
    {
        
        
        if(
get_user_team(players[i]) == 2)
        continue;
        
        
        if(
get_user_rendering(players[i]))
        {
            
            
user_silentkill(players[i])
            
        }
        
    }
    
    



OciXCrom 05-02-2020 15:50

Re: check if a user is rendering(glowing)
 
It depends on which part of the glow effect you want to check. See the API to understand how the function works - https://www.amxmodx.org/api/fun/get_user_rendering

Bear in mind this function is only available in AMXX 1.9 or above.

PS: there's no point in using "get_user_team" there. Simply add the "e" flag in "get_players" and set it to retrieve only CT players.

Ynet 05-02-2020 16:41

Re: check if a user is rendering(glowing)
 
Quote:

Originally Posted by OciXCrom (Post 2697681)
It depends on which part of the glow effect you want to check. See the API to understand how the function works - https://www.amxmodx.org/api/fun/get_user_rendering

Bear in mind this function is only available in AMXX 1.9 or above.

PS: there's no point in using "get_user_team" there. Simply add the "e" flag in "get_players" and set it to retrieve only CT players.

the get_user_team part is less relevant i just wanted to give an example on how i want to do it

and unfortnately i don't think i have the new amxx version, any other way to do it with the older versions?

Vieni 05-02-2020 16:56

Re: check if a user is rendering(glowing)
 
Quote:

Originally Posted by Ynet (Post 2697694)
the get_user_team part is less relevant i just wanted to give an example on how i want to do it

and unfortnately i don't think i have the new amxx version, any other way to do it with the older versions?

If you're putting the rendering, you can just easily use these:
Code:

   
if(entity_get_int(id, EV_INT_rendermode) == your rendermode)

or

if(entity_get_int(id, EV_INT_renderfx) == your render fx)

or

if(entity_get_float(id, EV_FL_renderamt) == your render amount)

These are engine functions, for fakemeta use these:
Code:

pev(id, pev_rendermode or pev_renderfx or pev_renderamt)

Ynet 05-02-2020 23:52

Re: check if a user is rendering(glowing)
 
Quote:

Originally Posted by Vieni (Post 2697695)
If you're putting the rendering, you can just easily use these:
Code:

   
if(entity_get_int(id, EV_INT_rendermode) == your rendermode)

or

if(entity_get_int(id, EV_INT_renderfx) == your render fx)

or

if(entity_get_float(id, EV_FL_renderamt) == your render amount)

These are engine functions, for fakemeta use these:
Code:

pev(id, pev_rendermode or pev_renderfx or pev_renderamt)


PHP Code:

public checkglow(id)
{
    
    if(
pev(idpev_renderfx ))
    {
        
ColorChat(id,"Glowing");
    }
    else
    {
        
ColorChat(id,"Not Glowing");
    }
    


found the perfect match, thank you.

georgik57 05-03-2020 13:20

Re: check if a user is rendering(glowing)
 
Quote:

Originally Posted by Ynet (Post 2697734)
PHP Code:

public checkglow(id)
{
    
    if(
pev(idpev_renderfx ))
    {
        
ColorChat(id,"Glowing");
    }
    else
    {
        
ColorChat(id,"Not Glowing");
    }
    


found the perfect match, thank you.

PHP Code:

public checkglow(id)
{
    
    if(
pev(idpev_renderfx ) == kRenderFxGlowShell)
    {
        
ColorChat(id,"Glowing");
    }
    else
    {
        
ColorChat(id,"Not Glowing");
    }
    



ZaKaRiAMaGh 05-06-2020 12:25

Re: check if a user is rendering(glowing)
 
i need help here
any one to tell me what s the expresion if user is alive

CrazY. 05-06-2020 13:10

Re: check if a user is rendering(glowing)
 
"is_user_alive" returns if the client is alive.
"if" in programming is a conditional statement.

That said, if (is_user_alive(index)) means that something will happen only if the player is alive.


All times are GMT -4. The time now is 16:52.

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