Raised This Month: $ Target: $400
 0% 

[EDIT] Team Changer


Post New Thread Reply   
 
Thread Tools Display Modes
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
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-14-2012 , 12:24   Re: [EDIT] Team Changer
Reply With Quote #2

PHP Code:
if(!is_user_alive(id))
return 
PLUGIN_HANDLED 

Last edited by EpicMonkey; 05-14-2012 at 12:24.
EpicMonkey is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-14-2012 , 14:40   Re: [EDIT] Team Changer
Reply With Quote #3

sorry, EpicMonkey, but i don't know what code to cut. This plugin has three functions (/ct/t/spec) i need only one (/spec). I think the code should be cut a lot but i have no idea how to do it. Can you make the whole code? Thanks!

Last edited by TRUE RED; 05-15-2012 at 05:58.
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-14-2012 , 15:56   Re: [EDIT] Team Changer
Reply With Quote #4

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Invisible spectator"
#define VERSION "1.0"
#define AUTHOR "Bilal"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /spec""CmdSpec")
}

public 
CmdSpec(id)
{
    if (!(
is_user_alive(id)))
    {
        
client_print(idprint_chat"You have to be alive to use this command!")
        return 
PLUGIN_HANDLED
    
}
    if (
get_user_team(id) == 3)
    {
        
client_print(idprint_chat"You are already a spectator!")
        return 
PLUGIN_HANDLED
    
}
      
// switch team
    
cs_set_user_team(idCS_TEAM_SPECTATOR)

    
// respawn
    
ExecuteHam(Ham_CS_RoundRespawnid)

    
// rendering
    
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0)
    
    
// effetcs
    
strip_user_weapons(id)
    
set_user_footsteps(id1)
    
set_user_godmode(id1)
    
    
// message
    
client_print(idprint_chat"You are a spectator now!")
    
    return 
PLUGIN_HANDLED

This would do it?

EDIT: Next time post this at suggestions/requests
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 05-14-2012 at 15:59.
Bilal Pro is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-15-2012 , 06:35   Re: [EDIT] Team Changer
Reply With Quote #5

Hi, Bilal Pro! i have tested you plugin. when i type /spec i become invisible, and after i choose a team (for example terrorist) i start to play but still stay invisible. also when i'm spectator i'm walking and can pick up weapons then i can kill every player. also i'm walkin but not flying, can you fix all this bugs and make a spectator to fly not walk. thanks
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-15-2012 , 07:33   Re: [EDIT] Team Changer
Reply With Quote #6

Quote:
Originally Posted by TRUE RED View Post
Hi, Bilal Pro! i have tested you plugin. when i type /spec i become invisible, and after i choose a team (for example terrorist) i start to play but still stay invisible. also when i'm spectator i'm walking and can pick up weapons then i can kill every player. also i'm walkin but not flying, can you fix all this bugs and make a spectator to fly not walk. thanks
lol ...........
EpicMonkey is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-15-2012 , 07:39   Re: [EDIT] Team Changer
Reply With Quote #7

Quote:
Originally Posted by EpicMonkey
lol ...........
well, thank you for help...
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-15-2012 , 07:58   Re: [EDIT] Team Changer
Reply With Quote #8

You didnt ask for it either. second making it
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 05-15-2012 at 07:58.
Bilal Pro is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-15-2012 , 08:01   Re: [EDIT] Team Changer
Reply With Quote #9

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Invisible spectator"
#define VERSION "1.0"
#define AUTHOR "Bilal"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Hamspawn"1)
    
    
register_clcmd("say /spec""CmdSpec")
}

public 
Hamspawn(id)
{
    if (
is_user_alive(id))
    {
        if (!(
get_user_team(id) == 3))
        {
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha500)
        }
    }
}

public 
CmdSpec(id)
{
    if (!(
is_user_alive(id)))
    {
        
client_print(idprint_chat"You have to be alive to use this command!")
        return 
PLUGIN_HANDLED
    
}
    if (
get_user_team(id) == 3)
    {
        
client_print(idprint_chat"You are already a spectator!")
        return 
PLUGIN_HANDLED
    
}
    
// switch team
    
cs_set_user_team(idCS_TEAM_SPECTATOR)
    
    
// respawn
    
ExecuteHam(Ham_CS_RoundRespawnid)
    
    
// rendering
    
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0)
    
    
// effetcs
    
strip_user_weapons(id)
    
set_user_footsteps(id1)
    
set_user_godmode(id1)
    
    
// message
    
client_print(idprint_chat"You are a spectator now!")
    
    return 
PLUGIN_HANDLED

__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-15-2012 , 08:13   Re: [EDIT] Team Changer
Reply With Quote #10

look
Attached Thumbnails
Click image for larger version

Name:	2012-05-15_15h11_22.png
Views:	195
Size:	94.9 KB
ID:	103670   Click image for larger version

Name:	2012-05-15_15h11_47.png
Views:	100
Size:	17.7 KB
ID:	103671  
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Reply


Thread Tools
Display Modes

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