[HELP]Make GetTriggerPlayer Work
Moderator: Cheaters
-
- Forum Addict
- Posts: 407
- Joined: February 25th, 2011, 3:16 am
- Location: Unknown
[HELP]Make GetTriggerPlayer Work
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.
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.
-
- Super Moderator
- Posts: 3196
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: [HELP]Make GetTriggerPlayer Work
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.
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.
-
- Forum Addict
- Posts: 407
- Joined: February 25th, 2011, 3:16 am
- Location: Unknown
Re: [HELP]Make GetTriggerPlayer Work
Ok here my code
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.
Spoiler:
Last edited by zUsername on June 6th, 2013, 5:38 pm, edited 1 time in total.
-
- Super Moderator
- Posts: 3196
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: [HELP]Make GetTriggerPlayer Work
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.
Ill reply with a code but it will take some time as I code it own my mobile.
-
- Forum Addict
- Posts: 407
- Joined: February 25th, 2011, 3:16 am
- Location: Unknown
-
- Old Wrinkly Member
- Posts: 202
- Joined: September 15th, 2010, 5:09 am
- Title: Legenda
Re: [HELP]Make GetTriggerPlayer Work
change call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(0), "-clear", true ) become call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_003, Player(zzz), "-clear", true )
-
- Forum Addict
- Posts: 407
- Joined: February 25th, 2011, 3:16 am
- Location: Unknown
Re: [HELP]Make GetTriggerPlayer Work
still not work Kang. Only work for red player. The other not work.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 )
-
- Old Wrinkly Member
- Posts: 226
- Joined: April 19th, 2010, 1:48 pm
- Location: In The World
Re: [HELP]Make GetTriggerPlayer Work
EDIT: Remove...it not work
Last edited by Fukki on June 8th, 2013, 12:15 pm, edited 2 times in total.
-
- Forum Addict
- Posts: 407
- Joined: February 25th, 2011, 3:16 am
- Location: Unknown
Re: [HELP]Make GetTriggerPlayer Work
Thanks Fukki, but ur code not work. When I type -clear or clearoff nothing happen.
-
- Old Wrinkly Member
- Posts: 226
- Joined: April 19th, 2010, 1:48 pm
- Location: In The World
Re: [HELP]Make GetTriggerPlayer Work
write in 3 minute ...
this code has been tested
this code has been tested
Code: Select all
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