Raised This Month: $32 Target: $400
 8% 

TFC Team/Class Changer


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Team Fortress Classic        Category:   Admin Commands        Approver:   DS (30)
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-02-2004 , 08:14   TFC Team/Class Changer
Reply With Quote #1

A plugin to change the team/class of players...

Engine Required....

The plugin accepts both text and numbers
Valid values for class&team are as follows
<class> = scout,sniper,soldier,demoman,medic,hwguy,pyro ,spy,engineer,random,civilian
<class> = 1-11
<team> = blue,red,yellow,green
<team> = 1-4

Worked fine back when i made it for AMX... plz post comments how it works with AMXx
Attached Files
File Type: sma Get Plugin or Get Source (tfc_team_class_changer.sma - 2937 views - 5.3 KB)
__________________
My Plugins

Got ??
AssKicR is offline
Waylay
Member
Join Date: Feb 2006
Old 03-12-2006 , 07:50  
Reply With Quote #2

Maybe change team would be good but not class ?
Waylay is offline
Send a message via MSN to Waylay
Shadow1975
New Member
Join Date: Mar 2006
Old 03-22-2006 , 21:50  
Reply With Quote #3

it's bugged when i amx_team someone then stay on the same team and then change color and with the class changeing it's bugged i am a hwguy i use the command amx_class to change me to a spy wheile now i am a spy with a hwguy gun hehehehe odd but true
Shadow1975 is offline
Slash The Mighty
Member
Join Date: May 2006
Location: Vault 13
Old 05-14-2006 , 13:38  
Reply With Quote #4

Quote:
Originally Posted by Waylay
Maybe change team would be good but not class ?
When you have a command for changeing clients team, then it wouldnt make sens not have 1 there can change the model/class.
If someone were sniper on a map where snipers arent allowed (posible with NeoTF), Then the Admin would be able to change it.
But if you couldn't change the class, then you had to kick him.
And some players doesn't kick just becose they use another class then wanted.
Nice job anyway AssKicR !. You got my vote!.
Slash The Mighty is offline
Send a message via AIM to Slash The Mighty Send a message via MSN to Slash The Mighty Send a message via Skype™ to Slash The Mighty
bug
Senior Member
Join Date: Nov 2007
Old 02-13-2008 , 11:04   Re: TFC Team/Class Changer
Reply With Quote #5

Quote:
Originally Posted by AssKicR View Post
A plugin to change the team/class of players...
<team> = blue,red,yellow,green
<team> = 1-4
Can you please add the ability to change a player to team 6 spectate?
bug is offline
terrum
AlliedModders Donor
Join Date: Apr 2006
Location: United Kingdom
Old 09-27-2009 , 17:49   Re: TFC Team/Class Changer
Reply With Quote #6

Quote:
Originally Posted by bug View Post
Can you please add the ability to change a player to team 6 spectate?
This doesn't change their team. It only changes their colour name. But yeah, I want team 6 spectate too. Can this be done? Thanks.
__________________
Thanks,
Terrum.


terrum is offline
Send a message via AIM to terrum Send a message via MSN to terrum Send a message via Skype™ to terrum
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 10-03-2009 , 22:08   Re: TFC Team/Class Changer
Reply With Quote #7

I think this is everything you wanted..

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define PC_SCOUT 1 
#define PC_SNIPER 2 
#define PC_SOLDIER    3 
#define PC_DEMOMAN 4 
#define PC_MEDIC 5 
#define PC_HVYWEAP     6 
#define PC_PYRO 7
#define PC_SPY 8
#define PC_ENGINEER 9
#define PC_RANDOM    10
#define PC_CIVILIAN 11
/****************************************************************************************************/
public plugin_init()
{
    
register_plugin("TFC Team/Class Changer""1.0""AssKicR")
    
register_clcmd("amx_class""admin_class",ADMIN_SLAY,"<nick> <class>")
    
register_clcmd("amx_team""admin_team",ADMIN_SLAY,"<nick> <team>")
    return 
PLUGIN_CONTINUE
}
/****************************************************************************************************/
public admin_class(id,level,cid) { 
    if (!
cmd_access(id,level,cid,2)) return PLUGIN_HANDLED 

    
new arg[32],class[32]
    
read_argv(1,arg,31
    
read_argv(2,class,31

    new 
player cmd_target(id,arg,7
    if (!
player) return PLUGIN_HANDLED 

    
if (equal(class,"scout")) set_user_class(player,PC_SCOUT)
    else if (
equal(class,"sniper")) set_user_class(player,PC_SNIPER)
    else if (
equal(class,"soldier")) set_user_class(player,PC_SOLDIER)
    else if (
equal(class,"demoman")) set_user_class(player,PC_DEMOMAN)
    else if (
equal(class,"medic")) set_user_class(player,PC_MEDIC)
    else if (
equal(class,"hwguy")) set_user_class(player,PC_HVYWEAP)
    else if (
equal(class,"pyro")) set_user_class(player,PC_PYRO)
    else if (
equal(class,"spy")) set_user_class(player,PC_SPY)
    else if (
equal(class,"engineer")) set_user_class(player,PC_ENGINEER)
    else if (
equal(class,"random")) set_user_class(player,PC_RANDOM)
    else if (
equal(class,"civilian")) set_user_class(player,PC_CIVILIAN)
    else if (
str_to_num(class)>0&&str_to_num(class)<12set_user_class(player,str_to_num(class))
    else {
        new 
hcmd[32], hinfo[128], hflag
        get_concmd
(cid,hcmd,31,hflag,hinfo,127,level)
        
console_print(id,"Usage: %s %s",hcmd,hinfo)
        return 
PLUGIN_HANDLED 
    
}
    return 
PLUGIN_HANDLED  

/****************************************************************************************************/
public admin_team(id,level,cid) { 
    if (!
cmd_access(id,level,cid,2)) return PLUGIN_HANDLED 

    
new arg[32],team[32]
    
read_argv(1,arg,31
    
read_argv(2,team,31

    new 
player cmd_target(id,arg,7
    if (!
player) return PLUGIN_HANDLED 

    
if (equal(team,"blue")) set_player_team(player,1)
    else if (
equal(team,"red")) set_player_team(player,2)
    else if (
equal(team,"yellow")) set_player_team(player,3)
    else if (
equal(team,"green")) set_player_team(player,4)
    else if (
equal(team,"random")) set_player_team(player,5)
    else if (
equal(team,"spectate")) set_player_team(player,6)
    else if (
str_to_num(team)>0&&str_to_num(team)<7set_player_team(player,str_to_num(team))
    else {
        new 
hcmd[32], hinfo[128], hflag
        get_concmd
(cid,hcmd,31,hflag,hinfo,127,level)
        
console_print(id,"Usage: %s %s",hcmd,hinfo)
        return 
PLUGIN_HANDLED 
    
}
    return 
PLUGIN_HANDLED  

/****************************************************************************************************/
stock get_user_class(id) {
    new class = 
entity_get_int(idEV_INT_playerclass)
    return class
}
/****************************************************************************************************/
stock set_user_class(id,class) {
    
entity_set_int(idEV_INT_playerclass,class)
    
show_class(id,get_user_class(id))
    return
}
/****************************************************************************************************/
stock get_player_team(id) {
    new 
team entity_get_int(idEV_INT_team)
    return 
team
}
/****************************************************************************************************/
stock set_player_team(id,team) {
    
entity_set_int(idEV_INT_team,team)
    
show_team(id,get_player_team(id))
    return
}
/****************************************************************************************************/
stock show_class(id,class) {
    new 
name[33]
    
get_user_name(id,name,32)
    switch (class) {
        case 
PC_SCOUTclient_print(id,print_console,"%s is now a scout",name)
        case 
PC_SNIPERclient_print(id,print_console,"%s is now a sniper",name)
        case 
PC_SOLDIERclient_print(id,print_console,"%s is now a soldier",name)
        case 
PC_DEMOMANclient_print(id,print_console,"%s is now a demoman",name)
        case 
PC_MEDICclient_print(id,print_console,"%s is now a medic",name)
        case 
PC_HVYWEAPclient_print(id,print_console,"%s is now a hwguy",name)
        case 
PC_PYROclient_print(id,print_console,"%s is now a pyro",name)
        case 
PC_SPYclient_print(id,print_console,"%s is now a spy",name)
        case 
PC_ENGINEERclient_print(id,print_console,"%s is now a engineer",name)
        case 
PC_RANDOMclient_print(id,print_console,"%s is now a random class",name)
        case 
PC_CIVILIANclient_print(id,print_console,"%s is now a civilian",name)
    }
}
/****************************************************************************************************/
stock show_team(id,team) {
    new 
name[33]
    
get_user_name(id,name,32)
    switch (
team) {
        case 
1:    client_print(id,print_console,"%s is now on blue team",name)
        case 
2:    client_print(id,print_console,"%s is now on red team",name)
        case 
3:    client_print(id,print_console,"%s is now on yellow team",name)
        case 
4:    client_print(id,print_console,"%s is now on green team",name)
        case 
5:    client_print(id,print_console"%s is now on a random team",name)
        case 
6:    client_print(id,print_console"%s is now on spectator team",name)
    }
}
/****************************************************************************************************/ 
Attached Files
File Type: sma Get Plugin or Get Source (tfc_team_class_changer.sma - 1369 views - 5.7 KB)
__________________
+|- KARMA Respectively

HLM is offline
Reply


Thread Tools
Display Modes

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:41.


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