Raised This Month: $ Target: $400
 0% 

Can't teamswap dead players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
GoldNux
Senior Member
Join Date: Mar 2018
Old 11-07-2022 , 12:02   Re: Can't teamswap dead players
Reply With Quote #10

I tried this stupid solution but it crashed my server:
I also tried calling the function from:

register_logevent( "SwapAlivePlayers", 2, "1=Round_End" );

Instead of:

register_event("SendAudio", "SwapAlivePlayers", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "SwapAlivePlayers", "a", "2&%!MRAD_ctwin")

Still does not work so seems to be an issue with seting dead players.
Can someone test on their system? :S

PHP Code:
public SwapAlivePlayers()
{
    new 
players[32];
    new 
playercount;
    
get_players(playersplayercount"h");
    
    new 
iid
    
for (i=0i<playercounti++)
    {
        
id players[i];
        new 
playerTeam cs_get_user_team(id);
        if (
playerTeam != CS_TEAM_SPECTATOR && playerTeam != CS_TEAM_UNASSIGNED)
        {
            if (
playerTeam == CS_TEAM_T)
            {
                
engclient_cmd(id"jointeam""2");
                
engclient_cmd(id"joinclass""5");
            }
            else
            {
                
engclient_cmd(id"jointeam""1");
                
engclient_cmd(id"joinclass""5");
            }
        }
    }


Last edited by GoldNux; 11-07-2022 at 12:18.
GoldNux is offline
 



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 10:32.


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