AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Is it possible to change the names of teams? (https://forums.alliedmods.net/showthread.php?t=56062)

Pro Patria Finland 06-05-2007 18:34

Is it possible to change the names of teams?
 
I've searched and searched, and can't find the solution.

Is it possible to change the CS team names? I mean, when the game starts and you choose a team, you would choose either "Terrorist" or "Counter-Terrorist," but would it be possible to choose "Pros" and "Noobs" for example?

I am going to bed, I hope somebody can help me. :)

regalis 06-05-2007 18:45

Re: Is it possible to change the names of teams?
 
I think there is no chance doin that..
Because the Teamnames are specified in the HLSDK...
But maybe there is a workaround !? *hmm*

greetz regalis (sleep well ;) )

Orangutanz 06-05-2007 18:50

Re: Is it possible to change the names of teams?
 
That is possible but only with Old Style Menus (White Text).
You cannot change the scoreboard team names, that is configured clientside I believe.

Pro Patria Finland 06-06-2007 07:42

Re: Is it possible to change the names of teams?
 
Quote:

Originally Posted by Orangutanz (Post 486105)
That is possible but only with Old Style Menus (White Text).
You cannot change the scoreboard team names, that is configured clientside I believe.

Well, I know how to block the VGUI menu, but care to explain how it's possible to change the team names?

VEN 06-06-2007 12:14

Re: Is it possible to change the names of teams?
 
He meant that you have to code your own menu to replace the original one.

Pro Patria Finland 06-06-2007 16:53

Re: Is it possible to change the names of teams?
 
Ahh, ok, I see.

Pro Patria Finland 06-06-2007 19:18

Re: Is it possible to change the names of teams?
 
I hope someone reads this thread...

Soo, anyhows, this is what I did:

Code:
public client_connect(id) {                       //Disables the VGUI menus, since they for some     set_user_info(id, "_vgui_menus", "0")//reason can't be blocked...? } public blockteams(id) {     show_menu(id, 0, "work", 1, "#Team_Select_Spect")   //Here we block the Team selection     set_task(1.0,"showmenu",id);                //menu and go to my new menu } public showmenu(id) {   //My cool menu, copied almost fully from Emp`'s menu tutorial :D        cs_set_user_team (id, CsTeams:CS_TEAM_SPECTATOR)    //Tried this for fixing the problem, won't work     new menu = menu_create("\rChoose team:", "menu_handler")     menu_additem(menu, "\wThe Freeman Team", "1", 0)        //First option, "Terrorist team"     menu_additem(menu, "\wThe Government Team", "2", 0) //Second option "CT team"     menu_additem(menu, "\wSpectator", "3", 0)       //Third option Spectator     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)     menu_display(id, menu, 0) } public menu_handler(id, menu, item) {   //Still copied from Emp`'s tutorial...     if (item == MENU_EXIT) {         menu_destroy(menu)         return PLUGIN_HANDLED     }         new data[6], iName[64]     new access, callback     menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)     new key = str_to_num(data)     switch(key) {                 case 1:{             cs_set_user_team (id, CsTeams:CS_TEAM_T, CS_T_LEET) //Here I set the player team             menu_destroy(menu)                  //to terrorist             return PLUGIN_HANDLED         }         case 2:{                     cs_set_user_team (id, CsTeams:CS_TEAM_CT, CS_CT_SAS)    //Same for CT...             menu_destroy(menu)             return PLUGIN_HANDLED         }         case 3:{             cs_set_user_team (id, CsTeams:CS_TEAM_SPECTATOR)    //..and for SPEC             menu_destroy(menu)             return PLUGIN_HANDLED         }     }     menu_destroy(menu)     return PLUGIN_HANDLED  }

So basically it works. It block the old teamchooser menu, and starts the new one. And it sets the clients team to the desired one too. But otherwise it doesn't function. With the last code, the player doesn't spawn until the next round (I also tried this making the player spawn right away with the spawn command). Either way, it still doesn't work:

-The player spawns
-There's nothing on the HUD, only players money
-The player can't move from where he spawned

So basically, you can't do anything. Seems as though I need to make CS understand that I've joined the game. Any suggestions on how to do that? I've tried making the client spectator first in various places in the code, but it refuses to work. :(

Orangutanz 06-06-2007 20:53

Re: Is it possible to change the names of teams?
 
You have to completely maniplate the original CS menu, ie not force spawning clients.

Code:
new team = get_user_team(id) switch (key) {     case 0: /* Team 1 */     {         if (team != 1)         {             engclient_cmd(id, "jointeam", "1")             engclient_cmd(id, "menuselect", "5")         }     }     case 1: /* Team 2 */     {         if (team != 2)         {             engclient_cmd(id, "jointeam", "2")             engclient_cmd(id, "menuselect", "5")         }     }     /* Random Team */     case 4: menu_handler(id, menu, random_num(0, 1))     /* Spectator */     case 5: engclient_cmd(id, "jointeam", "6") } show_menu(id, 0, " ", 0)

Greenberet 06-07-2007 04:48

Re: Is it possible to change the names of teams?
 
and dont forget to hook the TeamInfo msg. without it you would still see Terrorists/Counter Terrorists in the ScoreInfo sheet


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

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