Custom Commands?

Status
Not open for further replies.

twasik4

T

twasik4

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?
 
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.
Back
Top