• 🏆 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!

[General] -setname command

Status
Not open for further replies.
Here you go

This will shop you how to change name up to 13 letters

  • Events
    • Player - Player 1 (Red) types a chat message containing -setname as A substring
    • Player - Player 2 (Blue) types a chat message containing -setname as A substring
  • Conditions
  • Actions
    • Player - Set name of (Triggering player) to (Substring((Entered chat string), 10, 23))
after setname you have one space xD Tell me if you this cannot understand
 
Level 3
Joined
Apr 18, 2012
Messages
47
Is this what you need?

  • Set Name
    • Events
      • Player - Player 1 (Red) types a chat message containing -setname as A substring
    • Conditions
    • Actions
      • Player - Set name of (Triggering player) to (Substring((Entered chat string), 10, (Length of (Entered chat string))))
And since you said 'teach' not just give, I'll explain some of it.

The Event checks if a player writes -setname anywhere in an Entered Chat String. Then it sets the name of the player to the substring of the Entered Chat String from the 10th letter to the last character. I use the function Length of Entered Chat String to find what out what number is the last letter.

Why do we use a substring starting at the 10th letter? So that we cut out the "-setname" part. If we didn't, a player writing "-setname Shazbot" would have his name changed to "-setname Shazbot" instead of just "Shazbot".

setname.png


Each letter in a substring has an associated number. Above you can see how Shazbot, the actual name we want starts at the 10th letter. That's why the player name must be set to substring from the 10th letter to the last letter (Length of Enter Chat String). And remember you need to add events for other players besides red if you want them to be able to rename themselves!

edit: Sorry, hammerfist, I didn't look before posting, it took me a while to think of a good enough explanation :/
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
That's why the player name must be set to substring from the 10th letter to the last letter (Length of Enter Chat String).
Remember that Warcraft III has its own maximum string for a player name (15 letters) so in this case it should not be Length of Enter Chat String, it should be 10, 24 since 24th letter is the final maximum string (15th max string for a player's name)
 
Level 1
Joined
Apr 28, 2012
Messages
4
Hey :D its me jas.per can you teach me how to crate a setname command??
:vw_wtf::vw_wtf::vw_wtf:
changing player name..

This is how I made it, haven't tested it public yet but think it will work:
  • Set Name 1
    • Events
      • Player - Player 1 (Red) types a chat message containing -name as A substring
    • Conditions
    • Actions
      • Set EnteredString = (Entered chat string)
      • Player - Set name of Player 1 (Red) to (Substring(EnteredString, 7, 100))
      • Trigger - Turn off (This trigger)
Good luck man! :thumbs_up: This is how it works -name Example will trigger the effect and then the entered string between 7 (minus the -name) and 100. (you can have the 100 a bit lower so they can't have a name that has 100 letters xD Sorry for bad english, thats not my primary language.
 
Last edited:
Status
Not open for further replies.
Top