Raised This Month: $ Target: $400
 0% 

Help on plugin "Team Change"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
F4RR3LL
Member
Join Date: Jun 2008
Location: Russia :)
Old 04-03-2009 , 11:56   Help on plugin "Team Change"
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>

new PLUGIN[]="Team Change"
new AUTHOR[]="st0ka"
new VERSION[]="1.00"

public plugin_init()
{
       register_plugin(PLUGIN,VERSION,AUTHOR)       
       register_concmd("say /ct","team_ct")
       register_concmd("say_team /ct","team_ct")
       register_concmd("say /spec","team_spec")
       register_concmd("say_team /spec","team_spec")
       register_concmd("say /respawn","player_respawn")
       register_concmd("say_team /respawn","player_respawn")
       set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
}

public team_ct(id)
{
       new CsTeams:team = cs_get_user_team(id)
       if (team == CS_TEAM_CT) 
       {
                return PLUGIN_HANDLED
       }
       else 
       {
            cs_set_user_team(id,CS_TEAM_CT,CS_DONTCHANGE)
            cs_user_spawn(id)
            give_item(id,"weapon_knife")
            give_item(id,"weapon_usp") 
            give_item(id,"weapon_usp") 
            give_item(id,"weapon_usp") 
       }
       return PLUGIN_HANDLED
}

public team_spec(id)
{
       new CsTeams:team = cs_get_user_team(id)
       if (team == CS_TEAM_SPECTATOR) 
       {
                return PLUGIN_HANDLED
       }
       else 
       {
            entity_set_int(id,EV_INT_deadflag,DEAD_DISCARDBODY)
            cs_set_user_team(id,CS_TEAM_SPECTATOR,CS_DONTCHANGE)
       }
       return PLUGIN_HANDLED
}

public player_respawn(id)
{
       new CsTeams:team = cs_get_user_team(id)
       if (team == CS_TEAM_SPECTATOR)
       {
                return PLUGIN_HANDLED
       }
       else if (!is_user_alive(id))
       {
            cs_user_spawn(id)
            give_item(id,"weapon_knife")
            give_item(id,"weapon_usp")
            give_item(id,"weapon_usp")
            give_item(id,"weapon_usp")
       }
       return PLUGIN_HANDLED
}
What do that function team_ct, team_spec was executed when striking the button "M"? Like looks simply, but beside me brain came short

thanks
__________________

F4RR3LL 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 02:27.


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