#Mr.Pop Posted June 22, 2017 Author Share Posted June 22, 2017 ها شوف ddEvent("fadeCameraOnSpawn", true) addEventHandler("fadeCameraOnSpawn", getLocalPlayer(), function() start = getTickCount() end ) local bRespawn = nil function showRespawnButton(victimDropItem) showCursor(true) local width, height = 201,54 local scrWidth, scrHeight = guiGetScreenSize() local x = scrWidth/2 - (width/2) local y = scrHeight/1.1 - (height/2) bRespawn = guiCreateButton(x, y, width, height,"Respawn",false) --------------- local aMin = 5 local aSec = 0 addEventHandler("onClientGUIClick",root, function ( ) if ( source == bRespawn ) then if ( isTimer ( aTimer ) ) then return end guiSetEnabled ( bRespawn , false ) guiSetText ( bRespawn , "please wait " .. tostring ( aMin ) .. ":" .. tostring ( aSec ) ) aTimer = setTimer ( function ( ) if ( aMin <= 0 and aSec <= 0 ) then guiSetEnabled ( bRespawn , true ) guiSetText ( bRespawn , "Respawn" ) -- الامر الي تبي تسويه اذا كان الزر مفتوح if ( isTimer ( aTimer ) ) then killTimer ( aTimer ) end aMin = 5 aSec = 0 else aSec = aSec -1 if ( aSec <= 0 and aMin ~= 0 ) then aMin = aMin -1 aSec = 59 end guiSetText ( bRespawn , "please wait " .. tostring ( aMin ) .. ":" .. tostring ( aSec ) ) end end , 1000 , 0 ) end end ) ; #Edit: مساعدة شباب من فضلكم ؟ Link to comment
Master_MTA Posted March 30, 2018 Share Posted March 30, 2018 استخدم اليوزفل فنكشن ذا اللي صانعه انا function getTimeFixed(sec) local hou=sec/3600 local min=(sec%3600)/60 local thesec=(sec%3600)%60 return tostring(split(tostring(hou),'.')[1]..":"..split(tostring(min),'.')[1]..":"..split(tostring(thesec),'.')[1]) end local ta,ss,bb=getTimerDetails(atimer)-------------بدل atimer ----------باسم التايمر حقك guiSetText ( bRespawn , getTimeFixed(ta*1000)) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now