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

Spawn a player + switch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 05-11-2018 , 13:26   Spawn a player + switch
Reply With Quote #1

Hello there,

What Im trying to do here is to make CT's who died to respawn back as CT's

PHP Code:
public eventDeathMsg()
{
    new 
iKiller read_data), iVictim read_data);
    
    
g_bAliveiVictim ] = false;
    
    if( 
cs_get_user_teamiVictim ) == CS_TEAM_T )
    {
        if( 
get_pcvar_numg_pDeathmatch ) )
        {
            if( 
iKiller != iVictim )
            {
                
cs_set_user_teamiVictimCS_TEAM_CT );
                
                if( 
iKiller )
                {
                    
MakeHiderDmiKiller );
                }
                
                else
                {
                    new 
iPlayers32 ], iNumiCT;
                    
get_playersiPlayersiNum"ae""CT" );
                    
                    
iCT iNum iPlayersrandomiNum ) ] : 0;
                    
                    new 
iTsiCTs;
                    
GetPlayersiTsiCTs );
                    
                    if( 
iCT && iTs iCTs )
                    {
                        
MakeHiderDmiCT );
                        
                        
GreenPrintiCT"You got transfered to terrorist!" );
                    }
                }
            }
            
            
// No proper event for checking timelimit, doing here.
            
if( get_pcvar_numg_pHalfWayVote ) && get_pcvar_numg_pVoteGameType ) )
            {
                if( 
g_iMapMiddleTime get_gametime() && !g_bSecondVote )
                {
                    
g_bSecondVote true;
        
                    
taskTypeVote();
                }
            }
        
            
            
set_task2.5"taskRespawn"iVictim TASK_RESPAWN );
        }
        
        else if( 
get_pcvar_numg_pNewNades ) && g_bStarted )
        {
            new 
iPlayers32 ], iNum;
            
get_playersiPlayersiNum"ae""TERRORIST" );
            
            if( 
iNum == )
            {
                
show_menuiPlayers], MENU_KEYSg_szNadeMenu5"NadesMenu" );
            }
        }
    }
    
    else if( 
cs_get_user_teamiVictim ) == CS_TEAM_CT && g_iTimer )
    {
        
entity_set_intiVictimEV_INT_flagsentity_get_intiVictimEV_INT_flags ) & ~FL_FROZEN );
                
        
MakeScreenFadeiVictim);
    }

Apparently I managed to fix that part but the plugin needs to be in a debug mode which causes loads of logs.

Also the switching method is kinda not working too, basically if any T dies, a random CT is switched to terrorists, thats how it is supposed to work.

If anyone could help, appreciated.
__________________

Last edited by SomewhereLost; 05-11-2018 at 13:32.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
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 14:58.


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