General talk about editing, cheating, and deprotecting maps.
Moderator: Cheaters
-
vosszaa
- Old Wrinkly Member
- Posts: 247
- Joined: March 7th, 2007, 7:04 am
Post
by vosszaa »
trigger gg_trg_Str=null
function Trig_Str_Actions takes nothing returns nothing
call SetHeroStr( GetTriggerUnit(), S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)), true )
endfunction
function InitTrig_Str takes nothing returns nothing
set gg_trg_Str = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(1), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(2), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(3), "-str", true )
call TriggerAddAction( gg_trg_Str, function Trig_Str_Actions )
endfunction
call InitTrig_Str()
i adopted this code from the -gold code(which works fine) but somehow i cant get this to work.
I change the red text into "GetEnumUnit" but still..desnt work
Is there anything to do with the red text..? or my code just wrong..? can somebody correct my code..?
Thx..
The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..
-
Kala-cha
- Forum Addict
- Posts: 405
- Joined: February 17th, 2007, 9:16 pm
Post
by Kala-cha »
It's the red coding, -_-, I don't know how to do JASS but if there's red coding, it's wrong lol.
-
vosszaa
- Old Wrinkly Member
- Posts: 247
- Joined: March 7th, 2007, 7:04 am
Post
by vosszaa »
Kala-cha wrote:It's the red coding, -_-, I don't know how to do JASS but if there's red coding, it's wrong lol.
Its not the red code!! - -'
I just hightlight it when post just to let u know which text im talkn about..
The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..
-
Aero
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Post
by Aero »
Code: Select all
trigger gg_trg_Str=null
function SetStr takes nothing returns nothing
call SetHeroStr(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction
function HerosOnly takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==true)
endfunction
function Trig_Str_Actions takes nothing returns nothing
local group g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,GetTriggerPlayer(),Condition(function HerosOnly))
call ForGroup(g,function SetStr)
call DestroyGroup(g)
set g=null
endfunction
function InitTrig_Str takes nothing returns nothing
set gg_trg_Str = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(1), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(2), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(3), "-str", true )
call TriggerAddAction( gg_trg_Str, function Trig_Str_Actions )
endfunction
call InitTrig_Str()
Last edited by Aero on March 18th, 2007, 10:31 pm, edited 1 time in total.
-
Kala-cha
- Forum Addict
- Posts: 405
- Joined: February 17th, 2007, 9:16 pm
Post
by Kala-cha »
What? lol, I'm just stupid I guess ^_^
-
vosszaa
- Old Wrinkly Member
- Posts: 247
- Joined: March 7th, 2007, 7:04 am
Post
by vosszaa »
Err... I have a problems >_<
I already declare "trigger gg_trg_Str=null"
I already put your codes in function.
I already put "call InitTrig_Str()" under function main
Still doesnt work..>_<
What did i do wrong ??
The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..
-
Aero
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Post
by Aero »
Should be quite alright...
Declare trigger gg_trg_Str=null in globals
Call InitTrig_Str() in function main
All you need to do is put the code in
-
vosszaa
- Old Wrinkly Member
- Posts: 247
- Joined: March 7th, 2007, 7:04 am
Post
by vosszaa »
err.. Nope! still doesnt work.
I did everything correctly in part of declareration and in the part of function main
And for the codes i just copy and paste, nothing changed.
I try put in few different maps like footman, blademaster, hero war EE etc etc
None of them works..
Dont u have a code that more simple than this one(its look complicated to me @_@)? Coz Xantan said its similar to the -gold code.
The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..
-
Aero
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Post
by Aero »
Oh shit here's the problem
"TriggerRegisterPlayerChatEvent"
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", true )
At the end it says true
True means "exact match"
Change it to false and it will work
I guess I should of looked at InitTrig too instead of assuming it was correct
-
vosszaa
- Old Wrinkly Member
- Posts: 247
- Joined: March 7th, 2007, 7:04 am
Post
by vosszaa »
Its working now ^^
Thx
The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..