• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Sending resources with commands

Status
Not open for further replies.
Level 6
Joined
Jan 16, 2017
Messages
107
Hi i have a question how to make working trigger/s that will allow players to send resources with commands?
i want to make it like in troll and elves i know almost everything that i need except taking number that player entered in the message.
 
Level 12
Joined
Dec 11, 2014
Messages
662
  • DonatingResources
    • Events
      • Player - Player 1 (Red) types a chat message containing -gg as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 4)) Equal to -gg
    • Actions
      • Set String[1] = (Substring((Entered chat string), 5, (Length of (Entered chat string))))
      • Set Converted[1] = (Integer(String[1]))
      • -------- no one --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SellectedPlayer[1] Equal to 0
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: select a player to ...
        • Else - Actions
      • -------- Player1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SellectedPlayer[1] Equal to 1
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: you cant send gold ...
        • Else - Actions
      • -------- Player2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SellectedPlayer[1] Equal to 2
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: (you just send + ((String(Converted[1])) + ( gold to + (Name of Player 2 (Blue)))))
          • Player - Add (0 - Converted[1]) to Player 1 (Red) Current gold
          • Player - Add Converted[1] to Player 2 (Blue) Current gold
          • Set Converted[1] = 0
        • Else - Actions
Just add a condition to check if Converted is less than 1 and if the player has enough gold. You can open my map (go to my resources) and check the trigger for sending gold there, it should be exactly what you're looking for with minor differences
 

Attachments

  • asdf1.w3x
    14.5 KB · Views: 34
Last edited:
Status
Not open for further replies.
Top