I need an init trig

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

qwertz111
Senior Member
Posts: 113
Joined: March 1st, 2007, 8:22 pm

I need an init trig

Post by qwertz111 »

and to combine these into one
like a test trigger
and need it so only a certain name can use

Code: Select all

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))))
User avatar
haxorico
Super Moderator
Posts: 3190
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND

Re: I need an init trig

Post by haxorico »

im not so good at JASS im just a beginner and im learning.
but i do know how to make an init trigger.

Code: Select all

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: Select all

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: Select all


(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: Select all

(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: Select all

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

Code: Select all

(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: Select all

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

Code: Select all

(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: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
qwertz111
Senior Member
Posts: 113
Joined: March 1st, 2007, 8:22 pm

Re: I need an init trig

Post by qwertz111 »

o i took it from another function but i need sumthin over that one too