[HELP]Make GetTriggerPlayer Work

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

zUsername
Forum Addict
Posts: 407
Joined: February 25th, 2011, 3:16 am
Location: Unknown

Re: [HELP]Make GetTriggerPlayer Work

Post by zUsername »

It' work, thanks Fukki, can you explain me how it's work ? thanks you.
User avatar
Fukki
Old Wrinkly Member
Posts: 226
Joined: April 19th, 2010, 1:48 pm
Location: In The World

Re: [HELP]Make GetTriggerPlayer Work

Post by Fukki »

Spoiler:

Code: Select all

globals
//Create Hashtable
hashtable HASH_MessagesClear=InitHashtable()

//Set autoclear timer
real AutoMessagesClear_Timer=1.
endglobals

function GetTimer_MessagesClear takes integer PlayerID returns timer
local timer Timer=CreateTimer()
local integer HandleId=GetHandleId(Timer)

//Save player id - use timer HashleId to save this
call SaveInteger(HASH_MessagesClear,0,HandleId,PlayerID)

//set boolean to "true" to enable trigger
call SaveBoolean(HASH_MessagesClear,0,PlayerID,true)

return Timer
endfunction

function Auto_ClearMessages takes nothing returns nothing
local timer Timer=GetExpiredTimer()
local integer HandleId=GetHandleId(Timer)

//get timer handleid and load PlayerId
local integer PlayerID=LoadInteger(HASH_MessagesClear,0,HandleId)

//check boolean when boolean set to "true" go to clear messgaes
if LoadBoolean(HASH_MessagesClear,0,PlayerID)then

//get player and clear messgaes
if GetLocalPlayer()==Player(PlayerID)then
call ClearTextMessages()
endif

else

//destoy this timer when boolean set to "false"
call DestroyTimer(Timer)

endif
set Timer=null
set HandleId=0
set PlayerID=0
endfunction

function MessagesClear_Enable takes nothing returns nothing
local player GetPlayer=GetTriggerPlayer()
local integer PlayerID=GetPlayerId(GetPlayer)

//check boolean when this booealn is "false" go to start auto clear messgaes
if not LoadBoolean(HASH_MessagesClear,0,PlayerID)then

//start timer and call function "GetTimer_MessagesClear" to setting
//and function "Auto_ClearMessages" is clear messgaes
call TimerStart(GetTimer_MessagesClear(PlayerID),AutoMessagesClear_Timer,true,function Auto_ClearMessages)

endif
set GetPlayer=null
set PlayerID=0
endfunction

function MessagesClear_Disable takes nothing returns nothing
local player GetPlayer=GetTriggerPlayer()
local integer PlayerID=GetPlayerId(GetPlayer)

//set boolean to false - timer auto destroy
call SaveBoolean(HASH_MessagesClear,0,PlayerID,false)

set GetPlayer=null
set PlayerID=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
sorry i explained poorly
Image
zUsername
Forum Addict
Posts: 407
Joined: February 25th, 2011, 3:16 am
Location: Unknown

Re: [HELP]Make GetTriggerPlayer Work

Post by zUsername »

thanks Fukki, I want to learn about using hastable , do you have any tutorial about that ? thanks you again.
User avatar
Fukki
Old Wrinkly Member
Posts: 226
Joined: April 19th, 2010, 1:48 pm
Location: In The World

Re: [HELP]Make GetTriggerPlayer Work

Post by Fukki »

you can learn it in "blizzard.j"

InitHashtable() = create hash table
GetHandleId( value ) = get hash id (use for item/trigger/timer/multiboard/unit/ect...)
StringHash( string ) = get string to hash integer

save value function
Spoiler:

Code: Select all

function StoreRealBJ takes real value, string key, string missionKey, gamecache cache returns nothing
    call StoreReal(cache, missionKey, key, value)
endfunction

//===========================================================================
function StoreIntegerBJ takes integer value, string key, string missionKey, gamecache cache returns nothing
    call StoreInteger(cache, missionKey, key, value)
endfunction

//===========================================================================
function StoreBooleanBJ takes boolean value, string key, string missionKey, gamecache cache returns nothing
    call StoreBoolean(cache, missionKey, key, value)
endfunction

//===========================================================================
function StoreStringBJ takes string value, string key, string missionKey, gamecache cache returns boolean
    return StoreString(cache, missionKey, key, value)
endfunction

//===========================================================================
function StoreUnitBJ takes unit whichUnit, string key, string missionKey, gamecache cache returns boolean
    return StoreUnit(cache, missionKey, key, whichUnit)
endfunction

//===========================================================================
function SaveRealBJ takes real value, integer key, integer missionKey, hashtable table returns nothing
    call SaveReal(table, missionKey, key, value)
endfunction

//===========================================================================
function SaveIntegerBJ takes integer value, integer key, integer missionKey, hashtable table returns nothing
    call SaveInteger(table, missionKey, key, value)
endfunction

//===========================================================================
function SaveBooleanBJ takes boolean value, integer key, integer missionKey, hashtable table returns nothing
    call SaveBoolean(table, missionKey, key, value)
endfunction

//===========================================================================
function SaveStringBJ takes string value, integer key, integer missionKey, hashtable table returns boolean
    return SaveStr(table, missionKey, key, value)
endfunction

//===========================================================================
function SavePlayerHandleBJ takes player whichPlayer, integer key, integer missionKey, hashtable table returns boolean
    return SavePlayerHandle(table, missionKey, key, whichPlayer)
endfunction

//===========================================================================
function SaveWidgetHandleBJ takes widget whichWidget, integer key, integer missionKey, hashtable table returns boolean
    return SaveWidgetHandle(table, missionKey, key, whichWidget)
endfunction

//===========================================================================
function SaveDestructableHandleBJ takes destructable whichDestructable, integer key, integer missionKey, hashtable table returns boolean
    return SaveDestructableHandle(table, missionKey, key, whichDestructable)
endfunction

//===========================================================================
function SaveItemHandleBJ takes item whichItem, integer key, integer missionKey, hashtable table returns boolean
    return SaveItemHandle(table, missionKey, key, whichItem)
endfunction

//===========================================================================
function SaveUnitHandleBJ takes unit whichUnit, integer key, integer missionKey, hashtable table returns boolean
    return SaveUnitHandle(table, missionKey, key, whichUnit)
endfunction

//===========================================================================
function SaveAbilityHandleBJ takes ability whichAbility, integer key, integer missionKey, hashtable table returns boolean
    return SaveAbilityHandle(table, missionKey, key, whichAbility)
endfunction

//===========================================================================
function SaveTimerHandleBJ takes timer whichTimer, integer key, integer missionKey, hashtable table returns boolean
    return SaveTimerHandle(table, missionKey, key, whichTimer)
endfunction

//===========================================================================
function SaveTriggerHandleBJ takes trigger whichTrigger, integer key, integer missionKey, hashtable table returns boolean
    return SaveTriggerHandle(table, missionKey, key, whichTrigger)
endfunction

//===========================================================================
function SaveTriggerConditionHandleBJ takes triggercondition whichTriggercondition, integer key, integer missionKey, hashtable table returns boolean
    return SaveTriggerConditionHandle(table, missionKey, key, whichTriggercondition)
endfunction

//===========================================================================
function SaveTriggerActionHandleBJ takes triggeraction whichTriggeraction, integer key, integer missionKey, hashtable table returns boolean
    return SaveTriggerActionHandle(table, missionKey, key, whichTriggeraction)
endfunction

//===========================================================================
function SaveTriggerEventHandleBJ takes event whichEvent, integer key, integer missionKey, hashtable table returns boolean
    return SaveTriggerEventHandle(table, missionKey, key, whichEvent)
endfunction

//===========================================================================
function SaveForceHandleBJ takes force whichForce, integer key, integer missionKey, hashtable table returns boolean
    return SaveForceHandle(table, missionKey, key, whichForce)
endfunction

//===========================================================================
function SaveGroupHandleBJ takes group whichGroup, integer key, integer missionKey, hashtable table returns boolean
    return SaveGroupHandle(table, missionKey, key, whichGroup)
endfunction

//===========================================================================
function SaveLocationHandleBJ takes location whichLocation, integer key, integer missionKey, hashtable table returns boolean
    return SaveLocationHandle(table, missionKey, key, whichLocation)
endfunction

//===========================================================================
function SaveRectHandleBJ takes rect whichRect, integer key, integer missionKey, hashtable table returns boolean
    return SaveRectHandle(table, missionKey, key, whichRect)
endfunction

//===========================================================================
function SaveBooleanExprHandleBJ takes boolexpr whichBoolexpr, integer key, integer missionKey, hashtable table returns boolean
    return SaveBooleanExprHandle(table, missionKey, key, whichBoolexpr)
endfunction

//===========================================================================
function SaveSoundHandleBJ takes sound whichSound, integer key, integer missionKey, hashtable table returns boolean
    return SaveSoundHandle(table, missionKey, key, whichSound)
endfunction

//===========================================================================
function SaveEffectHandleBJ takes effect whichEffect, integer key, integer missionKey, hashtable table returns boolean
    return SaveEffectHandle(table, missionKey, key, whichEffect)
endfunction

//===========================================================================
function SaveUnitPoolHandleBJ takes unitpool whichUnitpool, integer key, integer missionKey, hashtable table returns boolean
    return SaveUnitPoolHandle(table, missionKey, key, whichUnitpool)
endfunction

//===========================================================================
function SaveItemPoolHandleBJ takes itempool whichItempool, integer key, integer missionKey, hashtable table returns boolean
    return SaveItemPoolHandle(table, missionKey, key, whichItempool)
endfunction

//===========================================================================
function SaveQuestHandleBJ takes quest whichQuest, integer key, integer missionKey, hashtable table returns boolean
    return SaveQuestHandle(table, missionKey, key, whichQuest)
endfunction

//===========================================================================
function SaveQuestItemHandleBJ takes questitem whichQuestitem, integer key, integer missionKey, hashtable table returns boolean
    return SaveQuestItemHandle(table, missionKey, key, whichQuestitem)
endfunction

//===========================================================================
function SaveDefeatConditionHandleBJ takes defeatcondition whichDefeatcondition, integer key, integer missionKey, hashtable table returns boolean
    return SaveDefeatConditionHandle(table, missionKey, key, whichDefeatcondition)
endfunction

//===========================================================================
function SaveTimerDialogHandleBJ takes timerdialog whichTimerdialog, integer key, integer missionKey, hashtable table returns boolean
    return SaveTimerDialogHandle(table, missionKey, key, whichTimerdialog)
endfunction

//===========================================================================
function SaveLeaderboardHandleBJ takes leaderboard whichLeaderboard, integer key, integer missionKey, hashtable table returns boolean
    return SaveLeaderboardHandle(table, missionKey, key, whichLeaderboard)
endfunction

//===========================================================================
function SaveMultiboardHandleBJ takes multiboard whichMultiboard, integer key, integer missionKey, hashtable table returns boolean
    return SaveMultiboardHandle(table, missionKey, key, whichMultiboard)
endfunction

//===========================================================================
function SaveMultiboardItemHandleBJ takes multiboarditem whichMultiboarditem, integer key, integer missionKey, hashtable table returns boolean
    return SaveMultiboardItemHandle(table, missionKey, key, whichMultiboarditem)
endfunction

//===========================================================================
function SaveTrackableHandleBJ takes trackable whichTrackable, integer key, integer missionKey, hashtable table returns boolean
    return SaveTrackableHandle(table, missionKey, key, whichTrackable)
endfunction

//===========================================================================
function SaveDialogHandleBJ takes dialog whichDialog, integer key, integer missionKey, hashtable table returns boolean
    return SaveDialogHandle(table, missionKey, key, whichDialog)
endfunction

//===========================================================================
function SaveButtonHandleBJ takes button whichButton, integer key, integer missionKey, hashtable table returns boolean
    return SaveButtonHandle(table, missionKey, key, whichButton)
endfunction

//===========================================================================
function SaveTextTagHandleBJ takes texttag whichTexttag, integer key, integer missionKey, hashtable table returns boolean
    return SaveTextTagHandle(table, missionKey, key, whichTexttag)
endfunction

//===========================================================================
function SaveLightningHandleBJ takes lightning whichLightning, integer key, integer missionKey, hashtable table returns boolean
    return SaveLightningHandle(table, missionKey, key, whichLightning)
endfunction

//===========================================================================
function SaveImageHandleBJ takes image whichImage, integer key, integer missionKey, hashtable table returns boolean
    return SaveImageHandle(table, missionKey, key, whichImage)
endfunction

//===========================================================================
function SaveUbersplatHandleBJ takes ubersplat whichUbersplat, integer key, integer missionKey, hashtable table returns boolean
    return SaveUbersplatHandle(table, missionKey, key, whichUbersplat)
endfunction

//===========================================================================
function SaveRegionHandleBJ takes region whichRegion, integer key, integer missionKey, hashtable table returns boolean
    return SaveRegionHandle(table, missionKey, key, whichRegion)
endfunction

//===========================================================================
function SaveFogStateHandleBJ takes fogstate whichFogState, integer key, integer missionKey, hashtable table returns boolean
    return SaveFogStateHandle(table, missionKey, key, whichFogState)
endfunction

//===========================================================================
function SaveFogModifierHandleBJ takes fogmodifier whichFogModifier, integer key, integer missionKey, hashtable table returns boolean
    return SaveFogModifierHandle(table, missionKey, key, whichFogModifier)
endfunction

//===========================================================================
function SaveAgentHandleBJ takes agent whichAgent, integer key, integer missionKey, hashtable table returns boolean
    return SaveAgentHandle(table, missionKey, key, whichAgent)
endfunction

//===========================================================================
function SaveHashtableHandleBJ takes hashtable whichHashtable, integer key, integer missionKey, hashtable table returns boolean
    return SaveHashtableHandle(table, missionKey, key, whichHashtable)
endfunction
load value function
Spoiler:

Code: Select all

function LoadRealBJ takes integer key, integer missionKey, hashtable table returns real
    //call SyncStoredReal(table, missionKey, key)
    return LoadReal(table, missionKey, key)
endfunction

//===========================================================================
function LoadIntegerBJ takes integer key, integer missionKey, hashtable table returns integer
    //call SyncStoredInteger(table, missionKey, key)
    return LoadInteger(table, missionKey, key)
endfunction

//===========================================================================
function LoadBooleanBJ takes integer key, integer missionKey, hashtable table returns boolean
    //call SyncStoredBoolean(table, missionKey, key)
    return LoadBoolean(table, missionKey, key)
endfunction

//===========================================================================
function LoadStringBJ takes integer key, integer missionKey, hashtable table returns string
    local string s

    //call SyncStoredString(table, missionKey, key)
    set s = LoadStr(table, missionKey, key)
    if (s == null) then
        return ""
    else
        return s
    endif
endfunction

//===========================================================================
function LoadPlayerHandleBJ takes integer key, integer missionKey, hashtable table returns player
    return LoadPlayerHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadWidgetHandleBJ takes integer key, integer missionKey, hashtable table returns widget
    return LoadWidgetHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadDestructableHandleBJ takes integer key, integer missionKey, hashtable table returns destructable
    return LoadDestructableHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadItemHandleBJ takes integer key, integer missionKey, hashtable table returns item
    return LoadItemHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadUnitHandleBJ takes integer key, integer missionKey, hashtable table returns unit
    return LoadUnitHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadAbilityHandleBJ takes integer key, integer missionKey, hashtable table returns ability
    return LoadAbilityHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTimerHandleBJ takes integer key, integer missionKey, hashtable table returns timer
    return LoadTimerHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTriggerHandleBJ takes integer key, integer missionKey, hashtable table returns trigger
    return LoadTriggerHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTriggerConditionHandleBJ takes integer key, integer missionKey, hashtable table returns triggercondition
    return LoadTriggerConditionHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTriggerActionHandleBJ takes integer key, integer missionKey, hashtable table returns triggeraction
    return LoadTriggerActionHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTriggerEventHandleBJ takes integer key, integer missionKey, hashtable table returns event
    return LoadTriggerEventHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadForceHandleBJ takes integer key, integer missionKey, hashtable table returns force
    return LoadForceHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadGroupHandleBJ takes integer key, integer missionKey, hashtable table returns group
    return LoadGroupHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadLocationHandleBJ takes integer key, integer missionKey, hashtable table returns location
    return LoadLocationHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadRectHandleBJ takes integer key, integer missionKey, hashtable table returns rect
    return LoadRectHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadBooleanExprHandleBJ takes integer key, integer missionKey, hashtable table returns boolexpr
    return LoadBooleanExprHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadSoundHandleBJ takes integer key, integer missionKey, hashtable table returns sound
    return LoadSoundHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadEffectHandleBJ takes integer key, integer missionKey, hashtable table returns effect
    return LoadEffectHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadUnitPoolHandleBJ takes integer key, integer missionKey, hashtable table returns unitpool
    return LoadUnitPoolHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadItemPoolHandleBJ takes integer key, integer missionKey, hashtable table returns itempool
    return LoadItemPoolHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadQuestHandleBJ takes integer key, integer missionKey, hashtable table returns quest
    return LoadQuestHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadQuestItemHandleBJ takes integer key, integer missionKey, hashtable table returns questitem
    return LoadQuestItemHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadDefeatConditionHandleBJ takes integer key, integer missionKey, hashtable table returns defeatcondition
    return LoadDefeatConditionHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTimerDialogHandleBJ takes integer key, integer missionKey, hashtable table returns timerdialog
    return LoadTimerDialogHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadLeaderboardHandleBJ takes integer key, integer missionKey, hashtable table returns leaderboard
    return LoadLeaderboardHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadMultiboardHandleBJ takes integer key, integer missionKey, hashtable table returns multiboard
    return LoadMultiboardHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadMultiboardItemHandleBJ takes integer key, integer missionKey, hashtable table returns multiboarditem
    return LoadMultiboardItemHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTrackableHandleBJ takes integer key, integer missionKey, hashtable table returns trackable
    return LoadTrackableHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadDialogHandleBJ takes integer key, integer missionKey, hashtable table returns dialog
    return LoadDialogHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadButtonHandleBJ takes integer key, integer missionKey, hashtable table returns button
    return LoadButtonHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadTextTagHandleBJ takes integer key, integer missionKey, hashtable table returns texttag
    return LoadTextTagHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadLightningHandleBJ takes integer key, integer missionKey, hashtable table returns lightning
    return LoadLightningHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadImageHandleBJ takes integer key, integer missionKey, hashtable table returns image
    return LoadImageHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadUbersplatHandleBJ takes integer key, integer missionKey, hashtable table returns ubersplat
    return LoadUbersplatHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadRegionHandleBJ takes integer key, integer missionKey, hashtable table returns region
    return LoadRegionHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadFogStateHandleBJ takes integer key, integer missionKey, hashtable table returns fogstate
    return LoadFogStateHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadFogModifierHandleBJ takes integer key, integer missionKey, hashtable table returns fogmodifier
    return LoadFogModifierHandle(table, missionKey, key)
endfunction

//===========================================================================
function LoadHashtableHandleBJ takes integer key, integer missionKey, hashtable table returns hashtable
    return LoadHashtableHandle(table, missionKey, key)
endfunction
clear value function
Spoiler:

Code: Select all

//===========================================================================
function FlushParentHashtableBJ takes hashtable table returns nothing
    call FlushParentHashtable(table)
endfunction

//===========================================================================
function FlushChildHashtableBJ takes integer missionKey, hashtable table returns nothing
    call FlushChildHashtable(table, missionKey)
endfunction
Image
zUsername
Forum Addict
Posts: 407
Joined: February 25th, 2011, 3:16 am
Location: Unknown

Re: [HELP]Make GetTriggerPlayer Work

Post by zUsername »

ok ok thanks you very much Fukki . I'm trying to make arrowkey like ur cheatpack :D
User avatar
Fukki
Old Wrinkly Member
Posts: 226
Joined: April 19th, 2010, 1:48 pm
Location: In The World

Re: [HELP]Make GetTriggerPlayer Work

Post by Fukki »

arrow active function by me
Spoiler:

Code: Select all

function Fukki_Active2 takes eventid fe2e returns string
local string fs2s=""
if fe2e==ConvertPlayerEvent(17)then //ESC
set fs2s="E"
elseif fe2e==ConvertPlayerEvent(261)then //EVENT_PLAYER_ARROW_LEFT_DOWN - LEFT
set fs2s="L"
elseif fe2e==ConvertPlayerEvent(263)then //EVENT_PLAYER_ARROW_RIGHT_DOWN - RIGHT
set fs2s="R"
elseif fe2e==ConvertPlayerEvent(267)then //EVENT_PLAYER_ARROW_UP_DOWN - UP
set fs2s="U"
elseif fe2e==ConvertPlayerEvent(265)then //EVENT_PLAYER_ARROW_DOWN_DOWN - DOWN
set fs2s="D"
endif
return fs2s
endfunction

function Fukki_Active1 takes nothing returns nothing
local gamecache fm2m=InitGameCache("FukKiCP.w3v")
local string fs2s="ELRUD"//Your Activator - ELRUD: ESC + Arrow Left + Arrow Right + Arrow Up + Arrow Down
local player fp2p=GetTriggerPlayer()
local integer fi2i=GetPlayerId(fp2p)
local eventid fe2e=GetTriggerEventId()
local integer fi3i=GetStoredInteger(fm2m,I2S(fi2i),fs2s)//get active string degree
local string fs3s=StringCase(SubString(fs2s,fi3i,fi3i+1),true)//set string to big character
if fs3s==StringCase(Fukki_Active2(fe2e),true)then
if fi3i==StringLength(fs2s)-1then

//when success - call function or set value in this side

call StoreInteger(fm2m,I2S(fi2i),fs2s,0)//when active success - clear value
else
call StoreInteger(fm2m,I2S(fi2i),fs2s,fi3i+1)//when succes +1 string degree
endif
else
call StoreInteger(fm2m,I2S(fi2i),fs2s,0)//when fail - clear value
endif
endfunction

function Fukki_Active0 takes nothing returns nothing
local trigger ft2t=CreateTrigger()
local integer fi2i=0
local player fp2p=null
call TriggerAddAction(ft2t,function Fukki_Active1)
loop
set fp2p=Player(fi2i)
call TriggerRegisterPlayerEvent(ft2t,fp2p,ConvertPlayerEvent(261)) //EVENT_PLAYER_ARROW_LEFT_DOWN - LEFT
call TriggerRegisterPlayerEvent(ft2t,fp2p,ConvertPlayerEvent(263)) //EVENT_PLAYER_ARROW_RIGHT_DOWN - RIGHT
call TriggerRegisterPlayerEvent(ft2t,fp2p,ConvertPlayerEvent(267)) //EVENT_PLAYER_ARROW_UP_DOWN - UP
call TriggerRegisterPlayerEvent(ft2t,fp2p,ConvertPlayerEvent(265)) //EVENT_PLAYER_ARROW_DOWN_DOWN - DOWN
call TriggerRegisterPlayerEvent(ft2t,fp2p,ConvertPlayerEvent(17)) //ESC
exitwhen fi2i>10
set fi2i=fi2i+1
endloop
endfunction
warning this function cannot be used simultaneously with "TriggerRegisterPlayerChatEvent"
when you use "TriggerRegisterPlayerChatEvent"
function "Fukki_Active2" has return to ""
Image
zUsername
Forum Addict
Posts: 407
Joined: February 25th, 2011, 3:16 am
Location: Unknown

Re: [HELP]Make GetTriggerPlayer Work

Post by zUsername »

thanks you very much Fukki :D, but if I want to use many commands by arrowkey, what I should do ?
Like: press Esc to set gold 320
press Up to add lvl
....
Look spoiler, If I do like this, so it's wrong or correct ?
Spoiler:
function Fukki_Active1 takes nothing returns nothing
local gamecache fm2m=InitGameCache("FukKiCP.w3v")
local string fs2s="ELRUD"//Your Activator - ELRUD: ESC + Arrow Left + Arrow Right + Arrow Up + Arrow Down
local string Activator="LRLR"
local player fp2p=GetTriggerPlayer()
local integer fi2i=GetPlayerId(fp2p)
local eventid fe2e=GetTriggerEventId()
local integer fi3i=GetStoredInteger(fm2m,I2S(fi2i),fs2s)//get active string degree
local string fs3s=StringCase(SubString(fs2s,fi3i,fi3i+1),true)//set string to big character
if fs3s==StringCase(Fukki_Active2(fe2e),true)then
if fi3i==StringLength(fs2s)-1then

//when success - call function or set value in this side
elseif fi3i==StringLength(Activator)-1then
//call function right ?


call StoreInteger(fm2m,I2S(fi2i),fs2s,0)//when active success - clear value
call StoreInteger(fm2m,I2S(fi2i),Activator,0)
else
call StoreInteger(fm2m,I2S(fi2i),fs2s,fi3i+1)//when succes +1 string degree
call StoreInteger(fm2m,I2S(fi2i),Activator,fi3i+1)
endif
else
call StoreInteger(fm2m,I2S(fi2i),fs2s,0)//when fail - clear value
call StoreInteger(fm2m,I2S(fi2i),Activator,0)
endif
endfunction
User avatar
Fukki
Old Wrinkly Member
Posts: 226
Joined: April 19th, 2010, 1:48 pm
Location: In The World

Re: [HELP]Make GetTriggerPlayer Work

Post by Fukki »

zUsername wrote:thanks you very much Fukki :D, but if I want to use many commands by arrowkey, what I should do ?
Like: press Esc to set gold 320
press Up to add lvl
....
Look spoiler, If I do like this, so it's wrong or correct ?
Spoiler:
function Fukki_Active1 takes nothing returns nothing
local gamecache fm2m=InitGameCache("FukKiCP.w3v")
local string fs2s="ELRUD"//Your Activator - ELRUD: ESC + Arrow Left + Arrow Right + Arrow Up + Arrow Down
local string Activator="LRLR"
local player fp2p=GetTriggerPlayer()
local integer fi2i=GetPlayerId(fp2p)
local eventid fe2e=GetTriggerEventId()
local integer fi3i=GetStoredInteger(fm2m,I2S(fi2i),fs2s)//get active string degree
local string fs3s=StringCase(SubString(fs2s,fi3i,fi3i+1),true)//set string to big character
local integer fi3i=GetStoredInteger(fm2m,I2S(fi2i),Activator)
local string fs3s=StringCase(SubString(Activator,fi3i,fi3i+1),true)

if fs3s==StringCase(Fukki_Active2(fe2e),true)then
if fi3i==StringLength(fs2s)-1then
if fi3i==StringLength(Activator)-1then
elseif fi3i==StringLength(Activator)-1then
//call function right ?
- yeah
//when success - call function or set value in this side

call StoreInteger(fm2m,I2S(fi2i),fs2s,0)//when active success - clear value
call StoreInteger(fm2m,I2S(fi2i),Activator,0)
else
call StoreInteger(fm2m,I2S(fi2i),fs2s,fi3i+1)//when succes +1 string degree
call StoreInteger(fm2m,I2S(fi2i),Activator,fi3i+1)
endif
else
call StoreInteger(fm2m,I2S(fi2i),fs2s,0)//when fail - clear value
call StoreInteger(fm2m,I2S(fi2i),Activator,0)
endif
endfunction
Image
zUsername
Forum Addict
Posts: 407
Joined: February 25th, 2011, 3:16 am
Location: Unknown

Re: [HELP]Make GetTriggerPlayer Work

Post by zUsername »

okay thanks for helping me Fukki. Thank you again :D