wc3edit.net

United Warcraft 3 map hacking!
It is currently March 29th, 2024, 4:04 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: June 5th, 2013, 7:02 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Can anyone help me to find the way to make TriggerRegisterTimerEventPeriodic can be use with GetTriggerPlayer ?
Edit: One more thing, help me make a trigger or jass, when I type "-clear" it's will be clear text messages every seconds ( for triggerplayer ), and I type "-clearoff" it's will be normal again. ( for triggerplayer ).
Thanks you.


Top
 Profile  
 
PostPosted: June 6th, 2013, 7:20 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
I can give a code when I get home..
Can you post the natives in here? So ill see what parameters are needed for each native.
Also. Keep in mind that the cleae command will not work for the chat.

_________________
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  
 
PostPosted: June 6th, 2013, 7:35 am 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Ok here my code
Spoiler:
globals
integer array udg_Check
trigger gg_trg_Untitled_Trigger_002 = null
trigger gg_trg_Untitled_Trigger_003 = null
trigger gg_trg_Untitled_Trigger_004 = null
endglobals
function Trig_Untitled_Trigger_002_Conditions takes nothing returns boolean
if ( not ( udg_Check[GetConvertedPlayerId(GetTriggerPlayer())] == 1 ) ) then
return false
endif
return true
endfunction

function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
call ClearTextMessagesBJ( GetForceOfPlayer(ConvertedPlayer(udg_Check[GetConvertedPlayerId(GetTriggerPlayer())])) )
endfunction

function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
set gg_trg_Untitled_Trigger_002 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Untitled_Trigger_002, 1.00 )
call TriggerAddCondition( gg_trg_Untitled_Trigger_002, Condition( function Trig_Untitled_Trigger_002_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction

function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
set udg_Check[GetConvertedPlayerId(GetTriggerPlayer())] = 1
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_003 takes nothing returns nothing
local integer zzz
set gg_trg_Untitled_Trigger_003 = CreateTrigger( )
set zzz=0
loop
exitwhen zzz>11
call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(zzz), "-clear", true )
set zzz=zzz+1
endloop
call TriggerAddAction( gg_trg_Untitled_Trigger_003, function Trig_Untitled_Trigger_003_Actions )
endfunction

function Trig_Untitled_Trigger_004_Actions takes nothing returns nothing
set udg_Check[GetConvertedPlayerId(GetTriggerPlayer())] = 0
endfunction

function InitTrig_Untitled_Trigger_004 takes nothing returns nothing
local integer zzz
set gg_trg_Untitled_Trigger_004 = CreateTrigger( )
set zzz=0
loop
exitwhen zzz>11
call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_004, Player(zzz), "-clearoff", true )
set zzz=zzz+1
endloop
call TriggerAddAction( gg_trg_Untitled_Trigger_004, function Trig_Untitled_Trigger_004_Actions )
endfunction

function main takes nothing returns nothing
call InitTrig_Untitled_Trigger_002( )
call InitTrig_Untitled_Trigger_003( )
call InitTrig_Untitled_Trigger_004( )
endfunction

I don't know why it's don't work , I'm already tried if GetLocalPlayer()==GetTriggerPlayer() but still not work, so I make this code, but only work for player red, other players can't use.


Last edited by zUsername on June 6th, 2013, 5:38 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: June 6th, 2013, 9:07 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Those aren't the natives. But I found them on my own.
Ill reply with a code but it will take some time as I code it own my mobile.

_________________
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  
 
PostPosted: June 6th, 2013, 2:00 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Ok I'm waiting for you. thanks .


Top
 Profile  
 
PostPosted: June 6th, 2013, 5:14 pm 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
change call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(0), "-clear", true ) become call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(zzz), "-clear", true )


Top
 Profile  
 
PostPosted: June 6th, 2013, 5:39 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
KangTooJee wrote:
change call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(0), "-clear", true ) become call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(zzz), "-clear", true )

still not work Kang. Only work for red player. The other not work.


Top
 Profile  
 
PostPosted: June 8th, 2013, 12:37 am 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2010, 1:48 pm
Posts: 238
Location: In The World
EDIT: Remove...it not work

_________________
Image


Last edited by Fukki on June 8th, 2013, 12:15 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: June 8th, 2013, 10:23 am 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Thanks Fukki, but ur code not work. When I type -clear or clearoff nothing happen.


Top
 Profile  
 
PostPosted: June 8th, 2013, 12:07 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2010, 1:48 pm
Posts: 238
Location: In The World
write in 3 minute ...
this code has been tested

Code:
globals
hashtable HASH_MessagesClear=InitHashtable()
real AutoMessagesClear_Timer=1.
endglobals

function GetTimer_MessagesClear takes integer Clear_Int1 returns timer
local timer Clear_Timer=CreateTimer()
local integer Clear_Int2=GetHandleId(Clear_Timer)
call SaveInteger(HASH_MessagesClear,0,Clear_Int2,Clear_Int1)
call SaveBoolean(HASH_MessagesClear,0,Clear_Int1,true)
return Clear_Timer
endfunction

function Auto_ClearMessages takes nothing returns nothing
local timer Clear_Timer=GetExpiredTimer()
local integer Clear_Int1=GetHandleId(Clear_Timer)
local integer Clear_Int2=LoadInteger(HASH_MessagesClear,0,Clear_Int1)
if LoadBoolean(HASH_MessagesClear,0,Clear_Int2)then
if GetLocalPlayer()==Player(Clear_Int2)then
call ClearTextMessages()
endif
else
call DestroyTimer(Clear_Timer)
endif
set Clear_Timer=null
set Clear_Int1=0
set Clear_Int2=0
endfunction

function MessagesClear_Enable takes nothing returns nothing
local player Clear_Player=GetTriggerPlayer()
local integer Clear_Int1=GetPlayerId(Clear_Player)
if not LoadBoolean(HASH_MessagesClear,0,Clear_Int1)then
call TimerStart(GetTimer_MessagesClear(Clear_Int1),AutoMessagesClear_Timer,true,function Auto_ClearMessages)
endif
set Clear_Player=null
set Clear_Int1=0
endfunction

function MessagesClear_Disable takes nothing returns nothing
local player Clear_Player=GetTriggerPlayer()
local integer Clear_Int1=GetPlayerId(Clear_Player)
call SaveBoolean(HASH_MessagesClear,0,Clear_Int1,false)
set Clear_Player=null
set Clear_Int1=0
endfunction

function AutoClearMessages_Install takes nothing returns nothing
local trigger Clear_Trigger1=CreateTrigger()
local trigger Clear_Trigger2=CreateTrigger()
local integer Loop_Player=0
call TriggerAddAction(Clear_Trigger1,function MessagesClear_Enable)
call TriggerAddAction(Clear_Trigger2,function MessagesClear_Disable)
loop
call TriggerRegisterPlayerChatEvent(Clear_Trigger1,Player(Loop_Player),"-clear",true)
call TriggerRegisterPlayerChatEvent(Clear_Trigger2,Player(Loop_Player),"-clearoff",true)
exitwhen Loop_Player>10
set Loop_Player=Loop_Player+1
endloop
endfunction

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 21 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)