• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] player name change

Status
Not open for further replies.
Level 3
Joined
Aug 14, 2006
Messages
29
Hey!

guys/girls, how do i make a trigger that will be like

event: player 1 (red) is typing a chat msg equal to setname (string)

conditions: [no conditions]

action: set name of player 1 (red) to (string)

is this possible, if yes how to?

*cheers* zero
 
Level 8
Joined
Feb 4, 2007
Messages
389
I'm pretty sure you just answered your own question.

You use substings. "Set Player Name = ((Substring) entered chat string) 7, 22)"

You start the substring at 7 because generally you have the command "-name (Desired Name)," thus, the 7th letter is where you want to start. 22 is just a random number, you can set it to whatever. (I suggest less than 17, because it's not too long.)

Other than that, it should be pretty obvious.
 
Level 11
Joined
Jul 12, 2005
Messages
764
the action is under 'Player'. - > Set Player Name

substring is a part of a string... the two numbers mean the place of the first caracter of the substring, the second is the end.

Take the example "paskovich" :p
Substring("paskovich", 3, 7) == "skovi"
Ouch, are the numbers correct? I was always messing with them when working with substrings... :S
 
Level 3
Joined
Aug 14, 2006
Messages
29
so i will add a command like:

event: play chat msg - -setname (substring 3, 7)

action: player - set name (substring 3, 7)


but what im supposed to type instead of substring?
 
Level 2
Joined
Dec 16, 2006
Messages
12
you might want to use the 6th string depending on what you're having them type


ex:

6, 20

-name I-Like-Bannana-Pie-With-Pudding

it will change your name to this

I-Like-Bannana-Pie-W

and like..

7, 20

it will change it to

-Like-Bannana-Pie-Wi

and

6, 400

I-Like-Bannana-Pie-With-Pudding

and

0, 400

-name I-Like-Bannana-Pie-With-Pudding

it will make the name have the -name in it.


I hope this helps ya.
 
Level 3
Joined
Aug 14, 2006
Messages
29
this is nice guys, however i have the following "config"

event: player 1 types a msg containing -setname as a substring.

condition: (substring (((entered chat string) 1, 8)) equal to-setname

action: setname of player 1 to (substring (-setname, 8, 40))

when i type -setname(no matter what here) my name is = e..

how to slove this guys?
 
Level 10
Joined
Jan 21, 2007
Messages
576
Holy shit are you serous lol. You can do
Player - Player 1 (Red) types a chat message containing setname as A substring
Instead of
Player - Player 1 (Red) types a chat message containing setname as A Exact Match
Wow damn i need to pay more attention to the blue text, this would have saved me hourse of triggering ><
 
Status
Not open for further replies.
Top