AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help with team change plugin (https://forums.alliedmods.net/showthread.php?t=10059)

XunTric 02-07-2005 08:04

Need help with team change plugin
 
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...

XxAvalanchexX 02-07-2005 17:06

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)

XunTric 02-08-2005 07:09

It works!! Thanks alot XxAvalanchexX!
Download it here hehe


All times are GMT -4. The time now is 19:17.

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