function game_over()
if (get_world_state().game_frame<=get_world_state().match_frame)then
echo("TIME OUT")
else
echo("DISQUALIFIED")
end
end
add_hook("end_game","gameoverfunc",game_over)
echo("TIME OUT") happens when the time ends and echo("DISQUALIFIED") happens if one of the players gets disqualified.
Is there any way to check if a match ended in disqualification? Is there some method similar to get_bout_info that does it?
local function end_game(wt)
local wintype = 'draw'
local winner = 'none'
if wt == 0 then
wintype = 'points'
elseif wt == 2 then
wintype = 'dq'
end
local win = get_world_state().winner
if win~=-1 then
winner = get_player_info(win).name
end
echo(winner..' wins by '..wintype)
end
add_hook("end_game","DeScript__",end_game)
function EchoBla()
echo("Bla")
end
add_hook("new_mp_game", "Test", EchoBla)
but it dont do anything... is there a way to fix it?
-- x, y = get__screen_pos (number x, number y, number z)
-- USE: Returns the screen coordinates of a set of specified world coordinates
-- NOTES: -
local x, y, z = 0, 0, 0
local posx, posy = get_screen_pos(x, y, z)
echo(posx .. ", " .. posy .. " = get_screen_pos (" .. x .. ", " .. y .. ", " .. z .. ")")
^ \script\sdk\get_screen_pos.luafunction draw3dfunc()
x, y, z = get_joint_pos(0, 0)
set_color(0,0,0,1)
draw_sphere(x,y,z,0.12)
end
add_hook("draw3d","drawsphere",draw3dfunc)
function jointinfo()
get_joint_info(0).state
if state == 3 then
echo("Neck is relaxed")
else echo("Neck isn't relaxed")
add_hook("enter_frame","jointstate",jointinfo)
Ok so i just started lua a few days ago.