killeryoyo Posted December 12, 2015 Share Posted December 12, 2015 Hello Guys, I was asking why the spectator arrows aren't working and the spectator is working. local dxSpec = { label = ""} function Spectate._start() outputDebug( 'SPECTATE', 'Spectate._start ' ) triggerServerEvent('onClientNotifySpectate', g_Me, true ) assert(not Spectate.active, "Spectate._start - not Spectate.active") local screenWidth, screenHeight = guiGetScreenSize() --g_GUI.specprev = guiCreateStaticImage(screenWidth/2 - 100 - 58, screenHeight - 123, 58, 82, 'img/specprev.png', true, nil) --g_GUI.specprevhi = guiCreateStaticImage(screenWidth/2 - 100 - 58, screenHeight - 123, 58, 82, 'img/specprev_hi.png', true, nil) --g_GUI.specnext = guiCreateStaticImage(screenWidth/2 + 100, screenHeight - 123, 58, 82, 'img/specnext.png', true, nil) --g_GUI.specnexthi = guiCreateStaticImage(screenWidth/2 + 100, screenHeight - 123, 58, 82, 'img/specnext_hi.png', true, nil) --g_GUI.speclabel = guiCreateLabel(screenWidth/2 - 100, screenHeight - 100, 200, 70, '', true) Spectate.updateGuiFadedOut() --guiLabelSetHorizontalAlign(g_GUI.speclabel, 'center') hideGUIComponents(--[['specprevhi', 'specnexthi']]) if Spectate.savePos then savePosition() end Spectate.setTarget( Spectate.findNewTarget(g_Me,1) ) bindKey('arrow_l', 'down', previousBind) bindKey('arrow_r', 'down', nextBind) MovePlayerAway.start() Spectate.setTarget( Spectate.target ) Spectate.validateTarget(Spectate.target) Spectate.tickTimer:setTimer( Spectate.tick, 500, 0 ) addEventHandler("onClientRender",getRootElement(),showDxSpeact) end function showDxSpeact() if getElementData(localPlayer,"loginEnabled") then return end local screenWidth, screenHeight = guiGetScreenSize() dxDrawText(dxSpec.label:gsub("%#%x%x%x%x%x%x",""),screenWidth/2+2*scale,screenHeight - 100-2*scale,screenWidth/2,screenHeight - 30,tocolor(0,0,0,255),0.4,newRace.font,"center","center",false,false,false,true,true) dxDrawText(dxSpec.label,screenWidth/2,screenHeight - 100,screenWidth/2,screenHeight - 30,tocolor(255,255,255,255),0.4,newRace.font,"center","center",false,false,false,true,true) end -- Stop spectating. Will restore position if Spectate.savePos is set function Spectate._stop() Spectate.cancelDropCamera() Spectate.tickTimer:killTimer() triggerServerEvent('onClientNotifySpectate', g_Me, false ) outputDebug( 'SPECTATE', 'Spectate._stop ' ) assert(Spectate.active, "Spectate._stop - Spectate.active") for i,name in ipairs({--[['specprev', 'specprevhi', 'specnext', 'specnexthi']]--[[, 'speclabel']]}) do if g_GUI[name] then destroyElement(g_GUI[name]) g_GUI[name] = nil end Thank you for helping. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now