Raised This Month: $ Target: $400
 0% 

Need help with team change plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 02-07-2005 , 08:04   Need help with team change plugin
Reply With Quote #1

I searched for plugin to change a players team in counter-strike and didnt find one. So i tryed to make one. And i found a command called cs_set_user_team, but i dont really get it to work...I get 4 errors when i try to compile it. Somebody help?
Here is the plugin:
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() { register_plugin("amx_team", "1.0", "XunTric") register_concmd("amx_teamt", "cmdteamt", ADMIN_KICK, "<name or #userid>") register_concmd("amx_teamct", "cmdteamct", ADMIN_KICK, "<name or #userid>") } public cmdteamt(id,level,cid) {     if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,1)     if(!player)          return PLUGIN_HANDLED     new name[64];     get_user_name(player,name,63);     cs_set_user_team(player, CsTeams:CS_TEAM_T, [CsInternalModel:model=CS_T_TERROR])             return PLUGIN_HANDLED } public cmdteamct(id,level,cid) {     if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,1)     if(!player)          return PLUGIN_HANDLED     new name[64];     get_user_name(player,name,63)     cs_set_user_team(player, CsTeams:CS_TEAM_CT, [CsInternalModel:model=CS_CT_SAS])         return PLUGIN_HANDLED }


Tryed to use this too (Example on terrorists change)
Code:
client_cmd(player, "chooseteam") client_cmd(player, "menuselect 1") client_cmd(player, "menuselect 5")

It compiles with that, but it doesnt change team...
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-07-2005 , 17:06  
Reply With Quote #2

Try these:

Code:
cs_set_user_team(player, CS_TEAM_T, CS_T_TERROR) // and cs_set_user_team(player, CS_TEAM_CT, CS_CT_SAS)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 02-08-2005 , 07:09  
Reply With Quote #3

It works!! Thanks alot XxAvalanchexX!
Download it here hehe
XunTric 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 19:17.


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