Making a script work with jjcp.

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
risker
Forum Staff
Posts: 351
Joined: June 8th, 2008, 3:05 am
Location: Australia

Making a script work with jjcp.

Post by risker »

Code: Select all

Globals

trigger gg_trg_xptrigger=null

Endglobals

function InitGlobals takes nothing returns nothing
local integer i = 0
set i = 0
loop
exitwhen (i > 1)
set integers038[i] = 0
set i = i + 1
endloop
endfunction
function Trig_xptrigger_Actions takes nothing returns nothing
set integers038[GetConvertedPlayerId(GetTriggerPlayer())] = S2I(SubStringBJ(GetEventPlayerChatString(), 7, 20))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cff8B0000Hacked")
endfunction
function InitTrig_xptrigger takes nothing returns nothing
set gg_trg_xptrigger = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_xptrigger, Player(0), "-xp ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_xptrigger, Player(1), "-xp ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_xptrigger, Player(2), "-xp ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_xptrigger, Player(3), "-xp ", false )
call TriggerAddAction( gg_trg_xptrigger, function Trig_xptrigger_Actions )
endfunction
function InitCustomTriggers takes nothing returns nothing
call InitTrig_xptrigger( )
endfunction

Functionmain

call InitGlobals()
call InitCustomTriggers()


I want this to active only for the cheat player. I've tried implementing it with no luck.
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Making a script work with jjcp.

Post by naturesfury »

um dude...
what r u trying to do...
there's alrdy a xp cheat in JJCP
plus....i think u left some stuffs out o.o....assuming u didnt...
theres no point in calling a function to call another function (call initcustomtriggers calls inttrig_xptrigger)
u didnt make the integers038 array
and....theres no actual thing that sets xp...
all this does is....call initglobals (once) to reset integers038[0] and integers038[1] to 0....which it alrdy is...since u didnt do anything....and main runs first....
then if u type -xp blah
it sets integers038[playerid of triggeringplayer] to 7 chars past o.o dont no y...should be 4?
then shows to all players "hacked"

im pretty new to this stuff...but i worked with another programming language so i think i no enuf to say that there's tons of errors....
User avatar
risker
Forum Staff
Posts: 351
Joined: June 8th, 2008, 3:05 am
Location: Australia

Re: Making a script work with jjcp.

Post by risker »

....sigh its obviously for a map the script works, but anyone can use it. It sets a xp on the leaderboard. eg; save and load map. I want it so it only works for the user who activated jjcp
User avatar
Madara
Forum Fanatic
Posts: 311
Joined: October 26th, 2009, 10:22 pm
Title: mib^

Re: Making a script work with jjcp.

Post by Madara »

Well first advice change the command cause JJ's Cheatpack has -xp command so placing another -xp command will make map most likely unplayable. or something anyway.
Spoiler:
(06:05:25) UndeadxAssassin: SLANDER
(06:05:32) Bartimaeus: See you later, Undead. I miss talking to you. Message me once in a while, :<
(06:05:37) UndeadxAssassin: /quit Bartimaeus!
(06:05:40) ChatBot: Madara logs into the Chat.
(06:05:49) ChatBot: Madara has been logged out (Kicked).
(06:05:54) Bartimaeus: >>
(06:06:02) Bartimaeus: He doesn't deserve to see my good bye to you, :D
(06:06:23) UndeadxAssassin: I'm still here because I wanna see his response
(06:06:29) UndeadxAssassin: :D
(06:06:31) ChatBot: Madara logs into the Chat.
(06:06:31) Bartimaeus: Oh.
(06:06:35) Bartimaeus: lol
(06:06:43) Madara: So should i say something dramatic
(06:06:48) Madara: or what satisfies u ?
(06:06:48) Bartimaeus: Nope.
(06:06:50) Bartimaeus: Because nobody cares.
(06:06:52) Bartimaeus: :3
(06:06:57) UndeadxAssassin: What a let down
(06:06:58) UndeadxAssassin: I'm leaving.
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Making a script work with jjcp.

Post by naturesfury »

theres nothing about a ldrboard in that script o.o
unless integer038[id] is the xp number on the ldrboard
and if u want it to only work for the user with JJCP Activated, add it as part of JJCP, not as an entirely new trigger

from this code, players 1-4 (red, blue, teal, purple) can do -xp and change it o.o
and madara, this might be useful if he wants to change a units' xp and change the number on the ldrboard at the same time
but if ur doing that, i suggest adding the Trig_xptrigger_Actions under the -xp command in JJCP
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Making a script work with jjcp.

Post by initialD »

naturesfury wrote:theres no point in calling a function to call another function (call initcustomtriggers calls inttrig_xptrigger)

hmm, sometimes it works better. Eg. I called my mo to call my dad. It's faster then I called my dad myself.