Jump to content

yusufbali

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by yusufbali

  1. Thanks for help. I dont have enough scripting knowledge so i cant upgrade that thing but if its not give me fps drops its okay .
  2. Hi, i have a script for my destruction derby server it name is dashboard you all know i think this script but i have questions. when i start that script i take so much "INFO:Updating ranks for all players" on server's console. 1-is that thing normal? 2-will that thing give fps problem for players 3-if its a problem how can i fix it this is server's console;
  3. but it's default lua not mine if there is no why they coded this and warning says argument 3 got nil
  4. I use default joiner_client.lua but this give warning i dont understand. Line 39: Bad Argument 'AddEventHandler'[Expected function at argument 3 , got nil] -- joiner_client.lua -- -- see joiner.lua for details -- g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) addEvent('onClientPlayerJoining') -- Pre join addEvent('onClientPlayerJoined') -- Post join g_JoinedPlayers = {} -- List of joined players maintained at the client --------------------------------- -- -- Hook events -- --------------------------------- g_EventHandlers = { onClientPlayerJoin = {}, -- { i = { elem = elem, fn = fn, getpropagated = bool } } onClientResourceStart = {} } -- Divert 'onEventName' to '_onEventName' for eventName,_ in pairs(g_EventHandlers) do addEvent('_'..eventName) addEventHandler(eventName, g_Root, function(...) triggerEvent( '_'..eventName, source, ... ) end) end -- Catch addEventHandler calls here and save the ones listed in g_EventHandlers _addEventHandler = addEventHandler function addEventHandler(event, elem, fn, getPropagated) getPropagated = getPropagated==nil and true or getPropagated if g_EventHandlers[event] then table.insert(g_EventHandlers[event], { elem = elem, fn = fn, getpropagated = getPropagated }) else _addEventHandler(event, elem, fn, getPropagated) end end
  5. It works thanks boss you are the best for me
  6. Note:Sıra mean rank (maybe it helpful) , please help guys last warning in my server. client.lua:16: Bad argument @'setElementData'[Expected element at agument 1,got nil] Client; function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function siramiayarla(name, i) local player = getPlayerFromPartialName(name) setElementData(player,"Sıra",i) end addEvent("siraayarla", true) addEventHandler("siraayarla", root, siramiayarla) And server event; function createTopSystem( player ) if not isElement( player ) then return end local Top = {} local CreatTop = executeSQLQuery( "SELECT * FROM stats6" ) for i = 1, #CreatTop do table.insert(Top,{nickim = CreatTop[i].nickim,puan = CreatTop[i].puan}) end if #CreatTop >0 then table.sort(Top, function(a,b) return (tonumber(a.puan)or 0) > (tonumber(b.puan)or 0) end) setTimer( function() for k, data in ipairs(Top) do triggerClientEvent (player,"siraayarla",player,tostring(data.nickim),tonumber(k)) end end, 50, 1 ) end end
  7. function createTopSystem( player ) if not isElement( player ) then return end local Top = {} local CreatTop = executeSQLQuery( "SELECT * FROM stats6" ) for i = 1, #CreatTop do table.insert(Top,{nickim = CreatTop[i].nickim,puan = CreatTop[i].puan}) end if #CreatTop >0 then table.sort(Top, function(a,b) return (tonumber(a.puan)or 0) > (tonumber(b.puan)or 0) end) setTimer( function() for k, data in ipairs(Top) do triggerClientEvent (player,"siraayarla",player,tostring(data.nickim),tonumber(k)) end end, 50, 1 ) end end Same warning, @1 player found @2 player not found . NameCrysler /i:2
  8. Please help me, i try but i can't fix this. Im newbie client.lua:16: Bad argument @'setElementData'[Expected element at agument 1,got nil] function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function siramiayarla(name, i) local player = getPlayerFromPartialName(name) setElementData(player,"Sıra",i) end addEvent("siraayarla", true) addEventHandler("siraayarla", root, siramiayarla)
  9. Hi Guys, I want help to you. local root = getRootElement() local player = getLocalPlayer() local counter = 0 local starttick local currenttick addEventHandler("onClientRender",root, function() if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"FPS",counter) counter = 0 starttick = false end end ) function drawStates () addEventHandler ( "onClientRender", root, pingFpsCiz ) end addEventHandler ( "onClientResourceStart", resourceRoot, drawStates ) myFont4 = dxCreateFont("fps.ttf", 12 ) function pingFpsCiz() x,y = guiGetScreenSize() local ping = getPlayerPing(getLocalPlayer()) dxDrawText("Ping", 1115/1366*x, 0/768*y, 590/1366*x, 26/768*y, tocolor(255, 255, 255, 255), 0.95, myFont4, "left", "center", false, false, false, true, false) dxDrawText("Fps", 1035/1366*x, 0/768*y, 590/1366*x, 26/768*y, tocolor(255, 255, 255, 255), 0.95, myFont4, "left", "center", false, false, false, true, false) if (ping <= 25) then dxDrawText("#00ff00"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (ping >= 26) and (ping <= 40) then dxDrawText("#5dff00"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (ping >= 41) and (ping <= 60) then dxDrawText("#a6f900"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (ping >= 61) and (ping <= 80) then dxDrawText("#defc00"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (ping >= 81) and (ping <= 100) then dxDrawText("#ffee00"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (ping >= 101) and (ping <= 110) then dxDrawText("#fcb400"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (ping >= 110) then dxDrawText("#fc3f00"..getPlayerPing(getLocalPlayer()), 1660/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end local fps = getElementData(getLocalPlayer(),"FPS") if (fps >= 50) then dxDrawText("#00ff00"..getElementData(getLocalPlayer(),"FPS"), 1500/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (fps <= 49) and (fps >= 45) then dxDrawText("#5dff00"..getElementData(getLocalPlayer(),"FPS"), 1500/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (fps <= 44) and (fps >= 40) then dxDrawText("#defc00"..getElementData(getLocalPlayer(),"FPS"), 1500/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (fps <= 39) and (fps >= 35) then dxDrawText("#fcb400"..getElementData(getLocalPlayer(),"FPS"), 1500/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end if (fps <= 34) then dxDrawText("#fcb400"..getElementData(getLocalPlayer(),"FPS"), 1500/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end end client.lua:542:Attempt to compare number with boolean client.lua:542:Attempt to compare number with boolean [DUP x52] This is 542: if (fps >= 50) then dxDrawText("#00ff00"..getElementData(getLocalPlayer(),"FPS"), 1500/1366*x, 35/768*y, 590/1366*x, 30/768*y, tocolor(13, 241, 131, 255), 1.0, myFont4, "center", "top", false, false, false, true, false) end Why only this line give error and what i mistake ?
  10. I just wanna when i say /kazandik , everyone see this but now when i say /kazandik only i see this and only i listen that music . Help please I am newbie function startMusic() setRadioChannel(0) song = playSound("music2.mp3",true) outputChatBox ( "#FFFFFFGenius Monsters #33ff00Kazandı!", 255, 255, 255, true ) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addCommandHandler ( "kazandik", startMusic ) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("musicmusic",toggleSong) bindKey("m","down","musicmusic")
×
×
  • Create New...