• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

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
933
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