Im trying to learn how to use jass and i fail. Im trying to make a command to give gold bonuses like in the vamps map red types bonus and gets +500 gold type of thing.
globals
trigger gg_trg_Gold=CreateTrigger()
endglobals
function Trig_Gold_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( S2I(SubStringBJ(GetEventPlayerChatString(), 7, StringLength(GetEventPlayerChatString()))), GetLocalPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction
function InitTrig_Gold takes nothing returns nothing
set gg_trg_Gold = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Gold, GetLocalPlayer(), "-bonus", false )
call TriggerAddAction( gg_trg_Gold, function Trig_Gold_Actions )
endfunction
function main takes nothing returns nothing
call InitTrig_Gold( )
Can someone tell me what im doing wrong
Moderator: Cheaters
-
- Newcomer
- Posts: 2
- Joined: January 7th, 2009, 9:09 pm
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: Can someone tell me what im doing wrong
Here take it. -bonus give player RED 500 gold
Code: Select all
//globals
trigger ggtrg_Gold=CreateTrigger()
//endglobals
function TrigGold_Actions takes nothing returns nothing
call AdjustPlayerStateBJ(500,Player(0),PLAYER_STATE_RESOURCE_GOLD)
endfunction
function I7itTrig_Gold takes nothing returns nothing
set ggtrg_Gold=CreateTrigger()
call TriggerRegisterPlayerChatEvent(ggtrg_Gold,Player(0),"-bonus",true)
call TriggerAddAction(ggtrg_Gold,function TrigGold_Actions )
endfunction
//function main takes nothing returns nothing
call I7itTrig_Gold()
-
- Newcomer
- Posts: 2
- Joined: January 7th, 2009, 9:09 pm
Re: Can someone tell me what im doing wrong
Thanks for the help.To change the player who gets the gold i just change the 0 in this?
function TrigGold_Actions takes nothing returns nothing
call AdjustPlayerStateBJ(500,Player(0),PLAYER_STATE_RESOURCE_GOLD)
endfunction
function TrigGold_Actions takes nothing returns nothing
call AdjustPlayerStateBJ(500,Player(0),PLAYER_STATE_RESOURCE_GOLD)
endfunction
-
- The Flying Cow!
- Posts: 2196
- Joined: November 2nd, 2007, 10:34 pm
- Location: Melbourne
Re: Can someone tell me what im doing wrong
Yes.judgeroughneck wrote:Thanks for the help.To change the player who gets the gold i just change the 0 in this?
function TrigGold_Actions takes nothing returns nothing
call AdjustPlayerStateBJ(500,Player(0),PLAYER_STATE_RESOURCE_GOLD)
endfunction
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
AutoCP3 now available for free!