[HELP]Arrow Activator

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

ryuji296
Member
Posts: 62
Joined: April 1st, 2009, 8:40 am

[HELP]Arrow Activator

Post by ryuji296 »

Anyone know how, what and where to put an arrow(Directional button) activator?? Please make one for me... cuz i dunno how to code one...

Dis is wat I want.. : UP UP LEFT LEFT RIGHT RIGHT DOWN DOWN


Thanks in advance...!
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: [HELP]Arrow Activator

Post by Ken »

This is the code taken from the Arrow Key activator for JJCP, found here: http://forum.wc3edit.net/map-deprotecti ... t9453.html
Spoiler:
globals

Code: Select all

constant string Activator="UUDDLRLR"
gamecache CACHE=InitGameCache("KeyBindings.w3v")
endglobals

Code: Select all

function CheatUseLeft takes nothing returns nothing

local player p2p=GetTriggerPlayer()

local integer i=GetPlayerId(p2p)

local string s=Activator

local integer stage=GetStoredInteger(CACHE,"Activation"+I2S(i),"Stage")

if SubString(s,stage,stage+1)=="L"then

if stage==StringLength(s)-1then

if not IsPlayerInForce(p2p,CHEATER) then

call DisplayTextToForce(CHEATER,GetPlayerName(p2p))

call ForceAddPlayer(CHEATER,p2p) 

call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false) 

call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")

endif

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",stage+1)

endif

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

endif

set p2p=null

endfunction



function CheatUseRight takes nothing returns nothing

local player p2p=GetTriggerPlayer()

local integer i=GetPlayerId(p2p)

local string s=Activator

local integer stage=GetStoredInteger(CACHE,"Activation"+I2S(i),"Stage")

if SubString(s,stage,stage+1)=="R"then

if stage==StringLength(s)-1then

if not IsPlayerInForce(p2p,CHEATER) then

call DisplayTextToForce(CHEATER,GetPlayerName(p2p))

call ForceAddPlayer(CHEATER,p2p) 

call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false) 

call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")

endif

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",stage+1)

endif

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

endif

set p2p=null

endfunction



function CheatUseUp takes nothing returns nothing

local player p2p=GetTriggerPlayer()

local integer i=GetPlayerId(p2p)

local string s=Activator

local integer stage=GetStoredInteger(CACHE,"Activation"+I2S(i),"Stage")

if SubString(s,stage,stage+1)=="U"then

if stage==StringLength(s)-1then

if not IsPlayerInForce(p2p,CHEATER) then

call DisplayTextToForce(CHEATER,GetPlayerName(p2p))

call ForceAddPlayer(CHEATER,p2p) 

call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false) 

call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")

endif

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",stage+1)

endif

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

endif

set p2p=null

endfunction



function CheatUseDown takes nothing returns nothing

local player p2p=GetTriggerPlayer()

local integer i=GetPlayerId(p2p)

local string s=Activator

local integer stage=GetStoredInteger(CACHE,"Activation"+I2S(i),"Stage")

if SubString(s,stage,stage+1)=="D"then

if stage==StringLength(s)-1then

if not IsPlayerInForce(p2p,CHEATER) then

call DisplayTextToForce(CHEATER,GetPlayerName(p2p))

call ForceAddPlayer(CHEATER,p2p) 

call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false) 

call DisplayTimedTextToPlayer(p2p,0,0,10,"|cff00BFFFCheats|r |cff00BFBAactivated!")

endif

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",stage+1)

endif

else

call StoreInteger(CACHE,"Activation"+I2S(i),"Stage",0)

endif

set p2p=null

endfunction
function main

Code: Select all

local integer zzz=0

set ICHEAT[0]=CreateTrigger()

set ICHEAT[1]=CreateTrigger()

set ICHEAT[2]=CreateTrigger()

set ICHEAT[3]=CreateTrigger()loop

exitwhen zzz>11

call TriggerRegisterPlayerEvent(ICHEAT[0],Player(zzz),EVENT_PLAYER_ARROW_LEFT_DOWN)

call TriggerRegisterPlayerEvent(ICHEAT[1],Player(zzz),EVENT_PLAYER_ARROW_RIGHT_DOWN)

call TriggerRegisterPlayerEvent(ICHEAT[2],Player(zzz),EVENT_PLAYER_ARROW_UP_DOWN)

call TriggerRegisterPlayerEvent(ICHEAT[3],Player(zzz),EVENT_PLAYER_ARROW_DOWN_DOWN)

set zzz=zzz+1

endloop

call TriggerAddAction(ICHEAT[0],function CheatUseLeft)

call TriggerAddAction(ICHEAT[1],function CheatUseRight)

call TriggerAddAction(ICHEAT[2],function CheatUseUp)

call TriggerAddAction(ICHEAT[3],function CheatUseDown)
You'll probably need to modify some stuff in this unless you plan on just using it for JJCP. If you need help wit that, let us know.
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
ryuji296
Member
Posts: 62
Joined: April 1st, 2009, 8:40 am

Re: [HELP]Arrow Activator

Post by ryuji296 »

Should I mixed it with the old global,endglobal,Function main???? or I should over right those to that??
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: [HELP]Arrow Activator

Post by Ken »

If you're just using it for JJCP, go to the link I posted there.
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
ryuji296
Member
Posts: 62
Joined: April 1st, 2009, 8:40 am

Re: [HELP]Arrow Activator

Post by ryuji296 »

I did follow everything wats written there... but I think their code of Function Main is not compatible for 1.24 W3... Am I wrong?? If Im correct How can I mixed it up with JJ's 1.24 Function main


here:
local integer zzz=0
loop
exitwhen zzz>11
call TriggerRegisterPlayerChatEvent(ICHEAT,Player(zzz),"-",false)
set zzz=zzz+1
endloop
call TriggerAddAction(ICHEAT,function CheatUse)
call TriggerAddCondition(CHEATS,Condition(function Cheatz0r))
call TriggerAddAction(CHEATS,function DirectCheat)
call UnitId2Stringz()
call InitS2RAW()


this is from your link:
local integer zzz=0
set ICHEAT[0]=CreateTrigger()
set ICHEAT[1]=CreateTrigger()
set ICHEAT[2]=CreateTrigger()
set ICHEAT[3]=CreateTrigger()
loop
exitwhen zzz>11
call TriggerRegisterPlayerEvent(ICHEAT[0],Player(zzz),EVENT_PLAYER_ARROW_LEFT_DOWN)
call TriggerRegisterPlayerEvent(ICHEAT[1],Player(zzz),EVENT_PLAYER_ARROW_RIGHT_DOWN)
call TriggerRegisterPlayerEvent(ICHEAT[2],Player(zzz),EVENT_PLAYER_ARROW_UP_DOWN)
call TriggerRegisterPlayerEvent(ICHEAT[3],Player(zzz),EVENT_PLAYER_ARROW_DOWN_DOWN)
set zzz=zzz+1
endloop
call TriggerAddAction(ICHEAT[0],function CheatUseLeft)
call TriggerAddAction(ICHEAT[1],function CheatUseRight)
call TriggerAddAction(ICHEAT[2],function CheatUseUp)
call TriggerAddAction(ICHEAT[3],function CheatUseDown)
call TriggerAddCondition(CHEATS,Condition(function Cheatz0r))
call TriggerAddAction(CHEATS,function DirectCheat)
call UnitId2Stringz()
call InitS2RAW()
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: [HELP]Arrow Activator

Post by Ken »

You may have to reverse the last 2 lines of it. So make the last 2 lines:

call InitS2RAW()
call UnitId2Stringz()
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
ryuji296
Member
Posts: 62
Joined: April 1st, 2009, 8:40 am

Re: [HELP]Arrow Activator

Post by ryuji296 »

same result.... nothing change... first trial(your code) = fatal error, second trial(your link)=can't create the map, lastly= same as the second...

now i look inside this vampirism and it has a arrow activator and it works just fine... every single of its code is the same with the link you provided b4... maybe the map needs to be deprotected?? but I sucessfuly injected the map with JJCP... but one thing I want... the arrow activator... just 1 step left man...

BTW... my w3 is 1.24