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

Custom Commands?

Status
Not open for further replies.
Level 1
Joined
Feb 4, 2010
Messages
5
I recently started to create wacraft III maps, thanks to Defiants ORPG. I would like to know how to do those custom commands. For example if you were to type in something like this:

-ban#

and it would ban that person. Please help?
 
Level 9
Joined
Nov 4, 2007
Messages
931
Use the Event:
  • Events
    • Player - Player 1 (Red) types a chat message containing -ban as A substring
for the Actions to check the # of the player you wanted banned after typing in -ban you would have to count the characters used in the word, spaced and the - as well and determine at which point in the string, in this case we determine that -ban # will ultimately use up 6 characters, the first being the - and the 6th being the #, and attempt to have it kick (declare defeat) for the # of the Player that the command was issued to:
  • Actions
    • Game - Defeat (Player((Integer((Substring((Entered chat string), 6, 6)))))) with the message: BANNED!
Explanation: The reason we use the Substring of the Entered chat string 6,6 is because the length of our string is 6 characters long, -ban #, and the 6,6 will only count that final character which is the # of the player used in the ban command and would make Player(#) kicked, if we used something other than 6,6 say 2,4 then it would return Player(ban) the second character to the fourth characters. With this setup whenever Player 1 would type -ban #, lets say for now you banned player eight the game would read: Entered Chat String = -ban 8; counting only the 6th character to the 6th character (6,6) which will return 8, which will return the number into the Player Number, Player(8) and give that player a Defeat screen reading BANNED! Wow that was a lot to type.
 
Status
Not open for further replies.
Top