Jump to content

تعديل بسيط


rabe3

Recommended Posts

السلام عليكم عندي هاذ المود كيف اخليه مع وقت يعني اذا شغلوه اول مرا مايقدرو يشغلوه الى بعد 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
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
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

لم يتم التجربة

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
لم يتم التجربة
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
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
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
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) 

مايعمل -_-

Yr2g20Y.jpg

http://i.imgur.com/Yr2g20Y.jpg

:roll:

Link to comment
لم يتم التجربة
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

تابل هو جرب على الكود الخطأ ماعطيته الكود بعد التعديل

صاحب الموضوع جرب ذا

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
لم يتم التجربة
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
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

تفضل حبيبي

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
  • 2 weeks later...
تفضل حبيبي
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
تفضل حبيبي
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

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...