Jump to content

مساعده getTickCount ب ثواني


iiv03

Recommended Posts

السلام عليكم كيف اخلي getTickCount

يجيب لي ارقام ثواني ؟

مشكله تجيني الثواني

6131426.80785

محاولتي

local TiempoPr = 0
addEvent("onPlayerSpray", true)
addEventHandler("onPlayerSpray", root, function(rockets)
    if ( getTickCount ( ) - TiempoPr > 5000 ) then 
        TiempoPr = getTickCount ( ) 
	outputChatBox("Player #FFFFFF"..getPlayerName(source).." #FFFFFFhas shot #aacccc["..rockets.." #ffffffrockets in #ffffff"..TiempoPr.." #ffffffseconds]", root, 255, 255, 255, true)
	end
	end
)

 

Edited by xFabel
Link to comment

جرب كذا

local TiempoPr = getTickCount()
addEvent("onPlayerSpray", true)
addEventHandler("onPlayerSpray", root, function(rockets)
    local tick = getTickCount()
    if (tick - TiempoPr > 5000) then
        outputChatBox("Player #FFFFFF"..getPlayerName(source).." #FFFFFFhas shot #aacccc["..rockets.." #ffffffrockets in #ffffff"..math.floor((tick - TiempoPr) / 1000).." #ffffffseconds]", root, 255, 255, 255, true)
        TiempoPr = tick
    end
end)

 

Edited by xiRocKyz
  • Like 1
Link to comment
local TiempoPr = getTickCount()

addEvent("onPlayerSpray", true)
addEventHandler("onPlayerSpray", root, function(rockets)
	local current = math.floor ( ( getTickCount() - TiempoPr ) / 1000 )
		if ( current > 5 ) then  
			outputChatBox("Player #FFFFFF"..getPlayerName(source).." #FFFFFFhas shot #aacccc["..rockets.." #ffffffrockets in #ffffff"..current.." #ffffffseconds]", root, 255, 255, 255, true)
		end
	end
)

 

  • Like 1
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...