rabe3 Posted September 17, 2013 Share Posted September 17, 2013 السلام عليكم عندي هاذ المود كيف اخليه مع وقت يعني اذا شغلوه اول مرا مايقدرو يشغلوه الى بعد 30 ثانيه من بعد تشغيله المرا الاوله function Countdown (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) Link to comment
./BlackBird# Posted September 17, 2013 Share Posted September 17, 2013 time = {} function Countdown (player, cmd) if isTimer(time[player]) then reutrn end time[player] = setTimer(function() end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) + الكود ناقص Link to comment
rabe3 Posted September 17, 2013 Author Share Posted September 17, 2013 time = {} function Countdown (player, cmd) if isTimer(time[player]) then reutrn end time[player] = setTimer(function() end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) + الكود ناقص الكود شغال بس مايشتغل بس انا بدي اياه اذا اشتغل مرا لازم ينتضر بعد 30 ثانيه عشان يشتغل بس مايعمل Link to comment
3NAD Posted September 17, 2013 Share Posted September 17, 2013 لم يتم التجربة addNewCount = function ( count ) Count = count end Countdown = function (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) addNewCount ( 4 ) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) if isTimer ( CountDownTimer ) then killTimer ( CountDownTimer ) end CountDownTimer = setTimer ( changeCountTimer, 1000, 0 ) end addCommandHandler( "countdown", Countdown ) changeCountTimer = function ( ) if Count <= 0 then outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return killTimer ( CountDownTimer ) end addNewCount ( tonumber(Count) -1 ) outputChatBox ( "#2600FF ==="..Count.."===", getRootElement(), 255, 255, 255, true ) end Link to comment
rabe3 Posted September 17, 2013 Author Share Posted September 17, 2013 لم يتم التجربة addNewCount = function ( count ) Count = count end Countdown = function (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) addNewCount ( 4 ) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) if isTimer ( CountDownTimer ) then killTimer ( CountDownTimer ) end CountDownTimer = setTimer ( changeCountTimer, 1000, 0 ) end addCommandHandler( "countdown", Countdown ) changeCountTimer = function ( ) if Count <= 0 then outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return killTimer ( CountDownTimer ) end addNewCount ( tonumber(Count) -1 ) outputChatBox ( "#2600FF ==="..Count.."===", getRootElement(), 255, 255, 255, true ) end مازبط يشتغل بس الوقت مايعمل Link to comment
TAPL Posted September 17, 2013 Share Posted September 17, 2013 time = {} function Countdown (player, cmd) if isTimer(time[player]) then reutrn end time[player] = setTimer(function() end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) + الكود ناقص reutrn في سطر 3 عندك خطأ في كلمة return المفروض تكون + المفروض تحذف القيمة من التيبل بعد ال 30 ثانية كذا time[player] = setTimer(function(player) time[player] = nil end,30000,1, player) Link to comment
rabe3 Posted September 19, 2013 Author Share Posted September 19, 2013 time = {} function Countdown (player, cmd) if isTimer(time[player]) then reutrn end time[player] = setTimer(function() end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) + الكود ناقص reutrn في سطر 3 عندك خطأ في كلمة return المفروض تكون + المفروض تحذف القيمة من التيبل بعد ال 30 ثانية كذا time[player] = setTimer(function(player) time[player] = nil end,30000,1, player) مايعمل Link to comment
TAPL Posted September 19, 2013 Share Posted September 19, 2013 time = {} function Countdown (player, cmd) if isTimer(time[player]) then reutrn end time[player] = setTimer(function() end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) + الكود ناقص reutrn في سطر 3 عندك خطأ في كلمة return المفروض تكون + المفروض تحذف القيمة من التيبل بعد ال 30 ثانية كذا time[player] = setTimer(function(player) time[player] = nil end,30000,1, player) مايعمل http://i.imgur.com/Yr2g20Y.jpg Link to comment
3NAD Posted September 19, 2013 Share Posted September 19, 2013 لم يتم التجربة addNewCount = function ( count ) Count = count end Countdown = function (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) addNewCount ( 4 ) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) if isTimer ( CountDownTimer ) then killTimer ( CountDownTimer ) end CountDownTimer = setTimer ( changeCountTimer, 1000, 0 ) end addCommandHandler( "countdown", Countdown ) changeCountTimer = function ( ) if Count <= 0 then outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return killTimer ( CountDownTimer ) end addNewCount ( tonumber(Count) -1 ) outputChatBox ( "#2600FF ==="..Count.."===", getRootElement(), 255, 255, 255, true ) end مازبط يشتغل بس الوقت مايعمل تم التجربة والتعداد شغال .. اي وقت اللي تتكلم عنه ؟؟ Link to comment
кιηg-αвα∂у Posted September 19, 2013 Share Posted September 19, 2013 تابل هو جرب على الكود الخطأ ماعطيته الكود بعد التعديل صاحب الموضوع جرب ذا time = {} function Countdown (player, cmd) if isTimer(time[player]) then return end time[player] = setTimer(function() time[player] = nil end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) Link to comment
TAPL Posted September 19, 2013 Share Posted September 19, 2013 لم يتم التجربة addNewCount = function ( count ) Count = count end Countdown = function (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) addNewCount ( 4 ) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) if isTimer ( CountDownTimer ) then killTimer ( CountDownTimer ) end CountDownTimer = setTimer ( changeCountTimer, 1000, 0 ) end addCommandHandler( "countdown", Countdown ) changeCountTimer = function ( ) if Count <= 0 then outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return killTimer ( CountDownTimer ) end addNewCount ( tonumber(Count) -1 ) outputChatBox ( "#2600FF ==="..Count.."===", getRootElement(), 255, 255, 255, true ) end مازبط يشتغل بس الوقت مايعمل تم التجربة والتعداد شغال .. اي وقت اللي تتكلم عنه ؟؟ السلام عليكم عندي هاذ المود كيف اخليه مع وقت يعني اذا شغلوه اول مرا مايقدرو يشغلوه الى بعد 30 ثانيه من بعد تشغيله المرا الاوله @كنق عبودي انا ما عطيته كود بس كتبت ايش التعديل فيه Link to comment
3NAD Posted September 19, 2013 Share Posted September 19, 2013 addNewCount = function ( count ) Count = count end setElementData ( resourceRoot, "CountDown", false ) Countdown = function (player, cmd) if getElementData ( resourceRoot, "CountDown" ) then return end local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) addNewCount ( 4 ) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) if isTimer ( CountDownTimer ) then killTimer ( CountDownTimer ) end CountDownTimer = setTimer ( changeCountTimer, 1000, 0 ) setElementData ( resourceRoot, "CountDown", true ) setTimer ( setElementData, 30000, 1, resourceRoot, "CountDown", false ) end addCommandHandler( "countdown", Countdown ) changeCountTimer = function ( ) if Count <= 1 then outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return killTimer ( CountDownTimer ) end addNewCount ( tonumber(Count) -1 ) outputChatBox ( "#2600FF ==="..Count.."===", getRootElement(), 255, 255, 255, true ) end Link to comment
mr.Extreme Posted September 27, 2013 Share Posted September 27, 2013 تفضل حبيبي function Countdown (player, cmd) if not countdownTimer then countdownTimer = true setTimer(function () countdownTimer = false end, 10000, 1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) else outputChatBox("#FF0000Please wait at least 10 seconds before start countdown.", getRootElement(), 255, 255, 255, true) end end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) Link to comment
rabe3 Posted October 11, 2013 Author Share Posted October 11, 2013 تفضل حبيبي function Countdown (player, cmd) if not countdownTimer then countdownTimer = true setTimer(function () countdownTimer = false end, 10000, 1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) else outputChatBox("#FF0000Please wait at least 10 seconds before start countdown.", getRootElement(), 255, 255, 255, true) end end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) يسلموو Link to comment
BadBoy Posted October 11, 2013 Share Posted October 11, 2013 تفضل حبيبي function Countdown (player, cmd) if not countdownTimer then countdownTimer = true setTimer(function () countdownTimer = false end, 10000, 1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) outputChatBox ( "" .. name .. ": #2600FF start countdown!!!", getRootElement(), r, g, b, true ) outputChatBox ( "#2600FF ===3===", getRootElement(), 255, 255, 255, true ) triggerClientEvent("triggerclientforGridCountdown", getRootElement()) setTimer ( Countdown5, 1000, 1 ) else outputChatBox("#FF0000Please wait at least 10 seconds before start countdown.", getRootElement(), 255, 255, 255, true) end end function Countdown5 ( root ) outputChatBox ( "#2600FF ===2===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown4, 1000, 1 ) end function Countdown4 ( root ) outputChatBox ( "#2600FF ===1===", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown3, 1000, 1 ) end function Countdown3 ( root ) outputChatBox ( "#2600FF Go Go Go!!!", getRootElement(), 255, 255, 255, true ) setTimer ( Countdown2, 1000, 1 ) end addCommandHandler( "countdown", Countdown ) نفسي افهم وش له دخل هذه : setTimer ( Countdown2, 1000, 1 ) 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