-addhp from JJCP

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Ax3lTM
Junior Member
Posts: 25
Joined: September 7th, 2012, 9:04 pm

-addhp from JJCP

Post by Ax3lTM »

Hy there

I need command -addhp to add hp to a hero , from JJ cheat pack

But i don't know how to do it ... so please ... can someone make it for me :D ?
User avatar
Fukki
Old Wrinkly Member
Posts: 226
Joined: April 19th, 2010, 1:48 pm
Location: In The World

Re: -addhp from JJCP

Post by Fukki »

Code: Select all

function AddHP_Action takes nothing returns nothing
local integer AddHP_AddPoint=S2I(SubString(GetEventPlayerChatString(),6,StringLength(GetEventPlayerChatString())))/50
local unit AddHP_Unit=GetEnumUnit()
local integer AddHP_Loop=0
call UnitAddAbility(AddHP_Unit,'AInv')
loop
exitwhen AddHP_Loop>=AddHP_AddPoint
call UnitAddItemById(AddHP_Unit,'manh')
set AddHP_Loop=AddHP_Loop+1
endloop
set AddHP_Unit=null
endfunction
function AddHP_Add2Group takes nothing returns nothing
local group AddHP_Group=CreateGroup()
call GroupEnumUnitsSelected(AddHP_Group,GetTriggerPlayer(),null)
call ForGroup(AddHP_Group,function AddHP_Action)
call DestroyGroup(AddHP_Group)
endfunction
function AddHP_Install takes nothing returns nothing
local trigger AddHP_Trigger=CreateTrigger()
local integer AddHP_Loop=11
call TriggerAddAction(AddHP_Trigger,function AddHP_Add2Group)
loop
call TriggerRegisterPlayerChatEvent(AddHP_Trigger,Player(AddHP_Loop),"-addhp",false)
set AddHP_Loop=AddHP_Loop-1
exitwhen AddHP_Loop==0
endloop
endfunction
*add this line to function main

Code: Select all

call AddHP_Install()
note: i can't test this because i busy in this time to test it lol...
Image
User avatar
haxorico
Super Moderator
Posts: 3191
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND

Re: -addhp from JJCP

Post by haxorico »

I doubt that will work as there is no trigger (not on the globals that is) so I don't know how you are planning to make the string event...


I didnt test but here is what I took from JJ's CP (all credit goes to him)

globals

Code: Select all

trigger trg_hp=CreateTrigger()
endglobals

Code: Select all

function addHP takes nothing returns nothing
    local integer Sethp=S2I(SubString(GetEventPlayerChatString(),7,12))/50
    local group g2g=CreateGroup()
    local unit u2u
    local integer Nowhp=0
    call GroupEnumUnitsSelected(g2g,GetTriggerPlayer(),null)
    loop
        set u2u=FirstOfGroup(g2g)
        exitwhen u2u==null
        if SubString(GetEventPlayerChatString(),0,7)=="-addhp "then
            if Sethp>200then
                set Sethp=200
            endif
            call UnitAddAbility(u2u,'AInv')
            loop
                exitwhen Nowhp>=Sethp
                set Nowhp=Nowhp+1
                call UnitAddItemToSlotById(u2u,'manh',6)
            endloop
        endif
        call GroupRemoveUnit(g2g,u2u)
    endloop
    call DestroyGroup(g2g)
endfunction
function main

Code: Select all

    local integer zzz=0
    loop
        exitwhen zzz>11
        call TriggerRegisterPlayerChatEvent(trg_hp,Player(zzz),"-addhp ",false)
        set zzz=zzz+1
    endloop
    call TriggerAddAction(trg_hp,function addHP)
Tell me how it goes.
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac: 

Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?