Jump to content

[BUG] Why not update the dxtext?


Tokio

Recommended Posts

i have this script, and does not update online players number, why?

local online = #getElementsByType("player")
local messagesList = {
	online.."/30",
	"SF",
}
local currentMessage = 0

addEventHandler("onClientPreRender", getRootElement(),
	function()
	local online = #getElementsByType("player")
        dxDrawText(messagesList[currentMessage + 1], screenW * 0.6014+3, screenH * 0.9656+3, screenW * 0.6556, screenH * 0.9978, tocolor(0, 0, 0, 255), 2.20, "default-bold", "center", "bottom", false, false, false, false, false)
        dxDrawText(messagesList[currentMessage + 1], screenW * 0.6014, screenH * 0.9656, screenW * 0.6556, screenH * 0.9978, tocolor(255, 255, 255, 255), 2.20, "default-bold", "center", "bottom", false, false, false, false, false)
	end
)

function updateMessage()
	if (currentMessage == 1) then
		currentMessage = 0
	else
		currentMessage = currentMessage + 1
	end
end
setTimer(updateMessage, 2000, 0)

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...