1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  5. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Do you have good ideas for new contests? If so, please open new threads in the Contest Submission sub-forum to discuss them.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Gold and / or Lumber Banking System v 1.0.0.6

Submitted by deathismyfriend
This bundle is marked as approved. It works and satisfies the submission rules.
This is a system for banking Gold and / or Lumber.
This system is GUI friendly. It is jass for the main code ( which u dont need to learn) It is GUI for all the config with very little custom scripts to use the whole system.
You can withdraw / deposit all or some gold / lumber with commands.
You can check your lumber or gold with a simple command.
All commands are easy to change. Just change the string in the config trigger and there you go.
You can give a single player or all players interest for the money in the players bank.

It is fully configurable with easy to use instructions in the config triggers.

Gold Banking Config Trigger
  • GoldBankingSystemConfig
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- To withdraw or deposit certain amounts type in the desired chat like -wgold then the number u want to deposit or withdraw. Example -wgold 1000 will withdraw 1000 gold from the bank. --------
      • -------- --------
      • -------- --------
      • -------- This is for the withdraw string. Currently it is set to -wgold --------
      • Set withdrawGoldString = -wgold
      • -------- --------
      • -------- --------
      • -------- This is for the withdraw all string. This withdraws all of the gold in ur bank. Currently it is set to -wagold --------
      • Set withdrawAllGoldString = -wagold
      • -------- --------
      • -------- --------
      • -------- This is for the deposit string. Currently it is set to -dgold --------
      • Set depositGoldString = -dgold
      • -------- --------
      • -------- --------
      • -------- This is for the deposit all string. This deposits all of the current gold you have. Currently it is set to -dagold --------
      • Set depositAllGoldString = -dagold
      • -------- --------
      • -------- --------
      • -------- This is for the check string. This checks the amount of gold you have in the bank. Currently it is set to -checkgold --------
      • Set checkBankGoldString = -checkgold
      • -------- --------
      • -------- --------
      • -------- This variable allows you to stop a player from withdrawing from their bank. To do this set the index for the player number and set the variable to false. example index 1 is for player 1 red --------
      • Set withdrawGoldBoolPlayer[1] = True
      • -------- --------
      • -------- --------
      • -------- This variable allows you to stop a player from depositing from their bank. To do this set the index for the player number and set the variable to false. example index 1 is for player 1 red --------
      • Set depositGoldBoolPlayer[1] = True
      • Set depositGoldBoolPlayer[1] = True
      • -------- --------
      • -------- --------
      • -------- This function allows you to display to a player their gold in the bank. I have the check chat message for the player to use but if you want to display it for a specific player at any given time use this. --------
      • -------- function CheckGoldBankSinglePlayer takes player pl returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call CheckGoldBankSinglePlayer( udg_tempPlayer) --------
      • -------- As you can see i put tempPlayer variable in there. just put the player you want to show this to into the tempPlayer variable. --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to display every players bank gold with a simple value. --------
      • -------- function DisplayGoldBankStatusAll takes nothing returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call DisplayGoldBankStatusAll() --------
      • -------- It will then display to each player their own bank value. --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to increase a certain players bank value based on a percent value. --------
      • -------- function GoldBankInterestIncSinglePlayer takes player pl, real r returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call GoldBankInterestIncSinglePlayer( udg_tempPlayer, udg_tempReal) --------
      • -------- it will then increase a single players bank value based on the real value you put in. this is based on a percentage value so 20% is .20 --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to increase all players bank value based on a percent value. --------
      • -------- function GoldBankInterestIncAll takes real r returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- GoldBankInterestIncAll( udg_tempReal) --------
      • -------- it will then increase all players bank value based on the real value you put in. this is based on a percentage value so 20% is .20 --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to store a certain amount of gold from the player. --------
      • -------- function GoldBankForcedBanking takes player P, integer amount returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- GoldBankForcedBanking( player, amount) --------
      • -------- It will automatically remove the gold from the player and store it in there bank. There is not a check to see if that player has the amount of gold that is being added so be careful using this. --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- Delete everything after this point after posting into your map --------
      • Set checkGoldBankSystemInt = 0
      • Set depositGoldAllBankSystemInt = 0
      • Set depositGoldBankSystemInt = 0
      • Set withdrawGoldAllBankSystemInt = 0
      • Set withdrawGoldBankSystemInt = 0
      • Set goldBankGold[1] = 0


Gold Banking System Code
Code (vJASS):
    // Gold Banking System version 1.0.0.6
    // by deathismyfriend
   
    function GoldBankForcedBuying takes player P, integer amount returns boolean
        local integer p = GetPlayerId( P)
        local integer i
        if udg_goldBankGold[ p] >= amount then
            set udg_goldBankGold[ p] = udg_goldBankGold[ p] - amount
            return true
        elseif udg_goldBankGold[ p] + GetPlayerState( P, PLAYER_STATE_RESOURCE_GOLD) >= amount then
            set i = amount - udg_goldBankGold[ p]
            set udg_goldBankGold[ p] = 0
            call SetPlayerState( P, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState( P, PLAYER_STATE_RESOURCE_GOLD) - i)
            return true
        endif
        return false
    endfunction
   
    function GoldBankForcedBanking takes player P, integer amount returns nothing
        local integer p = GetPlayerId( P)
        call SetPlayerState( P, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState( P, PLAYER_STATE_RESOURCE_GOLD) - amount)
        set udg_goldBankGold[ p] = udg_goldBankGold[ p] + amount
    endfunction

    function CheckGoldBankSinglePlayer takes player pl returns nothing
        local integer p = GetPlayerId( pl)
        call DisplayTextToPlayer( Player( p), 0 , 0, "You have " + I2S( udg_goldBankGold[ p]) + " gold in your bank")
    endfunction
   
    function DisplayGoldBankStatusAll takes nothing returns nothing
        local integer L = 0
        loop
            exitwhen L > 11
            call CheckGoldBankSinglePlayer( Player( L))
            set L = L + 1
        endloop
    endfunction
   
    function GoldBankInterestIncSinglePlayer takes player pl, real r returns nothing
        local integer p = GetPlayerId( pl)
        set r = r + 1.00
        set udg_goldBankGold[ p] = R2I( udg_goldBankGold[ p] * r)
    endfunction
   
    function GoldBankInterestIncAll takes real r returns nothing
        local integer L = 0
        loop
            exitwhen L > 11
            call GoldBankInterestIncSinglePlayer( Player( L), r)
            set L = L + 1
        endloop
    endfunction
   
    function GoldBankingSystemWithdraw takes nothing returns boolean
        local string entered = GetEventPlayerChatString()
        local string sub1 = SubString( entered, 0, udg_withdrawGoldBankSystemInt)
        local string sub2 = SubString( entered, 0, udg_withdrawGoldAllBankSystemInt)
        local integer p = GetPlayerId( GetTriggerPlayer())
        local integer gold
        local playerstate psrg = PLAYER_STATE_RESOURCE_GOLD
        local player pl = Player( p)
       
        if udg_withdrawGoldBoolPlayer[ p + 1] then
            if sub1 == udg_withdrawGoldString then
                set gold = S2I( SubString( entered, udg_depositGoldBankSystemInt, StringLength( entered)))
                if udg_goldBankGold[ p] > gold then
                    call SetPlayerState( pl, psrg, GetPlayerState( pl, psrg) + gold)
                    set udg_goldBankGold[ p] = udg_goldBankGold[ p] - gold
                else
                    set gold = udg_goldBankGold[ p]
                    call SetPlayerState( pl, psrg, GetPlayerState( pl, psrg) + gold)
                    set udg_goldBankGold[ p] = 0
                endif
            elseif sub2 == udg_withdrawAllGoldString then
                call SetPlayerState( pl, psrg, GetPlayerState( pl, psrg) + udg_goldBankGold[ p])
                set udg_goldBankGold[ p] = 0
            endif
        endif
       
        call CheckGoldBankSinglePlayer( pl)
        set pl = null
        set psrg = null
        return false
    endfunction

    function GoldBankingSystemDeposit takes nothing returns boolean
        local string entered = GetEventPlayerChatString()
        local string sub1 = SubString( entered, 0, udg_depositGoldBankSystemInt)
        local string sub2 = SubString( entered, 0, udg_depositGoldAllBankSystemInt)
        local integer p = GetPlayerId( GetTriggerPlayer())
        local integer gold
        local playerstate psrg = PLAYER_STATE_RESOURCE_GOLD
        local integer i
        local player pl = Player( p)  
       
        if udg_depositGoldBoolPlayer[ p + 1] then
            if sub1 == udg_depositGoldString then
                set gold = S2I( SubString( entered, udg_depositGoldBankSystemInt, StringLength( entered)))
                set i = GetPlayerState( pl, psrg)
                if gold > i then
                    call SetPlayerState( pl, psrg, 0)
                    set udg_goldBankGold[ p] = udg_goldBankGold[ p] + i
                else
                    call SetPlayerState( pl, psrg, i - gold)
                    set udg_goldBankGold[ p] = udg_goldBankGold[ p] + gold
                endif
            elseif sub2 == udg_depositAllGoldString then
                set i = GetPlayerState( pl, psrg)
                call SetPlayerState( pl, psrg, 0)
                set udg_goldBankGold[ p] = udg_goldBankGold[ p] + i
            endif
        endif
           
        call CheckGoldBankSinglePlayer( pl)
        set pl = null
        set psrg = null
        return false
    endfunction
   
    function GoldBankingSystemCheck takes nothing returns boolean
        if SubString( GetEventPlayerChatString(), 0, udg_checkGoldBankSystemInt) == udg_checkBankGoldString then
            call CheckGoldBankSinglePlayer( GetTriggerPlayer())
        endif
       
        return false
    endfunction

    function GoldBankingSystemSetup takes nothing returns nothing
        local trigger t1 = CreateTrigger()
        local trigger t2 = CreateTrigger()
        local trigger t3 = CreateTrigger()
        local integer L = 0
        local player P
        loop
            exitwhen L > 11
            set P = Player( L)
            // Check if the player is playing and if that player is a user so this will only register the actual players.
            if GetPlayerSlotState( P) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController( P) == MAP_CONTROL_USER then
                call TriggerRegisterPlayerChatEvent( t1, P, udg_withdrawGoldString, false)
                call TriggerRegisterPlayerChatEvent( t1, P, udg_withdrawAllGoldString, false)
                call TriggerRegisterPlayerChatEvent( t2, P, udg_depositGoldString, false)
                call TriggerRegisterPlayerChatEvent( t2, P, udg_depositAllGoldString, false)
                call TriggerRegisterPlayerChatEvent( t3, P, udg_checkBankGoldString, false)
            endif
            set L = L + 1
        endloop
        set udg_withdrawGoldBankSystemInt = StringLength( udg_withdrawGoldString)
        set udg_withdrawGoldAllBankSystemInt = StringLength( udg_withdrawAllGoldString)
        set udg_depositGoldBankSystemInt = StringLength( udg_depositGoldString)
        set udg_depositGoldAllBankSystemInt = StringLength( udg_depositAllGoldString)
        set udg_checkGoldBankSystemInt = StringLength( udg_checkBankGoldString)
        call TriggerAddCondition( t1, Condition( function GoldBankingSystemWithdraw))
        call TriggerAddCondition( t2, Condition( function GoldBankingSystemDeposit))
        call TriggerAddCondition( t3, Condition( function GoldBankingSystemCheck))
        call DestroyTimer( GetExpiredTimer())
        set P = null
        set t1 = null
        set t2 = null
        set t3 = null
    endfunction

    //===========================================================================
    function InitTrig_GoldBankingSystemCode takes nothing returns nothing
        call TimerStart( CreateTimer(), 0.00, false, function GoldBankingSystemSetup)
    endfunction


Lumber Banking System Config Trigger
  • LumberBankingSystemConfig
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- To withdraw or deposit certain amounts type in the desired chat like -wlumber then the number u want to deposit or withdraw. Example -wlumber 1000 will withdraw 1000 lumber from the bank. --------
      • -------- --------
      • -------- --------
      • -------- This is for the withdraw string. Currently it is set to -wlumber --------
      • Set withdrawLumberString = -wlumber
      • -------- --------
      • -------- --------
      • -------- This is for the withdraw all string. This withdraws all of the lumber in ur bank. Currently it is set to -walumber --------
      • Set withdrawAllLumberString = -walumber
      • -------- --------
      • -------- --------
      • -------- This is for the deposit string. Currently it is set to -dlumber --------
      • Set depositLumberString = -dlumber
      • -------- --------
      • -------- --------
      • -------- This is for the deposit all string. This deposits all of the current lumber you have. Currently it is set to -dalumber --------
      • Set depositAllLumberString = -dalumber
      • -------- --------
      • -------- --------
      • -------- This is for the check string. This checks the amount of lumber you have in the bank. Currently it is set to -checklumber --------
      • Set checkBankLumberString = -checklumber
      • -------- --------
      • -------- --------
      • -------- This variable allows you to stop a player from withdrawing from their bank. To do this set the index for the player number and set the variable to false. example index 1 is for player 1 red --------
      • Set withdrawLumberBoolPlayer[1] = True
      • -------- --------
      • -------- --------
      • -------- This variable allows you to stop a player from depositing from their bank. To do this set the index for the player number and set the variable to false. example index 1 is for player 1 red --------
      • Set depositLumberBoolPlayer[1] = True
      • -------- --------
      • -------- --------
      • -------- This function allows you to display to a player their lumber in the bank. I have the check chat message for the player to use but if you want to display it for a specific player at any given time use this. --------
      • -------- function CheckLumberBankSinglePlayer takes player pl returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call CheckLumberBankSinglePlayer( udg_tempPlayer) --------
      • -------- As you can see i put tempPlayer variable in there. just put the player you want to show this to into the tempPlayer variable. --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to display every players bank lumber with a simple value. --------
      • -------- function DisplayLumberBankStatusAll takes nothing returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call DisplayLumberBankStatusAll() --------
      • -------- It will then display to each player their own bank value. --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to increase a certain players bank value based on a percent value. --------
      • -------- function LumberBankInterestIncSinglePlayer takes player pl, real r returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call LumberBankInterestIncSinglePlayer( udg_tempPlayer, udg_tempReal) --------
      • -------- it will then increase a single players bank value based on the real value you put in. this is based on a percentage value so 20% is .20 --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to increase all players bank value based on a percent value. --------
      • -------- function LumberBankInterestIncAll takes real r returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call LumberBankInterestIncAll( udg_tempReal) --------
      • -------- it will then increase all players bank value based on the real value you put in. this is based on a percentage value so 20% is .20 --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- This function allows you to store a certain amount of lumber from the player. --------
      • -------- function LumberBankForcedBanking takes player P, integer amount returns nothing --------
      • -------- To use this function you use custom script: and do this. --------
      • -------- call LumberBankForcedBanking( player, amount) --------
      • -------- It will automatically remove the lumber from the player and store it in there bank. There is not a check to see if that player has the amount of lumber that is being added so be careful using this. --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- Delete everything after this point after posting into your map --------
      • Set checkLumberBankSystemInt = 0
      • Set depositLumberAllBankSystemInt = 0
      • Set depositLumberBankSystemInt = 0
      • Set withdrawLumberAllBankSystemInt = 0
      • Set withdrawLumberBankSystemInt = 0
      • Set lumberBankLumber[1] = 0


Lumber Banking System Code
Code (vJASS):
    // Lumber Banking System version 1.0.0.6
    // by deathismyfriend
   
    function LumberBankForcedBuying takes player P, integer amount returns boolean
        local integer p = GetPlayerId( P)
        local integer i
        if udg_lumberBankLumber[ p] >= amount then
            set udg_lumberBankLumber[ p] = udg_lumberBankLumber[ p] - amount
            return true
        elseif udg_lumberBankLumber[ p] + GetPlayerState( P, PLAYER_STATE_RESOURCE_LUMBER) >= amount then
            set i = amount - udg_lumberBankLumber[ p]
            set udg_lumberBankLumber[ p] = 0
            call SetPlayerState( P, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState( P, PLAYER_STATE_RESOURCE_LUMBER) - i)
            return true
        endif
        return false
    endfunction
   
    function LumberBankForcedBanking takes player P, integer amount returns nothing
        local integer p = GetPlayerId( P)
        call SetPlayerState( P, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState( P, PLAYER_STATE_RESOURCE_LUMBER) - amount)
        set udg_lumberBankLumber[ p] = udg_lumberBankLumber[ p] + amount
    endfunction

    function CheckLumberBankSinglePlayer takes player pl returns nothing
        local integer p = GetPlayerId( pl)
        call DisplayTextToPlayer( Player( p), 0 , 0, "You have " + I2S( udg_lumberBankLumber[ p]) + " lumber in your bank")
    endfunction
   
    function DisplayLumberBankStatusAll takes nothing returns nothing
        local integer L = 0
        loop
            exitwhen L > 11
            call CheckLumberBankSinglePlayer( Player( L))
            set L = L + 1
        endloop
    endfunction
   
    function LumberBankInterestIncSinglePlayer takes player pl, real r returns nothing
        local integer p = GetPlayerId( pl)
        set r = r + 1.00
        set udg_lumberBankLumber[ p] = R2I( udg_lumberBankLumber[ p] * r)
    endfunction
   
    function LumberBankInterestIncAll takes real r returns nothing
        local integer L = 0
        loop
            exitwhen L > 11
            call LumberBankInterestIncSinglePlayer( Player( L), r)
            set L = L + 1
        endloop
    endfunction
   
    function LumberBankingSystemWithdraw takes nothing returns boolean
        local string entered = GetEventPlayerChatString()
        local string sub1 = SubString( entered, 0, udg_withdrawLumberBankSystemInt)
        local string sub2 = SubString( entered, 0, udg_withdrawLumberAllBankSystemInt)
        local integer p = GetPlayerId( GetTriggerPlayer())
        local integer lumber
        local playerstate psrl = PLAYER_STATE_RESOURCE_LUMBER
        local player pl = Player( p)
       
        if udg_withdrawLumberBoolPlayer[ p + 1] then
            if sub1 == udg_withdrawLumberString then
                set lumber = S2I( SubString( entered, udg_depositLumberBankSystemInt, StringLength( entered)))
                if udg_lumberBankLumber[ p] > lumber then
                    call SetPlayerState( pl, psrl, GetPlayerState( pl, psrl) + lumber)
                    set udg_lumberBankLumber[ p] = udg_lumberBankLumber[ p] - lumber
                else
                    set lumber = udg_lumberBankLumber[ p]
                    call SetPlayerState( pl, psrl, GetPlayerState( pl, psrl) + lumber)
                    set udg_lumberBankLumber[ p] = 0
                endif
            elseif sub2 == udg_withdrawAllLumberString then
                call SetPlayerState( pl, psrl, GetPlayerState( pl, psrl) + udg_lumberBankLumber[ p])
                set udg_lumberBankLumber[ p] = 0
            endif
        endif
       
        call CheckLumberBankSinglePlayer( pl)
        set pl = null
        set psrl = null
        return false
    endfunction

    function LumberBankingSystemDeposit takes nothing returns boolean
        local string entered = GetEventPlayerChatString()
        local string sub1 = SubString( entered, 0, udg_depositLumberBankSystemInt)
        local string sub2 = SubString( entered, 0, udg_depositLumberAllBankSystemInt)
        local integer p = GetPlayerId( GetTriggerPlayer())
        local integer lumber
        local playerstate psrl = PLAYER_STATE_RESOURCE_LUMBER
        local integer i
        local player pl = Player( p)
       
        if udg_depositLumberBoolPlayer[ p + 1] then
            if sub1 == udg_depositLumberString then
                set lumber = S2I( SubString( entered, udg_depositLumberBankSystemInt, StringLength( entered)))
                set i = GetPlayerState( pl, psrl)
                if lumber > i then
                    call SetPlayerState( pl, psrl, 0)
                    set udg_lumberBankLumber[ p] = udg_lumberBankLumber[ p] + i
                else
                    call SetPlayerState( pl, psrl, i - lumber)
                    set udg_lumberBankLumber[ p] = udg_lumberBankLumber[ p] + lumber
                endif
            elseif sub2 == udg_depositAllLumberString then
                set i = GetPlayerState( pl, psrl)
                call SetPlayerState( pl, psrl, 0)
                set udg_lumberBankLumber[ p] = udg_lumberBankLumber[ p] + i
            endif
        endif
           
        call CheckLumberBankSinglePlayer( pl)
        set pl = null
        set psrl = null
        return false
    endfunction
   
    function LumberBankingSystemCheck takes nothing returns boolean
        if SubString( GetEventPlayerChatString(), 0, udg_checkLumberBankSystemInt) == udg_checkBankLumberString then
            call CheckLumberBankSinglePlayer( GetTriggerPlayer())
        endif
       
        return false
    endfunction

    function LumberBankingSystemSetup takes nothing returns nothing
        local trigger t1 = CreateTrigger()
        local trigger t2 = CreateTrigger()
        local trigger t3 = CreateTrigger()
        local integer L = 0
        local player P
        loop
            exitwhen L > 11
            set P = Player( L)
            // Check if the player is playing and if that player is a user so this will only register the actual players.
            if GetPlayerSlotState( P) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController( P) == MAP_CONTROL_USER then
                call TriggerRegisterPlayerChatEvent( t1, P, udg_withdrawLumberString, false)
                call TriggerRegisterPlayerChatEvent( t1, P, udg_withdrawAllLumberString, false)
                call TriggerRegisterPlayerChatEvent( t2, P, udg_depositLumberString, false)
                call TriggerRegisterPlayerChatEvent( t2, P, udg_depositAllLumberString, false)
                call TriggerRegisterPlayerChatEvent( t3, P, udg_checkBankLumberString, false)
            endif
            set L = L + 1
        endloop
        set udg_withdrawLumberBankSystemInt = StringLength( udg_withdrawLumberString)
        set udg_withdrawLumberAllBankSystemInt = StringLength( udg_withdrawAllLumberString)
        set udg_depositLumberBankSystemInt = StringLength( udg_depositLumberString)
        set udg_depositLumberAllBankSystemInt = StringLength( udg_depositAllLumberString)
        set udg_checkLumberBankSystemInt = StringLength( udg_checkBankLumberString)
        call TriggerAddCondition( t1, Condition( function LumberBankingSystemWithdraw))
        call TriggerAddCondition( t2, Condition( function LumberBankingSystemDeposit))
        call TriggerAddCondition( t3, Condition( function LumberBankingSystemCheck))
        call DestroyTimer( GetExpiredTimer())
        set P = null
        set t1 = null
        set t2 = null
        set t3 = null
    endfunction
   
    //===========================================================================
    function InitTrig_LumberBankingSystemCode takes nothing returns nothing
        call TimerStart( CreateTimer(), 0.00, false, function LumberBankingSystemSetup)
    endfunction


Changelog

version 1.0.0.6
Added a function to allow users to remove a certain amount of gold for that players bank.
This returns a boolean. True means the player has the required resource.
This can be used if you want items that require gold / lumber over the cap.
Thanks for the idea Nes ​
version 1.0.0.5
Added a function that will allow users to force bank a players gold ​
version 1.0.0.4
fixed the things suggested by purge. ​
version 1.0.0.3
fixed a bug were anyone without JNGP couldnt use this.
This can now be used by everyone ​
version 1.0.0.2
fixed a small bug​
version 1.0.0.1
fixed a few small errors​
version 1.0.0.0
first version released​


Keywords:
gold, gold banking, gold bank, gold bank system, gold banking system, lumber, lumber banking, lumber bank, lumber banking system, lumber bank system,
Contents

Just another Warcraft III map (Map)

Reviews
Moderator
18:27, 19th Aug 2013 PurgeandFire: Changes made, approved.
  1. 18:27, 19th Aug 2013
    PurgeandFire: Changes made, approved.
     
  2. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,941
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    I suggest you use different string for gold and lumber.
     
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,719
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    I see a few flaws.

    1. combine the triggers
    2. you got the same string for lumber it will clash
    3. I want to check the trigger not read a book, pput it in a info trigger
    and how do you select how much you want to withdraw?
     
  4. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    1) what do u mean combine triggers ?
    2) what do u mean the same string ? oops i forgot to change them lol
    3) its preset to -withdraw . so u type in -wthdraw200 or - withdraw 200. that will withdraw 200 from bank.

    edit: updated with fixes except number 1.
     
    Last edited: Jul 25, 2013
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,719
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    1. you got 2 init triggers
     
  6. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    thats because these are 2 independent systems. if someone wants one they dont need the other.
     
  7. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,941
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    Is this MUI?
     
  8. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    its MPI. its a banking system.

    I could make an MUI banking system but I never saw a point in one
     
    Last edited: Jul 26, 2013
  9. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Could you use demo code or a demo trigger as the screenshot if an in-game screenshot can't be pulled off?
     
  10. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    ill c what i can do for the screenshot.
     
  11. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    updated: fixed a small bug in the file were the wrong amount was added to the bank.

    will upload pic after work.
     
  12. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    fixed a bug.

    This can now be used by everyone.
     
  13. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,428
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Overall it is a neat idea. :thumbs_up:

    Review:
    • In the init:
      Code (vJASS):
          function InitTrig_GoldBankingSystemCode takes nothing returns nothing
              local timer tmr = CreateTimer()
              call TimerStart( tmr, 0.00, false, function GoldBankingSystemSetup)
              set tmr = null
          endfunction

      You can simplify it to:
      call TimerStart(CreateTimer(), 0.00, false, function GoldBankingSystemSetup)
    • In "GoldBankingSystemSetup", you can just use:
      call DestroyTimer(GetExpiredTimer())

      Instead of assigning it to a local, destroying it, then nulling the local.
    • Only register chat events for players who are playing. ;)
    • Why did you save:
      PLAYER_STATE_RESOURCE_GOLD
      ?
      Okay, I see that you might've wanted to use it for a shorter name. Instead you may just want to assign an integer to GetPlayerState(p1, PLAYER_STATE_RESOURCE_GOLD) and use that.
    • For this line:
      set udg_goldBankGold[ p] = R2I( I2R( udg_goldBankGold[ p]) * r)

      You should be able to just have:
      set udg_goldBankGold[ p] = R2I( udg_goldBankGold[ p] * r)

      When you multiply an integer by a real, it will return a real, so you don't need to typecast it.
    • Same things for the lumber system.
    • Bug: In the test map, I type -dlumber and it deposits my gold. It also will withdraw my gold when I type -wlumber. It should be withdrawing/depositing my lumber, but it doesn't.
    • Suggestions: You might want to add a check to see if the script starts with the command before applying the effect. Why? A lot of people ask each other what the commands are. If someone types:
      "hey nub, type -wgold ### to withdraw your gold from your bank"
      It'll show the person's gold because it detects the -wgold part of the string. I'm not saying it will bug out--your system handles it nicely and will only display the gold they have in their bank--it won't actually do anything if they type an invalid message (which is good). This is just an optional suggestion.

    Other than that, nice job with the system. Fix those and it will be approvable!
     
  14. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    I will do that. For some reason i didn't think about doing that lol.


    will do

    I did that to make it shorter yes. It makes it easier to read. Also if i set an integer to getplayerstate then when i use set player state i can't use the shorter variable. I'd rather leave that that way. Also i do store get player state to an integer already.

    changed that. Thanks

    That was my mistake. Fixed that

    There is a string that allows players to check the gold / lumber in their bank if they want. Is that what you mean ?

    Thanks changes have been made hope to see this approved soon.
     
  15. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,428
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    I just meant that if someone types "-wgold" anywhere in their chat message, it will show their deposit. It isn't that bad since your system checks if they put in a valid number, but someone can say something like this:
    "test test test -wgold test test test"
    And it will show the gold number. This isn't a big issue though.
     
  16. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    ooo i see what you mean. Thanks for the approval purge.
     
  17. CfWolfy

    CfWolfy

    Joined:
    Aug 7, 2013
    Messages:
    108
    Resources:
    0
    Resources:
    0
    idk about triggers much but....this is cool instanted to write Greedisgood 999999......5/5 :D
     
  18. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    thanks for the rating. Glad it helped you.