Can someone tell me what im doing wrong

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

judgeroughneck
Newcomer
Posts: 2
Joined: January 7th, 2009, 9:09 pm

Can someone tell me what im doing wrong

Post by judgeroughneck »

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( )
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Can someone tell me what im doing wrong

Post by initialD »

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()
judgeroughneck
Newcomer
Posts: 2
Joined: January 7th, 2009, 9:09 pm

Re: Can someone tell me what im doing wrong

Post by judgeroughneck »

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
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Can someone tell me what im doing wrong

Post by Ozzapoo »

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
Yes.
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!