Raised This Month: $ Target: $400
 0% 

cathing players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 09-07-2012 , 09:59   cathing players
Reply With Quote #1

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;
}
GhostMan is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 09-07-2012 , 10:09   Re: cathing players
Reply With Quote #2

Don't create 2 threads with same question ...

https://forums.alliedmods.net/showthread.php?t=195411
Torge is offline
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 08:21.


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