Raised This Month: $51 Target: $400
 12% 

[CSS] Ghost mode then change team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 10-20-2016 , 15:47   [CSS] Ghost mode then change team
Reply With Quote #1

Hi guys,

I have question how to set player to ghost without killing.

Example:

1) Player is alive on round end,
2) move this player to ghost without kill,
3) swap teams

I need to use to change player state:
PHP Code:
SetEntProp(clientProp_Send"m_lifeState"2); <-- what state is 2 value 
second I need to remove weapons and other thinks, then change player team.

Anyone can help me with this problem ?

CODE
PHP Code:
public void OnRoundEnd(Handle event, const char[] namebool dontBroadcast)
{
    for(
int client 0client MaxClientsclient++)
    {
        if(
client && IsClientConnected(client) && IsClientInGame(client))
        {
            
int team GetClientTeam(client);

            if(
team CS_TEAM_SPECTATOR)
                
SwappTeams(clientInversePlayableTeam(team));
        }
    }
}

public 
void SwappTeam(int clientint team)
{
    
SetEntProp(clientProp_Send"m_lifeState"2);
    
CS_SwitchTeam(clientteam);
}

stock int InversePlayableTeam(int team)
{
    if(
team == CS_TEAM_T)
        return 
CS_TEAM_CT;

    return 
CS_TEAM_T;

Regards,
Nerus.

Last edited by Nerus; 10-21-2016 at 12:01.
Nerus 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 22:14.


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