Jump to content

Zekrom=

Members
  • Posts

    5
  • Joined

  • Last visited

Zekrom='s Achievements

Vic

Vic (3/54)

0

Reputation

  1. I want to do borders for a spectators script, but i failed , can someone help me with this ? local x, y = guiGetScreenSize () local localPlayer = getLocalPlayer() local spectatorSettings = { count = 7, -- how many player names to show, before showing "and x more" charLimit = 19, -- max limit of characters in player name xOffset = 200, -- how far to the left this should be yOffset = (y / 2) - 10, -- how far down the screen this should be ~ currently it is almost half way down alwaysShow = true -- whether to show anything if there aren't any players spectating you } local spectators = {} addEvent('addSpectator', true) addEvent('removeSpectator', true) addEventHandler('onClientResourceStart', root, function() triggerServerEvent ('addClient', localPlayer) 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() local textX = x - spectatorSettings.xOffset local textY = spectatorSettings.yOffset if (not isPlayerDead(localPlayer)) then local s_Spectators = 'Spectadores ['.. tostring(#spectators) ..']\n' if (#spectators > 0) then for i, v in ipairs(spectators) do if elementCheck (v) then local name = getPlayerName(v):gsub("#%x%x%x%x%x%x","") if (string.len(getPlayerName(v)) > spectatorSettings.charLimit) then name = string.sub(name, 0, spectatorSettings.charLimit)..'..' end if (i > spectatorSettings.count) then s_Spectators = s_Spectators..tostring(#spectators - spectatorSettings.count)..' more' break else s_Spectators = s_Spectators..name..'\n' end else table.remove (spectators, k) end end else if (spectatorSettings.alwaysShow) then s_Spectators = s_Spectators..'None' else s_Spectators = '/' end end dxDrawText (s_Spectators, textX, textY, x, y, tocolor(255, 225, 255, 255, true ), 0.5, 'Bankgothic') dxDrawText (s_Spectators, textX, textY, x, y, tocolor(0, 0, 0, 0), 0.5, 'Bankgothic') --dxDrawText("Spectating [".. tostring(#spectators) .."]", 825, y-410, x, y, tocolor ( 255, 255, 255, 255, true ), 0.5, "bankgothic" ) end end addEventHandler('onClientRender', root, drawSpectators) Thank You !
  2. Yeah!, it work ! Thank you !! I found something, if i write /ltd (any word) in the chat says : Zekrom Says learn to Drive (the word)!, Is there any way to do that just to put the names of the players?, And if the player is not there say in the chat: Player not found? Again, Thank You !
  3. I am a new in the scripter's world, Im doing a commands script for race, i make a command called /ltd, ''Learn to drive'', but i want to write /ltd (a player name) and in the chat see ''Zekrom Says Learn to drive ( player name)!'' addCommandHandler("ltd", function (thePlayer) outputChatBox(getPlayerName(thePlayer).." #0099ffSays #ffffffLearn To #0099ffDrive!!",getRootElement(), 255, 255, 255, true ) end) Help please
×
×
  • Create New...