Page 1 of 1

Making a script work with jjcp.

Posted: July 22nd, 2010, 2:25 pm
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.

Re: Making a script work with jjcp.

Posted: July 23rd, 2010, 12:22 pm
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....

Re: Making a script work with jjcp.

Posted: July 27th, 2010, 2:04 pm
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

Re: Making a script work with jjcp.

Posted: July 27th, 2010, 4:51 pm
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.

Re: Making a script work with jjcp.

Posted: July 27th, 2010, 5:32 pm
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

Re: Making a script work with jjcp.

Posted: August 1st, 2010, 3:26 am
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.