Raised This Month: $ Target: $400
 0% 

[EDIT] Team Changer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-14-2012 , 11:38   [EDIT] Team Changer
Reply With Quote #1

can someone make the plugin that will transfer ONLY alive player to spec ONLY!

PHP Code:
#include < amxmodx >
#include < fun >
#include < engine >
#include < cstrike >
#include < hamsandwich >

new g_iMsgSayTextFloat:g_vSavedOrigin33 ][ ], bool:g_bWasAlive33 ];

public 
plugin_init( ) {
    
register_plugin"Team Changer""1.0""SchlumPF" );
    
    
register_clcmd"say /spec""CmdSpectator" );
    
register_clcmd"say /ct",   "CmdCounterTerrorist" );
    
register_clcmd"say /t",   "CmdTerrorist" );
    
    
g_iMsgSayText get_user_msgid"SayText" );
    
    
set_msg_blockget_user_msgid"ClCorpse" ), BLOCK_SET );
}

public 
CmdSpectator( const id ) {
    if( 
cs_get_user_teamid ) == CS_TEAM_SPECTATOR ) {
        
SendMessageid"^4[XJ] You are already a^3 spectator^4, say '^1/ct^4' to change your team." );
        
        return 
PLUGIN_HANDLED;
    }
    
    if( ( 
g_bWasAliveid ] = bool:is_user_aliveid ) ) )
        
entity_get_vectoridEV_VEC_origing_vSavedOriginid ] );
    
    
entity_set_intidEV_INT_deadflagDEAD_DISCARDBODY );
    
cs_set_user_teamidCS_TEAM_SPECTATOR );
    
    
SendMessageid"^4[XJ] You became a^3 spectator^1." );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdCounterTerrorist( const id ) {
    if( 
cs_get_user_teamid ) == CS_TEAM_CT ) {
        
SendMessageid"^4[XJ] You are already a^3 counter-terrorist^4, say '^1/spec^4' to change your team." );
        
        return 
PLUGIN_HANDLED;
    }
    
    
cs_set_user_teamidCS_TEAM_CT );
    
    
ExecuteHamBHam_CS_RoundRespawnid );
    
    if( !
user_has_weaponidCSW_KNIFE ) )
        
give_itemid"weapon_knife" );
    
    if( !
user_has_weaponidCSW_USP ) ) {
        
give_itemid"weapon_usp" );
        
        
cs_set_user_bpammoidCSW_USP100 );
    }
    
    if( 
g_bWasAliveid ] ) {
        
g_bWasAliveid ] = false;
        
        
entity_set_originidg_vSavedOriginid ] );
    }
    
    
SendMessageid"^4[XJ] You became a^3 counter-terrorist^4." );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdTerrorist( const id ) {
    if( 
cs_get_user_teamid ) == CS_TEAM_T ) {
        
SendMessageid"^4[XJ] You are already a^3 terrorist^4, say '^1/spec^4' to change your team." );
        
        return 
PLUGIN_HANDLED;
    }
    
    
cs_set_user_teamidCS_TEAM_T );
    
    
ExecuteHamBHam_CS_RoundRespawnid );
    
    if( !
user_has_weaponidCSW_KNIFE ) )
        
give_itemid"weapon_knife" );
    
    if( !
user_has_weaponidCSW_GLOCK18 ) ) {
        
give_itemid"weapon_glock18" );
        
        
cs_set_user_bpammoidCSW_GLOCK18120 );
    }
    
    if( 
g_bWasAliveid ] ) {
        
g_bWasAliveid ] = false;
        
        
entity_set_originidg_vSavedOriginid ] );
    }
    
    
SendMessageid"^4[XJ] You became a^3 terrorist^4." );
    
    return 
PLUGIN_HANDLED;
}

SendMessage( const id, const szMessage[ ] ) {
    
message_beginMSG_ONE_UNRELIABLE g_iMsgSayText_id );
    
write_byteid );
    
write_stringszMessage );
    
message_end( );


Last edited by TRUE RED; 05-14-2012 at 11:39.
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
 



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 00:21.


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