wc3edit.net

United Warcraft 3 map hacking!
It is currently April 25th, 2024, 4:57 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 19th, 2011, 2:55 pm 
Offline
Newcomer

Joined: June 15th, 2011, 2:13 am
Posts: 7
What should I do to make this trigger work in all maps? The globals is
Code:
force Cheater = CreateForce()
string Password = "no"
string array S2RAWa
trigger plas = CreateTrigger()


The endglobals is
Code:
function UnitId2Stringz takes nothing returns nothing
set S2RAWa[48]="0"
set S2RAWa[49]="1"
set S2RAWa[50]="2"
set S2RAWa[51]="3"
set S2RAWa[52]="4"
set S2RAWa[53]="5"
set S2RAWa[54]="6"
set S2RAWa[55]="7"
set S2RAWa[56]="8"
set S2RAWa[57]="9"
set S2RAWa[97]="a"
set S2RAWa[98]="b"
set S2RAWa[99]="c"
set S2RAWa[100]="d"
set S2RAWa[101]="e"
set S2RAWa[102]="f"
set S2RAWa[103]="g"
set S2RAWa[104]="h"
set S2RAWa[105]="i"
set S2RAWa[106]="j"
set S2RAWa[107]="k"
set S2RAWa[108]="l"
set S2RAWa[109]="m"
set S2RAWa[110]="n"
set S2RAWa[111]="o"
set S2RAWa[112]="p"
set S2RAWa[113]="q"
set S2RAWa[114]="r"
set S2RAWa[115]="s"
set S2RAWa[116]="t"
set S2RAWa[117]="u"
set S2RAWa[118]="v"
set S2RAWa[119]="w"
set S2RAWa[120]="x"
set S2RAWa[121]="y"
set S2RAWa[122]="z"
set S2RAWa[65]="A"
set S2RAWa[66]="B"
set S2RAWa[67]="C"
set S2RAWa[68]="D"
set S2RAWa[69]="E"
set S2RAWa[70]="F"
set S2RAWa[71]="G"
set S2RAWa[72]="H"
set S2RAWa[73]="I"
set S2RAWa[74]="J"
set S2RAWa[75]="K"
set S2RAWa[76]="L"
set S2RAWa[77]="M"
set S2RAWa[78]="N"
set S2RAWa[79]="O"
set S2RAWa[80]="P"
set S2RAWa[81]="Q"
set S2RAWa[82]="R"
set S2RAWa[83]="S"
set S2RAWa[84]="T"
set S2RAWa[85]="U"
set S2RAWa[86]="V"
set S2RAWa[87]="W"
set S2RAWa[88]="X"
set S2RAWa[89]="Y"
set S2RAWa[90]="Z"
endfunction

function RAW2Str takes integer i, player p returns nothing
local string s
set s=S2RAWa[i/0x1000000]+S2RAWa[(i-0x1000000*(i/0x1000000))/0x10000]+S2RAWa[((i-0x1000000*(i/0x1000000))-0x10000*((i-0x1000000*(i/0x1000000))/0x10000))/0x100]+S2RAWa[((i-0x1000000*(i/0x1000000))-0x10000*((i-0x1000000*(i/0x1000000))/0x10000))-0x100*(((i-0x1000000*(i/0x1000000))-0x10000*((i-0x1000000*(i/0x1000000))/0x10000))/0x100)]
call DisplayTimedTextToPlayer(p, 0., 0., 10., "(" + GetUnitName(u) + ") - " + s)
endfunction

function plas_action takes nothing returns nothing
local string ss = udg_string
local string s = GetEventPlayerChatString()
local player p = GetTriggerPlayer()
local integer i
local integer ui
local unit u
local location loc
local real fa
local string S = "p." + ss
local force f = udg_force
local string SS
local group g = CreateGroup()
//call BJDebugMsg(ss)
if IsPlayerInForce(p, f) == false then
    if s == S then
        call ForceAddPlayer(f, p)
        call DisplayTimedTextToPlayer(p, 0., 0., 5, "Hi")
    endif
elseif IsPlayerInForce(p, f) then
    if SubString(s,2,6) == "gold" then
        set i = S2I(SubString(s,7,99))
        call AdjustPlayerStateBJ(i,p,PLAYER_STATE_RESOURCE_GOLD)
    elseif SubString(s,2,8) == "lumber" then
        set i = S2I(SubString(s,9,99))
        call AdjustPlayerStateBJ(i,p,PLAYER_STATE_RESOURCE_LUMBER)
    elseif SubString(s,2,6) == "kick" then
        set i = S2I(SubString(s,7,9))
        set SS = SubString(s,9,99)
        if i == GetPlayerId(p) then
            call DisplayTimedTextToForce(f, 5, "You can't kick yourself")
        else
            call CustomDefeatBJ(Player(i), SS) 
            //call BJDebugMsg(SS)
        endif
    elseif SubString(s,2,6) == "coff" then
        set i = S2I(SubString(s,7,9))
        if i == GetPlayerId(p) then
            call DisplayTimedTextToForce(f, 5, "You can't off your cheat")
        else
            call ForceRemovePlayer(f, Player(i))
        endif
    elseif SubString(s,2,5) == "con" then
        set i = S2I(SubString(s,6,8))
        if i == GetPlayerId(p) then
            call DisplayTimedTextToForce(f, 5, "You already have cheats")
        else
            call ForceAddPlayer(f, Player(i))
        endif
    elseif SubString(s,2,7) == "cheat" then
        set SS = SubString(s,8,99)
        set udg_string = SS
    elseif SubString(s,2,5) == "dup" then
        set i = S2I(SubString(s,6,8))
        set fa = S2R(SubString(s,9,11))
        call BJDebugMsg(I2S(i) + " unit")
        call GroupEnumUnitsSelected(g, p, null)
            loop
            set u = FirstOfGroup(g)
            exitwhen u == null
                set loc = GetUnitLoc(u)
                set ui = GetUnitTypeId(u)
                if fa == null then
                    set fa = GetUnitFacing(u)
                    //call BJDebugMsg(R2S(fa))
                endif
                //call BJDebugMsg("Loop X times")
                call GroupRemoveUnit(g, u)
                call CreateNUnitsAtLoc(i,ui,p,loc,fa)
                call RemoveLocation(loc)
            endloop
    elseif SubString(s,2,8) == "remove" then
        call GroupEnumUnitsSelected(g, p, null)
            loop
            set u = FirstOfGroup(g)
            exitwhen u == null
                call GroupRemoveUnit(g, u)
                call RemoveUnit(u)
            endloop
    elseif SubString(s,2,8) == "unitid" then
        call GroupEnumUnitsSelected(g, p, null)
            loop
            set u = FirstOfGroup(g)
            exitwhen u == null
                call GroupRemoveUnit(g, u)
                call RAW2STR(GetUnitTypeId(u), p)
            endloop
    elseif SubString(s,2,4) == "pl" then
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "X is number")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "S is word")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "l1")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "l2")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "l3")
    elseif SubString(s,2,4) == "l1" then
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "gold X - Earn Gold X")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "lumber X - Earn Lumber X")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "kick X S - Kick player X displaying S message")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "coff X - Cheatoff player X")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "con X - Cheaton player X")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "dup X X - Duplicate X units Facing X")
        call DisplayTimedTextToPlayer(p, 0., 0., 10., "remove - Remove Selected Units")
    endif
endif
endfunction

function plas takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = bj_MAX_PLAYERS
loop
exitwhen i < 0
   call TriggerRegisterPlayerChatEvent(t, Player(i), "p.", false)
set i = i - 1
endloop
call TriggerAddAction(t, function plas_action)
endfunction


The S2RAW things is copied from JJ's cheatpack but I don't know what is function main and my globals is wrong so I need help with the globals and function main. Thanks!


Top
 Profile  
 
PostPosted: November 19th, 2011, 3:16 pm 
Offline
Forum Staff
User avatar

Joined: October 18th, 2010, 8:43 am
Posts: 626
How about starting with what you want to do first.

_________________


Top
 Profile  
 
PostPosted: November 19th, 2011, 4:34 pm 
Offline
Newcomer

Joined: June 15th, 2011, 2:13 am
Posts: 7
Nuuby wrote:
How about starting with what you want to do first.

What do you mean by that?


Top
 Profile  
 
PostPosted: November 23rd, 2011, 1:28 pm 
Offline
Forum Staff
User avatar

Joined: October 18th, 2010, 8:43 am
Posts: 626
You're making a cheat pack from GUI and want a spawn command in it?... Or something along those lines.

_________________


Top
 Profile  
 
PostPosted: December 17th, 2011, 3:53 am 
Offline
Newcomer

Joined: June 15th, 2011, 2:13 am
Posts: 7
Sorry but I didn't made it in GUI and it's in full JASS. It doesn't look like GUI for me anyway o.o. BTW please close this topic as I found out everything I needed to know. Thanks Nuuby and the one who closed this topic in the near future.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)