AlliedModders

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

GhostMan 09-07-2012 09:59

cathing players
 
Well i'm having problem with reseting player's rendering.

In certain situation T's or CT's get invisibility like that

Code:

set_user_rendering(tid, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
Then in certain situation theyr invisibility is removed like that

Code:

    new players[32], num;
    get_players(players, num, "ae", "TERRORIST");
       
    for(new i = 0; i < num; i++)
    {       
        set_user_rendering(players[i]);
        set_user_footsteps(players[i], 0);
    }

Sometimes after players should lose theyr invisibility some of them still keep invisible. I believe the problem is if player dies when he is still alive after respawn he keep beeing invisible (becouse the code resets rendering only for alive players)

In function "Reset" i dont creat any "ID" or stuff it's becouse i can't use this function in later code as i would like to so i need to cath players inside this funcion.

The question is HOW DO I DO THAT? Do i have to use FOR LOOP (i'v never been sure what for is this loop, i believed it is used only with get_players or stuff)?

Would it be something like this?

Code:

new g_iMaxPlayers = get_maxplayers()

public Reset()
{
    set_lights("#OFF");

    server_cmd("sv_gravity 800");
    server_cmd("mp_friendlyfire 0");
 
   
    for(new i = 1; i < g_iMaxPlayers; i++)
    {       
        set_user_rendering(i);
        set_user_footsteps(i, 0);
    }
   
    g_BoxStarted = false;
    catch = false;
    g_iTimeLeft = -1;
    g_SpecDay = 0;
}


Torge 09-07-2012 10:09

Re: cathing players
 
Don't create 2 threads with same question ...

https://forums.alliedmods.net/showthread.php?t=195411


All times are GMT -4. The time now is 08:21.

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