• 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.

[Trigger] Chat Money System

Status
Not open for further replies.
Level 3
Joined
Mar 31, 2011
Messages
42
I am searching the trigger of the chat money system like

-gg blue 10000

i searched the whole site and i cant finded it.So can you give me that trigger?

Thanks

:psmile:
 
Level 3
Joined
May 15, 2012
Messages
61
Should it respect the food income rate?

Is it just a money transfer from one player to another or should it be like a cheat (the money comes from noone)?
 
Level 3
Joined
May 15, 2012
Messages
61
Like this, food income is ignored. I apologize if some of the triggers' words look strange - i had to translate because i use the german version of WE.

Usage: -gg <player_color> <gold_amount>
Example: -gg blue 400


arrPlayerColors: string array[12]
GoldAmount: Integer
grpGoldReceiver Player group
grpGoldSender Player group
ReceivingPlayer Player
strGoldAmount String
strTargetColor String



  • GiveMoney
    • Events
      • Player - Player 1 (Red) types a chat message containing -gg as Part-of-the-string
    • Conditions
    • Actions
      • -------- Extract player and gold amount from string --------
      • Set strTargetColor = <empty String>
      • For each (Integer A) from 5 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-conditions
              • (Substring((Entered chat string), (Integer A), (Integer A))) Equal <one space>
            • 'THEN'-Actions
              • Set strTargetColor = (Substring((Entered chat string), 5, ((Integer A) - 1)))
              • Set strGoldAmount = (Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string))))
            • 'ELSE'-Actions
      • Set GoldAmount = (Integer(strGoldAmount))
      • Set grpGoldSender = (Player group((Triggering player)))
      • -------- Validate number --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • GoldAmount Less Than 0
        • 'THEN'-Actions
          • Game - Display to grpGoldSender the text: Please enter a positive number for the amount of gold
        • 'ELSE'-Actions
          • -------- Find receiving player --------
          • Set ReceivingPlayer = Neutral hostile
          • For each (Integer A) from 1 to (Number of players), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • arrPlayerColors[(Integer A)] Equal strTargetColor
                • 'THEN'-Actions
                  • Set ReceivingPlayer = (Player((Integer A)))
                • 'ELSE'-Actions
          • Set grpGoldReceiver = grpGoldReceiver
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • ReceivingPlayer Equal (Triggering player)
            • 'THEN'-Actions
              • Spiel - Display to grpGoldSender the text: You cannot send gold to yourself.
            • 'ELSE'-Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • ReceivingPlayer Equal Neutral Hostile
                • 'THEN'-Actions
                  • Game - Display to grpGoldSender the text: (I dont know " + strTargetColor + ")
                • 'ELSE'-Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • ((Triggering player) Current Gold) Less Than GoldAmount
                    • 'THEN'-Actions
                      • Game - Display to grpGoldSender the text: You do not have enough gold.
                    • 'ELSE'-Actions
                      • Player - Set (Triggering player) Current Gold to (((Triggering player) Current Gold) - GoldAmount)
                      • Player - Set ReceivingPlayer Current Gold to ((ReceivingPlayer Current Gold) + GoldAmount)
                      • Game - Display to grpGoldReceiver the text: (You have received + ((String(GoldAmount)) + ( gold from + (Name of (Triggering player)))))
                      • Game - Display to grpGoldSender the text: (You have sent + ((String(GoldAmount)) + ( gold to + (Name of ReceivingPlayer))))
          • Custom script: call DestroyForce( udg_grpGoldReceiver )
      • Custom script: call DestroyForce( udg_grpGoldSender )

  • InitializePlayerColorArray
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set arrPlayerColors[1] = red
      • Set arrPlayerColors[2] = blue
      • Set arrPlayerColors[3] = teal
      • Set arrPlayerColors[4] = purple
      • Set arrPlayerColors[5] = yellow
      • Set arrPlayerColors[6] = orange
      • Set arrPlayerColors[7] = green
      • Set arrPlayerColors[8] = pink
      • Set arrPlayerColors[9] = gray
      • Set arrPlayerColors[10] = dunnothiscolor1
      • Set arrPlayerColors[11] = dunnothiscolor2
      • Set arrPlayerColors[12] = brown
 
Status
Not open for further replies.
Top