Raised This Month: $ Target: $400
 0% 

Help on plugin "Team Change"


Post New Thread Reply   
 
Thread Tools Display Modes
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
F4RR3LL
Member
Join Date: Jun 2008
Location: Russia :)
Old 04-03-2009 , 12:13   Re: Help on plugin "Team Change"
Reply With Quote #2

The Example:
Has Pressed "M", has carried in spec, has pressed once again "M", appeared again for CT.
__________________

F4RR3LL is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-03-2009 , 12:56   Re: Help on plugin "Team Change"
Reply With Quote #3

Check http://forums.alliedmods.net/showthread.php?t=69819
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-03-2009 , 13:09   Re: Help on plugin "Team Change"
Reply With Quote #4

PHP Code:
register_clcmd"chooseteam""cmdChangeTeam" );

public 
cmdChangeTeamid ) {
    if( 
get_user_team(id) == )
        
team_ctid );
    else if( 
get_user_team(id) == )
        
team_specid );
    
    return 
PLUGIN_HANDLED;

__________________
xPaw is offline
F4RR3LL
Member
Join Date: Jun 2008
Location: Russia :)
Old 04-03-2009 , 13:39   Re: Help on plugin "Team Change"
Reply With Quote #5

thaanks
__________________

F4RR3LL 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 07:48.


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