Jump to content

Script : switch name/team toggle (7 nickname cicle) switch team axis or allies ( medic default weapon)


Recommended Posts

Posted

// =========================================================
// Script generated by LadyKaka77, supported by AI
// FUNCTION: Team Switch (Axis/Allies) & Nickname Color Cycle (7 States)
// NICKNAME: Uses generic "ETPlayer" to prevent conflicts/bans.
// =========================================================

// --- 1. NICKNAME COLOR VSTRS (7-STATE CYCLE) ---
// Note: 'ETPlayer' is used as the base name for universal compatibility.

set n_1 "seta name ^cET^fPlayer^3; set n_next vstr n_2; echo ^7[NICK] ^1STYLE 1 LOADED"
set n_2 "seta name ^aET^5Player^a; set n_next vstr n_3; echo ^7[NICK] ^1STYLE 2 LOADED"
set n_3 "seta name ^dL^wPlayer^d; set n_next vstr n_4; echo ^7[NICK] ^1STYLE 3 LOADED"
set n_4 "seta name ^gET^hPlayer^2; set n_next vstr n_5; echo ^7[NICK] ^1STYLE 4 LOADED"
set n_5 "seta name ^jET^7Player^b; set n_next vstr n_6; echo ^7[NICK] ^1STYLE 5 LOADED"
set n_6 "seta name ^8ET^4Player^3; set n_next vstr n_7; echo ^7[NICK] ^1STYLE 6 LOADED"
set n_7 "seta name ^kET^lPlayer^k; set n_next vstr n_1; echo ^7[NICK] ^1STYLE 7 LOADED"


// --- 2. INITIALIZATION AND TEAM SELECTOR LOGIC ---

// Set initial state to Name 1 and execute it on CFG load.
set n_next "vstr n_1"
vstr n_next

// AXIS SCRIPT: Cycles nickname, spawns in Axis, sets toggle to Allies.
set Axis "vstr n_next; team r 1 3 38; say_team ^1Spawn Axis; play sound/menu/select.wav; set AxisAllies vstr Allies"

// ALLIES SCRIPT: Cycles nickname, spawns in Allies, sets toggle to Axis.
set Allies "vstr n_next; team b 1 8 37; say_team ^1Spawn Allies; play sound/menu/select.wav; set AxisAllies vstr Axis"

// Sets the initial team toggle action to Axis.
set AxisAllies "vstr Axis"

// BIND F8: Executes the Team/Name switch cycle.
bind F8 "vstr AxisAllies"

Posted
On 11/4/2025 at 6:52 PM, Lorenzo Battistutta said:

// =========================================================
// Script generated by LadyKaka77, supported by AI

omg

  • Haha 1
  • 1 month later...
Posted

The Name change could prolly kick you since you have to go through each name till the one you want. I remember I had one where I run through list with one key but only used the one I wanted then with another key so I avoided too many name changes 

 

 

  • Haha 1
Posted

This is a very weird script 😄

Since you have only 1 bind, every toggle also triggers a select, instead of separating the two. What's the consequence?

 

When you freshly load your cfg, vstr AxisAllies is set to Axis, meaning that you can only join Axis with this button. If you want to join Allies you either need to do it manually or press F8 twice.\

 

Then you have the part of the names. Every time you press F8 you cycle to the next name, however you also switch teams. Therefore this doesn't work if you want to switch names while staying in the same team 🤔

Very interested to know for what you're using this hehe

  • Haha 1
Posted (edited)
18 hours ago, Dest!Ny said:

This is a very weird script 😄

 

yeah, this is the most cursed AI-generated script i've ever seen lol

---

im going to try to fix the script so it works properly using just one bind.
the principle is: hold down the key, select nickname/team you need, release the key.
 

while holding F8 (or any other key of your choice), if you scroll the mouse wheel up, you can choose a nickname — and when you release the key, the selected nickname replaces the old one that you used. this way you can avoid repeatedly changing your nickname like in oldschool "vstr" scripts, where nicknames sets one after another (which isnt recommended for most servers, like, FA silent mod servers, where there's a limit of 3 nickname changes per round).

the same goes for choosing your team, except you scroll the mouse wheel down.
---
 

bind F8 "+vstr nameteam_script1 nameteam_script2"
 

seta nameteam_script1 "bind mwheelup vstr name0; bind mwheeldown vstr team0"
seta nameteam_script2 "vstr sc0"

// here you can replace the binds with the ones you have on the mouse wheels.
seta reset_mwheelupdown "bind mwheelup weapnext; bind mwheeldown weapprev" 
 

seta name0 "vstr name1"
seta team0 "vstr team1"
 

seta name1 "echo ^7/name ^1ETPlayer; set name0 vstr name2; set sc0 vstr scname1"
seta name2 "echo ^7/name ^2ETPlayer; set name0 vstr name3; set sc0 vstr scname2"
seta name3 "echo ^7/name ^3ETPlayer; set name0 vstr name4; set sc0 vstr scname3"
seta name4 "echo ^7/name ^4ETPlayer; set name0 vstr name5; set sc0 vstr scname4"
seta name5 "echo ^7/name ^5ETPlayer; set name0 vstr name6; set sc0 vstr scname5"
seta name6 "echo ^7/name ^6ETPlayer; set name0 vstr name7; set sc0 vstr scname6"
seta name7 "echo ^7/name ^7ETPlayer; set name0 vstr name8; set sc0 vstr scname7"
seta name8 "echo ^7/name ^8ETPlayer; set name0 vstr name9; set sc0 vstr scname8"
seta name9 "echo ^7/name ^9ETPlayer; set name0 vstr name1; set sc0 vstr scname9"
 

seta scname1 "name ^1ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname2 "name ^2ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname3 "name ^3ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname4 "name ^4ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname5 "name ^5ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname6 "name ^6ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname7 "name ^7ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname8 "name ^8ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scname9 "name ^9ETPlayer; vstr reset_mwheelupdown; set sc0 vstr sc00"
 

seta team1 "echo ^1Axis ^7team; set team0 vstr team2; set sc0 vstr scteam1"
seta team2 "echo ^4Allies ^7team; set team0 vstr team3; set sc0 vstr scteam2"
seta team3 "echo ^zSpectator; set team0 vstr team1; set sc0 vstr scteam3"
 

seta scteam1 "team r; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scteam2 "team b; vstr reset_mwheelupdown; set sc0 vstr sc00"
seta scteam3 "team s; vstr reset_mwheelupdown; set sc0 vstr sc00"

// you can add another one bind here, which can be activated by pressing F8 once

seta sc00 ""

 

 

 

nameteam_script.cfg

Edited by DIM
fixed script
  • Like 1
  • 100 1
Posted
19 hours ago, Dest!Ny said:

This is a very weird script 😄

Since you have only 1 bind, every toggle also triggers a select, instead of separating the two. What's the consequence?

 

When you freshly load your cfg, vstr AxisAllies is set to Axis, meaning that you can only join Axis with this button. If you want to join Allies you either need to do it manually or press F8 twice.\

 

Then you have the part of the names. Every time you press F8 you cycle to the next name, however you also switch teams. Therefore this doesn't work if you want to switch names while staying in the same team 🤔

Very interested to know for what you're using this hehe

I didn’t even Check the axis allies Part xd 🤣 

Posted (edited)
5 hours ago, DIM said:

 

I really like this script! Excellent use of +vstr. 

 

You got me nerding out so I modified the script a bit to my liking:

 

You can reduce to a single F8 press for both scripts if you use multiple vstr's and you can clean up a lot of repeated commands by pulling the reset into the -vstr. Not to mention that you can also move the "set sc0 vstr sc00" to the -vstr to avoid repeating more text. I also took the liberty of initializing sc0 in case you single press F8 at the start of the session :) Ah, and lastly I added an additional bind to "keep current", in case you don't want to change your name/team anymore.

EDIT: since the scnames and scteams are so simple now, we can simply eliminate them and define them inline to reduce a lot of spaghetti without it looking more clonky

 

bind F8 "+vstr nameteam_script1 nameteam_script2"


seta nameteam_script1 "bind mwheelup vstr name0; bind mwheeldown vstr team0; bind MOUSE3 vstr donothing"
seta nameteam_script2 "vstr sc0; set sc0 vstr sc00; vstr sc1; set sc1 vstr sc00; vstr reset_binds"

 

seta reset_binds "bind mwheelup weapnext; bind mwheeldown weapprev; unbind MOUSE3"

seta name0 "vstr name1"
seta team0 "vstr team1"
seta sc0 "vstr sc00"

seta sc1 "vstr sc00"

 

seta donothing "echo ^1X ^7CANCEL ^1X; set sc0 vstr sc00; set sc1 vstr sc00"

 

seta name1 "echo ^7/name ^1ETPlayer; set name0 vstr name2; set sc0 name ^1ETPlayer"
seta name2 "echo ^7/name ^2ETPlayer; set name0 vstr name3; set sc0 name ^2ETPlayer"
seta name3 "echo ^7/name ^3ETPlayer; set name0 vstr name4; set sc0 name ^3ETPlayer"
seta name4 "echo ^7/name ^4ETPlayer; set name0 vstr name5; set sc0 name ^4ETPlayer"
seta name5 "echo ^7/name ^5ETPlayer; set name0 vstr name6; set sc0 name ^5ETPlayer"
seta name6 "echo ^7/name ^6ETPlayer; set name0 vstr name7; set sc0 name ^6ETPlayer"
seta name7 "echo ^7/name ^7ETPlayer; set name0 vstr name8; set sc0 name ^7ETPlayer"
seta name8 "echo ^7/name ^8ETPlayer; set name0 vstr name9; set sc0 name ^8ETPlayer"
seta name9 "echo ^7/name ^9ETPlayer; set name0 vstr name1; set sc0 name ^9ETPlayer"


seta team1 "echo ^1Axis ^7team; set team0 vstr team2; set sc1 team r"
seta team2 "echo ^4Allies ^7team; set team0 vstr team3; set sc1 team b"
seta team3 "echo ^zSpectator; set team0 vstr team1; set sc1 team s"


seta sc00 ""

Edited by Dest!Ny
There was more nerding to be done.
  • 100 2
Posted (edited)


 

1 hour ago, Dest!Ny said:

I really like this script! Excellent use of +vstr. 

 

You got me nerding out so I modified the script a bit

 

+vstr scripts like that are great for keeping your keyboard clean. one or two keys can control endless binds. happy you found it cool!

 

1 hour ago, Dest!Ny said:

since the scnames and scteams are so simple now, we can simply eliminate them and define them inline to reduce a lot of spaghetti without it looking more clonky

 

i prefer a more visual layout myself, since it's quicker to navigate and edit stuff in real time. my actual config is prettyloaded, so having expanded scripts helps a lot with quick changes

 

Edited by DIM

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.