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

cs_set_user_team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-24-2011 , 06:09   cs_set_user_team
Reply With Quote #1

Does not work properly
Do I have wrong?

Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
	register_plugin("PLUGIN", "VERSION", "AUTHOR")

	register_clcmd("/ct", "set_user_counterterrorist")
	register_clcmd("say /ct", "set_user_counterterrorist")
	register_clcmd("/t", "set_user_terrorist")
	register_clcmd("say /t", "set_user_terrorist")
	register_clcmd("/sp", "set_user_spectator")
	register_clcmd("say /sp", "set_user_spectator")
}

public set_user_counterterrorist(id)
{
	cs_set_user_team(id, CS_TEAM_CT)
}

public set_user_terrorist(id)
{
	cs_set_user_team(id, CS_TEAM_T)
}

public set_user_spectator(id)
{
	cs_set_user_team(id, CS_TEAM_SPECTATOR)
}
RuRuRu612754 is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-24-2011 , 06:21   Re: cs_set_user_team
Reply With Quote #2

Try this

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
    
register_clcmd("/ct""CT")
    
register_clcmd("say /ct""CT")
    
register_clcmd("/t""TR")
    
register_clcmd("say /t""TR")
    
register_clcmd("/sp""SPEC")
    
register_clcmd("say /sp""SPEC")
}

public 
CT(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        return 
PLUGIN_HANDLED
    
}
    
    
cs_set_user_team(idCS_TEAM_CT)
    return 
PLUGIN_HANDLED
}

public 
TR(id)
{
    
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        return 
PLUGIN_HANDLED
    
}
    
    
cs_set_user_team(idCS_TEAM_T)
    return 
PLUGIN_HANDLED
}

public 
SPEC(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
    {
        return 
PLUGIN_HANDLED
    
}
    
    
cs_set_user_team(idCS_TEAM_SPECTATOR)
    return 
PLUGIN_HANDLED
    

__________________
kramesa is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-24-2011 , 21:21   Re: cs_set_user_team
Reply With Quote #3

I solved the problem

Thanks to kramesa
RuRuRu612754 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 15:54.


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