Deadmau5 Posted June 18, 2012 Share Posted June 18, 2012 Subject says it all... local x, y = guiGetScreenSize () local localPlayer = getLocalPlayer() local spectators = {} addEvent('addSpectator', true) addEvent('removeSpectator', true) addEventHandler('onClientResourceStart', root, function() triggerServerEvent ('addClient', localPlayer) local screenWidth, screenHeight = guiGetScreenSize() g_dxGUI = { spectators = dxText:create('Spectators:', 2, screenHeight - dxGetFontHeight(0.0, 'bankgothic')-40, false, 'default-bold', 1, 'left'), spectatorsCount = dxText:create('0', 70, screenHeight - dxGetFontHeight(0.0, 'bankgothic')-40, false, 'default-bold', 1, 'left') } g_dxGUI.spectators:color(255, 128, 0, 255) g_dxGUI.spectatorsCount:color(255, 255, 255, 255) end ) addEventHandler('addSpectator', root, function(spectator) table.insert(spectators, spectator) end ) addEventHandler('removeSpectator', root, function(spectator) for i, val in ipairs(spectators) do if (val == spectator) then table.remove(spectators, i) end end end ) function elementCheck (elem) if elem then if isElement (elem) then if (getElementType (elem) == 'player') then return true end end end return false end function drawSpectators() g_dxGUI.spectatorsCount:text(#spectators) end addEventHandler('onClientRender', root, drawSpectators) Link to comment
-ffs-Sniper Posted July 5, 2012 Share Posted July 5, 2012 Where is the rest of the code? I am 90% sure this is stolen. Link to comment
HunT Posted July 5, 2012 Share Posted July 5, 2012 https://community.multitheftauto.com/ind ... ls&id=5028 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