• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] -setname command

Status
Not open for further replies.
Level 16
Joined
Mar 3, 2006
Messages
1,564
changing player name

That can be easily done.

<<< EDIT >>>

Here you are:

Variables:

  • Command (String)
  • CommandLength (Integer)
  • NewName (String)

Triggers:

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- If you ever need to change the command which changes the name you can change the following variable only. --------
      • Set Command = -setname
      • -------- -------- --------
      • Set CommandLength = ((Length of Command) + 2)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Change Name <gen> the event (Player - (Player((Integer A))) types a chat message containing Command as A substring)
  • Change Name
    • Events
    • Conditions
    • Actions
      • Set NewName = (Substring((Entered chat string), CommandLength, (Length of (Entered chat string))))
      • Game - Display to (All players) for 30.00 seconds the text: ((Name of (Triggering player)) + ( has changed his name to + NewName))
      • Player - Set name of (Triggering player) to NewName
      • Set NewName = <Empty String>
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
460
Another method that you could use is part of my vJass Chat System, if say you do not want player's name to actually change. The system also allows you to use custom colors, and various other features, all of which can be changed via the constant booleans. I'm planning on redoing the system so that you can just import the main library, create your own initialization trigger that runs specific sections of the library, but I've been busy lately. I'll be sure to work on it though.
 
Status
Not open for further replies.
Top