Jump to content

xRGamingx

Members
  • Posts

    191
  • Joined

  • Last visited

Everything posted by xRGamingx

  1. xRGamingx

    topbarchat

    local sX, sY = guiGetScreenSize() local dxMessages = {} local dxMessagesY = {-25, -25, -25, -25} local dxMessagesTick = {} local isMoving = false function drawMessages() for index, messageData in pairs(dxMessages) do dxDrawText(messageData[1], sX / 4 + 1, (sY / 900) * (dxMessagesY[index] * 2) + 1, (sX / 4) * 3 + 1, (sY / 900) * 25 + 1, tocolor(0, 0, 0, 255), (sX / 1440) * 1.1, "default-bold", "center", "center", false, true, false) dxDrawText(messageData[1], sX / 4 + 1, (sY / 900) * (dxMessagesY[index] * 2) - 1, (sX / 4) * 3 + 1, (sY / 900) * 25 - 1, tocolor(0, 0, 0, 255), (sX / 1440) * 1.1, "default-bold", "center", "center", false, true, false) dxDrawText(messageData[1], sX / 4 - 1, (sY / 900) * (dxMessagesY[index] * 2) + 1, (sX / 4) * 3 - 1, (sY / 900) * 25 + 1, tocolor(0, 0, 0, 255), (sX / 1440) * 1.1, "default-bold", "center", "center", false, true, false) dxDrawText(messageData[1], sX / 4 - 1, (sY / 900) * (dxMessagesY[index] * 2) - 1, (sX / 4) * 3 - 1, (sY / 900) * 25 - 1, tocolor(0, 0, 0, 255), (sX / 1440) * 1.1, "default-bold", "center", "center", false, true, false) dxDrawText(messageData[1], sX / 4, (sY / 900) * (dxMessagesY[index] * 2), (sX / 4) * 3, (sY / 900) * 25, tocolor(messageData[2], messageData[3], messageData[4], 255), (sX / 1440) * 1.1, "default-bold", "center", "center", false, true, false) end end addEventHandler("onClientRender", root, drawMessages) function new(message, r, g, b) message = tostring(message) if (dxGetTextWidth(message, (sX / 1440), "default-bold") > 750) then new(message:sub(1, 747).."...", 255, 0, 0) return end r, g, b = r or 255, g or 255, b or 255 if (#dxMessages == 4 or isMoving) then Timer(new, 1000, 1, message, r, g, b) return end table.insert(dxMessages, {message, r, g, b}) dxMessagesTick[#dxMessages] = getTickCount() addEventHandler("onClientRender", root, addMessage) isMoving = true outputConsole(message) end addEvent("dx.new", true) addEventHandler("dx.new", root, new) function addMessage() local index = #dxMessages local difference = (sY / 900) * 1.5 dxMessagesY[index] = dxMessagesY[index] + difference if dxMessagesY[index] >= (index - 1) * 25 then dxMessagesY[index] = (index - 1) * 25 if #dxMessages == 4 then isMoving = true addEventHandler("onClientRender", root, removeMessage) removeEventHandler("onClientRender", root, addMessage) else isMoving = false removeEventHandler("onClientRender", root, addMessage) end end end function removeMessage() local difference = (sY / 900) * 1.5 for index = 1, #dxMessages do dxMessagesY[index] = dxMessagesY[index] - difference end if dxMessagesY[1] <= -25 then for index = 1, #dxMessages do dxMessages[index] = dxMessages[index + 1] dxMessagesTick[index] = dxMessagesTick[index + 1] dxMessagesY[index] = (index - 1) * 25 end isMoving = false removeEventHandler("onClientRender", root, removeMessage) for index = 1, #dxMessagesY do if not dxMessages[index] then dxMessagesY[index] = -25 end end end end function removeReadMessages() for index, message in pairs(dxMessages) do local currentTick = getTickCount() if currentTick - dxMessagesTick[index] >= 7500 then removeMessage() end end end addEventHandler("onClientRender", root, removeReadMessages) function clear() for i = 1, #dxMessages do removeMessage() end dxMessages = {} dxMessagesY = {-25, -25, -25, -25} dxMessagesTick = {} isMoving = false if (#getEventHandlers("onClientRender", root, removeMessage) > 0) then removeEventHandler("onClientRender", root, removeMessage) end if (#getEventHandlers("onClientRender", root, addMessage) > 0) then removeEventHandler("onClientRender", root, addMessage) end end addCommandHandler("cleardx", clear, false, false) Hello, I am trying to add a dxretangle to this topbarchat so that it comes out with messages But I get an error, does someone help me? the first attempt went well, but when 2 texts come out together, the rentague is bugge
  2. Friend does not work with any What I want to achieve is to create race events within my RPG mode server with checkpoint help plz . Or if you have an equal script to help me
  3. Hello friend, this still does not work.. pass me the code the way you use it in your test for me to put it as is in mine because it still does not work, the first checkpoint appears, but when you touch it it does not disappear to see the next one
  4. friend the debug script 3 is activated and does not throw me error local markers = { {1942.0526123047, -1702.3355712891, 13.3828125}; {1942.302734375, -1715.2150878906, 12.792504310608}; } local curMarkerBlip local curMarker local ID function event() call(getResourceFromName("guitext"),"outputServerGuiText",root,"An event was placed on your Map",0,255,0) createCheckpoint( 1 ) ID = 1 end addEvent ("event", true) addEventHandler ("event", root, event) function createCheckpoint(ID) if ID then if isElement(curMarker) and isElement(curMarkerBlip) then destroyElement(curMarker) destroyElement(curMarkerBlip) end local x, y, z = unpack(markers[tonumber(ID)]) curMarker = createMarker( x, y, z, "checkpoint", 2, 135, 191, 255, 200 ) curMarkerBlip = createBlipAttachedTo( curMarker, 0 ) return true end return false end addEventHandler( "onClientMarkerHit", resourceRoot, function (hitPlayer, dim) if (curMarker and source == curMarker and hitPlayer == localPlayer and dim) then ID = ID + 1 if ID > #markers then ID = 1 end createCheckpoint( ID ) -- create the next checkpoint end end )
  5. I already did it but the checkpoint does not disappear when I touch it
  6. xRGamingx

    checkpoint

    Hello friends, I need your help! I explain that I have an event panel to create careers for players on my freeroam server Through the panel I must create all racing checkpoint. And what I want to achieve is that when the player passes over the point, that disappears and the next checkpoint comes out I leave my code tell me how I can achieve this Or if they have a similar panel, I would like them to contribute with the ---Server blip = {} marker = {} function event () call(getResourceFromName("guitext"),"outputServerGuiText",root,"An event was placed on your Map",0,255,0) local x, y, z = getElementPosition (source) local maxBlip = #blip -- with this you have the contents of the table. local maxMarker = #marker blip[maxBlip + 1] = createBlip (x, y, z, 49) marker[maxMarker + 1] = createMarker (x, y, z, "checkpoint", 2, 135, 191, 255, 200) end addEvent ("event", true) addEventHandler ("event", root, event)
  7. error > local getMuteTimerDetails = math.floor(getTimerDetails( timerMute )) -- here
  8. And how would it be then in this case?
  9. xRGamingx

    Muted

    Broth time does not fade... I mute 1 minute and the message goes out and says mute 60000 and after the minute passes the text and time disappears..
  10. Hello friends, Because the mute time does not fade ? ? If I give 1 minute mute, the time stays at 60000.. 1 minute = 60000 Milliseconds --Client--- local muteTime = 0 local timerMute = nil local mute = false function drawMuteTime( ) local screenW, screenH = guiGetScreenSize() if muteTime > 0 and mute == true then -----------162 LINE-------- dxDrawText("Muted time: "..muteTime, screenW * 0.0078, screenH * 0.6094, screenW * 0.2727, screenH * 0.6484, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end end addEventHandler( "onClientRender", root, drawMuteTime ) addEvent( "mute:mutePlayer" ) addEventHandler( "mute:mutePlayer", getRootElement( ), function( time ) mute = true if timerMute then timerMute = nil end timerMute = setTimer( function( ) muteTime = 0 mute = false end, time, 1) muteTime = math.floor(getTimerDetails( timerMute )) end ) addEvent( "mute:unMutePlayer" ) addEventHandler( "mute:unMutePlayer", getRootElement( ), function( ) muteTime = 0 mute = false end ) --------------- ----Server function mute (player, time, rz) local times = getRealTime () local day = times.monthday local mes = times.month local yea = times.year local sec = times.second local min = times.minute local hou = times.hour local el = getPlayerFromName (player) local ad = getPlayerName (source) if el and rz then if time and tonumber(time) ~= nil then if getElementData(el, "Lv") <= getElementData(source, "Lv") then if not isPlayerMuted (el) then setPlayerMuted (el, true) local respeto = getPedStat (el, 64) setPedStat (el, 64, respeto-15) if not isGuestAccount (getPlayerAccount(el)) then executeSQLQuery("INSERT INTO Punish (Date, Element, Admin, Time, Reason) VALUES ('["..hou..":"..min..":"..sec.."("..day.."/"..(mes+1).."/"..yea..")]', '"..getAccountName(getPlayerAccount(el)).."', '"..ad.."', '"..time.." Min', '[Mute]"..rz.."')") end outputChatBox (ad.." Muted to "..player.." "..tonumber(time).." Min by: ("..rz..").", root, 255, 0, 0) setElementData (el, "NGtimeMute", time) setElementData(el,"NGGangMute",true) outputDebugString (ad.." Muted to "..player.." "..tonumber(time).." Min by: ("..rz..").") setTimer (desmutar, time*60*1000, 1, el) triggerClientEvent( el, "mute:mutePlayer", el, time*60*1000 ) else setPlayerMuted (el, false) setElementData(el,"NGGangMute",false) outputChatBox (ad.." Break to "..player, root, 255, 0, 0) outputDebugString (ad.." Break to "..player) setElementData (source, "NGTimeMute", 0) end else --outputChatBox (".", source, 255, 0, 0) end end else".", source, 255, 0,0) end end addEvent ("mute", true) addEventHandler ("mute", root, mute) function desmutar (player) if player and isElement(player) then if isPlayerMuted(player) then setPlayerMuted (player, false) setElementData (player, "NGTiempoMute", 0) triggerClientEvent( player, "mute:unMutePlayer", player ) outputChatBox (getPlayerName(player).."(FinISH del Mute)", root, 0, 255, 0) outputDebugString (getPlayerName(player).." It was desmutado (Finish Mute)") end end end -------------------------------------------------------------------------------- Mute Evade Fix addEventHandler ("onPlayerQuit", root, function () if not isGuestAccount(getPlayerAccount(source)) then if isPlayerMuted (source) then setAccountData (getPlayerAccount(source), "NGMuteEvade", getElementData(source, "NGtimeMute")) else setAccountData (getPlayerAccount(source), "NGMuteEvade", 0) end end end) addEventHandler ("onPlayerLogin", root, function () local ismute = getAccountData (getPlayerAccount(source), "NGMuteEvade") if ismute then if tonumber(ismute) >= 1 then setPlayerMuted(source, true) setElementData (source, "NGtimeMute", ismute) setTimer (desmutar, ismute*60*1000, 1, source) triggerClientEvent( el, "mute:mutePlayer", el, ismute*60*1000 ) outputChatBox ("[Console] Muted to "..getPlayerName(source).." "..ismute.." Min by: (Evade the Last Mute).", root, 255, 0, 0) end end end)
  11. xRGamingx

    Muted

    ----Broth local muteTime = 0 local mute = false function drawMuteTime( ) local screenW, screenH = guiGetScreenSize() if muteTime > 0 and mute = true then -----------162 LINE-------- dxDrawText("Muted time: "..muteTime, screenW * 0.0078, screenH * 0.6094, screenW * 0.2727, screenH * 0.6484, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end end addEventHandler( "onClientRender", root, drawMuteTime ) addEvent( "mute:mutePlayer" ) addEventHandler( "mute:mutePlayer", getRootElement( ), function( time ) muteTime = time mute = true setTimer( function( ) muteTime = 0 mute = false end, time, 1) end ) addEvent( "mute:unMutePlayer" ) addEventHandler( "mute:unMutePlayer", getRootElement( ), function( ) muteTime = 0 mute = false end )
  12. xRGamingx

    Muted

    Hello my friends I need help with a mute system And I made a dxDrawText so that the time the player takes mute leaves --Client --local function() local screenW, screenH = guiGetScreenSize() dxDrawText("Muted time min: 12", screenW * 0.0078, screenH * 0.6094, screenW * 0.2727, screenH * 0.6484, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end ----Server function mute (player, time, rz) local times = getRealTime () local day = times.monthday local mes = times.month local yea = times.year local sec = times.second local min = times.minute local hou = times.hour local el = getPlayerFromName (player) local ad = getPlayerName (source) if el and rz then if time and tonumber(time) ~= nil then if getElementData(el, "Lv") <= getElementData(source, "Lv") then if not isPlayerMuted (el) then setPlayerMuted (el, true) local respeto = getPedStat (el, 64) setPedStat (el, 64, respeto-15) if not isGuestAccount (getPlayerAccount(el)) then executeSQLQuery("INSERT INTO Punish (Date, Element, Admin, Time, Reason) VALUES ('["..hou..":"..min..":"..sec.."("..day.."/"..(mes+1).."/"..yea..")]', '"..getAccountName(getPlayerAccount(el)).."', '"..ad.."', '"..time.." Min', '[Mute]"..rz.."')") end outputChatBox (ad.." Muted to "..player.." "..tonumber(time).." Min by: ("..rz..").", root, 255, 0, 0) setElementData (el, "NGtimeMute", time) setElementData(el,"NGGangMute",true) outputDebugString (ad.." Muted to "..player.." "..tonumber(time).." Min by: ("..rz..").") setTimer (desmutar, time*60*1000, 1, el) else setPlayerMuted (el, false) setElementData(el,"NGGangMute",false) outputChatBox (ad.." Break to "..player, root, 255, 0, 0) outputDebugString (ad.." Break to "..player) setElementData (source, "NGTimeMute", 0) end else --outputChatBox (".", source, 255, 0, 0) end end else".", source, 255, 0,0) end end addEvent ("mute", true) addEventHandler ("mute", root, mute) function desmutar (player) if player and isElement(player) then if isPlayerMuted(player) then setPlayerMuted (player, false) setElementData (player, "NGTiempoMute", 0) outputChatBox (getPlayerName(player).."(FinISH del Mute)", root, 0, 255, 0) outputDebugString (getPlayerName(player).." It was desmutado (Finish Mute)") end end end -------------------------------------------------------------------------------- Mute Evade Fix addEventHandler ("onPlayerQuit", root, function () if not isGuestAccount(getPlayerAccount(source)) then if isPlayerMuted (source) then setAccountData (getPlayerAccount(source), "NGMuteEvade", getElementData(source, "NGtimeMute")) else setAccountData (getPlayerAccount(source), "NGMuteEvade", 0) end end end) addEventHandler ("onPlayerLogin", root, function () local ismute = getAccountData (getPlayerAccount(source), "NGMuteEvade") if ismute then if tonumber(ismute) >= 1 then setPlayerMuted(source, true) setElementData (source, "NGtimeMute", ismute) setTimer (desmutar, ismute*60*1000, 1, source) outputChatBox ("[Console] Muted to "..getPlayerName(source).." "..ismute.." Min by: (Evade the Last Mute).", root, 255, 0, 0) end end end) Img:
  13. xRGamingx

    Ping

    Hello friends I have a ping system, But I want to know something-- Problem:::: The problem is that only the ping that I have at the moment detects me And I want to see the variation of my ping.. And what I want is to have the variation of my ping in the text thanks local screenW, screenH = guiGetScreenSize() -- you don't have to get the screen size inside the render function local disappearTime = 10 -- seconds --local ping = getPlayerPing(source) local ping = getPlayerPing(getLocalPlayer()) function ping2() if ping then dxDrawText("Weapons disabled Ping+ 600 ("..ping..")", screenW * 0.0492, screenH * 0.9453, screenW * 0.2281, screenH * 0.9714, tocolor(254, 53, 53, 254), 1.00, "default-bold", "center", "top", false, false, false, false, false) end end function handlePing2Render(state) -- if you want the timer solution then just delete the --[[ and the ]] at the end and delete the code above removeEventHandler("onClientRender",getRootElement(),ping2) -- add this so there won't be errors in debugscript about event is being already handled addEventHandler("onClientRender",getRootElement(),ping2) setTimer(function() removeEventHandler("onClientRender",getRootElement(),ping2) end, disappearTime*1000, 1) end addEvent("ping1", true) addEventHandler("ping1", root, handlePing2Render)
×
×
  • Create New...