12-18-2013, 10:54 PM
Basically a small module with an OnUpdate() handler, that checks to see if certain keys are held down.
Something along those lines, not tested at all.
Code:
FlyHack = {}
lasttick = 0
function FlyHack.OnUpdateHandler( Event, ticks )
if ( (ticks - lasttick) > 200 ) then
lasttick = ticks
--keys can be found here (convert from hex to decimal) - http://nehe.gamedev.net/article/msdn_virtualkey_codes/15009/
if ( MeshManager:IsKeyPressed(038) ) then -- if holding down up key
local ppos = Player.pos
GameHacks:TeleportToXYZ(ppos.x, ppos.y + 5, ppos.z) -- fly up some predetermined value
elseif (MeshManager:IsKeyPressed(040) ) then
local ppos = Player.pos
GameHacks:TeleportToXYZ(ppos.x, ppos.y - 5, ppos.z) -- fly down some predetermined value
end
end
end
function FlyHack.ModuleInit()
end
RegisterEventHandler("Gameloop.Update",FlyHack.OnUpdateHandler) -- the normal pulse from the gameloop
RegisterEventHandler("Module.Initalize",FlyHack.ModuleInit)
Something along those lines, not tested at all.