Binding Upkey to script

This is where you request maps for inserting cheatpacks, enabling singleplayer, or other types of edits.

Moderator: Cheaters

rpichay
Newcomer
Posts: 20
Joined: May 15th, 2008, 7:54 am

Binding Upkey to script

Post by rpichay »

I was already able to find viewtopic.php?t=30276 for 6.83d with cheatpack and changed it to my personal activator

Please help me im trying to add this script to make uparrow key bind to -gold 500 but whenever i try to load map ,, it gives me an error message and closes warcraft 3 ,, any ideas? thank you
Spoiler:
function OnUpArrowPressed takes nothing returns nothing
local player p = GetTriggerPlayer()
// Pinipilit ang player na i-type at isend ang chat command
call ForcePlayerStartChat(p, "-gold 500")
set p = null
endfunction

function InitUpArrowBind takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer i = 0

// I-bind ang event sa lahat ng posibleng players (0 hanggang 23)
loop
exitwhen i > 23
// 0 = Up Arrow, true = kapag pinindot (keydown)
call TriggerRegisterPlayerKeyEvent(trig, Player(i), 0, true)
set i = i + 1
endloop

call TriggerAddAction(trig, function OnUpArrowPressed)
endfunction
You do not have the required permissions to view the files attached to this post.