wc3edit.net

United Warcraft 3 map hacking!
It is currently May 31st, 2020, 10:24 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: April 17th, 2020, 2:29 am 
Offline
Newcomer

Joined: September 20th, 2018, 10:50 am
Posts: 2
Map: Hero of The Empire 1.25b

Link map: http://hero-empire.com/load/download_he ... b/1-1-0-84

Request: Custom Commands

I just want commands like "-gold" or "-givegold". This is a great map, i want to beat it with my friends as legit as possible. But most of the time we lost because we lack the gold to buy better equipment

Thanks in advance to anyone who could do this!


Top
 Profile  
 
PostPosted: April 17th, 2020, 3:21 am 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2331
There's no point requesting a single command btw, it's easier to just add a full cheatpack.
But I actually love writing code so I made a custom command anyways.

Type -gold x to receive x gold
(i.e. -gold 100 gives you 100 gold)

This is the code for the command. Simple & short.
Spoiler:
Code:
globals
endglobals

function cc_givegold_cmd_act takes nothing returns nothing
    local player p = GetTriggerPlayer()
    local string src = GetEventPlayerChatString()
    local integer currentGold = GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)
    local string commandPart = SubString(src,0,6)
    local string goldPart = SubString(src,6,999)
    if(commandPart == "-gold ")then
        call SetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD, currentGold + S2I(goldPart))
    endif
endfunction

function cc_givegold_cmd_init takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    loop
        exitwhen i > 24
        call TriggerRegisterPlayerChatEvent(t, Player(i), "-gold ", false)
        set i = i + 1
    endloop
    call TriggerAddAction(t, function cc_givegold_cmd_act)
    set t = null
endfunction

function main takes nothing returns nothing
    call cc_givegold_cmd_init()
endfunction


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: May 8th, 2020, 4:31 pm 
Offline
Newcomer

Joined: February 17th, 2020, 12:31 pm
Posts: 5
I want.how to edit size map.i edit finish but big size can't to creing for play :3


Top
 Profile  
 
PostPosted: May 8th, 2020, 10:13 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2331
You can't edit the map size without losing parts of the map.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 21 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)