HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simple Gold Giving System

03-19-2004, 02:00 AM#1
fugly
yes i know that stuff is easy compared to all the other stuff in this forum, but hey this will save you some time, its a simple give money system activated by -give[player number] [amount of gold]

Its only 1 trigger for all players in the game and requires only 1 integer-array variable.
It only supports upto 9 players and 3 digits worth of gold
the plus that i see i my trigger is that a definate amount of intergers is not required, so no having to put 0's in the front.
-give2 127
-give2 12
-give2 1

all work. enjoy and comment. Here is the code
Code:
money trade
    Events
        Player - Player 1 (Red) types a chat message containing -give as A substring
        Player - Player 2 (Blue) types a chat message containing -give as A substring
        Player - Player 3 (Teal) types a chat message containing -give as A substring
        Player - Player 4 (Purple) types a chat message containing -give as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 10, 10)) Equal to <Empty String>
                (Substring((Entered chat string), 9, 9)) Not equal to <Empty String>
                (Substring((Entered chat string), 8, 8)) Not equal to <Empty String>
            Then - Actions
                Set goldXfer[1] = (10 x (Integer((Substring((Entered chat string), 8, 8)))))
                Set goldXfer[2] = (Integer((Substring((Entered chat string), 9, 9))))
                Set goldXfer[4] = (goldXfer[1] + goldXfer[2])
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 10, 10)) Not equal to <Empty String>
                (Substring((Entered chat string), 9, 9)) Not equal to <Empty String>
                (Substring((Entered chat string), 8, 8)) Not equal to <Empty String>
            Then - Actions
                Set goldXfer[1] = (100 x (Integer((Substring((Entered chat string), 8, 8)))))
                Set goldXfer[2] = (10 x (Integer((Substring((Entered chat string), 9, 9)))))
                Set goldXfer[3] = (Integer((Substring((Entered chat string), 10, 10))))
                Set goldXfer[4] = (goldXfer[1] + (goldXfer[2] + goldXfer[3]))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                goldXfer[4] Equal to 0
            Then - Actions
                Set goldXfer[4] = (Integer((Substring((Entered chat string), 8, 8))))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                goldXfer[4] Less than or equal to ((Triggering player) Current gold)
            Then - Actions
                Player - Add goldXfer[4] to (Player((Integer((Substring((Entered chat string), 6, 6)))))) Current gold
                Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - goldXfer[4])
                Game - Display to (All players) the text: ((PlayerNwC[(Player number of (Triggering player))] +  |c00ff8040gave|r ) + (PlayerNwC[(Integer((Substring((Entered chat string), 6, 6))))] + (( |c00ff8040 + (String(goldXfer[4]))) +  gold|r. |c0000ff00There is now a 2 second cooldown in effect for gold tradi
                Set goldXfer[4] = 0
            Else - Actions
                Do nothing
                Game - Display to (All players) the text: (Sorry  + (PlayerNwC[(Player number of (Triggering player))] + , but you do not have enough gold to give.))
the attachment has the map with the trigger.
05-02-2004, 11:10 AM#2
Impdestroyer
in the trigger comment part you said what all the variables were except goldxfer. Can u please tell me wether it is an interger or an array
05-16-2004, 11:09 AM#3
fugly
goldxfer is both an integer and an array