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 don't click me better equipment
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.
Users browsing this forum: Bing [Bot], Google [Bot] and 60 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