AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What is the amx command to swap teams (https://forums.alliedmods.net/showthread.php?t=17532)

bart1313 09-03-2005 14:01

What is the amx command to swap teams
 
What is the amx command to make people swap teams?

pdoubleopdawg 09-03-2005 14:01

http://www.amxmodx.org/funcwiki.php?go=func&id=200

EDIT: Oops, this was in 'scripting' help. I thought you meant the function. My bad, it probably won't help. Wrong forum!

bart1313 09-03-2005 14:15

lol yeah wrong topic i just noticed it after i posted it.

pdoubleopdawg 09-03-2005 14:24

That's alright, sadly there arn't any default commands for this. There are many plugins that do this though, so you're in luck.

I found this one in a minute of searching.
http://forums.alliedmods.net/showthread.php?t=17526

bart1313 09-03-2005 14:27

Yahooo thx man

v3x 09-03-2005 14:42

amx_swap ;)

Use it to easily change the player's team.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN      "AMX Swap" #define VERSION     "0.2" #define AUTHOR      "v3x" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR);     register_clcmd("amx_swap","ClCmd_DoSwap",ADMIN_SLAY,"<nick,#userid>"); } public ClCmd_DoSwap(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2))         return PLUGIN_HANDLED;     new szArg[33];     read_argv(1,szArg,32);     new iPlayer = cmd_target(id,szArg,3);     if(!is_user_connected(iPlayer))         return PLUGIN_HANDLED;     new CsTeams:iTeam = cs_get_user_team(iPlayer);     switch( iTeam )     {         case CS_TEAM_CT: cs_set_user_team(iPlayer,CS_TEAM_T);         case CS_TEAM_T: cs_set_user_team(iPlayer,CS_TEAM_CT);     }     new szAdmin[33],szPlayer[33];     get_user_name(id,szAdmin,32);     get_user_name(iPlayer,szPlayer,32);     switch( get_cvar_num("amx_show_activity") )     {         case 2: client_print(0,print_chat,"ADMIN %s: Swap %s",szAdmin,szPlayer);         case 1: client_print(0,print_chat,"ADMIN: Swap %s",szPlayer);     }     log_amx("ADMIN %s used amx_swap on %s",szAdmin,szPlayer);     return PLUGIN_HANDLED; }

Hawk552 09-03-2005 16:57

Code:
case 1: client_print(0,print_chat,"ADMIN: Swap %s",szPlayer);

v3x 09-03-2005 23:33

Woops, fixed :D

Can anybody test it? ;o

Riddick51 09-04-2005 16:48

with other solutions, you have to be running the: #include <cstrike>

what i like about switch_teams.sma is that it only requires: #include <amxmodx>

it doesn't always work on the first attempt, but if you wait another round or two, scroll up on your con and re-enter the command, it will usually take the second time around. nice if you like to keep your server running trim.

Note: be sure to use #include <amxmodX> instead of the <amxmod>

v3x 09-04-2005 19:56

Well, anyone know if my version works?


All times are GMT -4. The time now is 14:31.

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