Jump to content

تايمر مع الكوماند


Recommended Posts

م انصحك فيه ولا انصحك تركبه اصلا تدري ليه ؟

اغلب المودات تسوي اختصار على الكوماند زي مود الادمنية

يعني بتخليه يفتح نافذة اي مود وينتظر 5 ثواني ويقفلها ؟

مهم : انا مو متاكد من كلامي جرب ورد خبر

Link to comment

لأني رآيق وشبعان نوم توي قاعد , قلت خلني أسوي لك الكود مهب شينة إذا جاه جاهز ليه يتعب نفسه ذذ ..~

  
xRoot = getRootElement() 
local xOldCmd = {} 
  
addEventHandler('onPlayerCommand', xRoot, 
    function(xPlayer, xCommand) 
xCommand = xCmd 
            if xOldCmd[xPlayer] == xCmd then 
        cancelEvent() 
                outputChatBox("*Excuse me, wait for 5 seconds to use "..Cmd.." again !!", xPlayer, 255, 0, 0 ) 
                return 
            else 
                xOldCmd[xPlayer] = xCmd 
            end 
    end 
) 
  
setTimer(function() xOldCmd = {} end, 5000, 0) 
  

Edited by Guest
Link to comment
لأني رآيق وشبعان نوم توي قاعد , قلت خلني أسوي لك الكود مهب شينة إذا جاه جاهز ليه يتعب نفسه ذذ ..~
  
xRoot = getRootElement() 
local xOldCmd = {} 
  
addEventHandler('onPlayerCommand', xRoot, 
    function(xPlayer, xCmd) 
            if xOldCmd[xPlayer] == xCmd then 
        cancelEvent() 
                outputChatBox("*Excuse me, wait for 5 seconds to use the command again !!", xPlayer, 255, 0, 0 ) 
                return 
            else 
                xOldCmd[xPlayer] = xCmd 
            end 
    end 
) 
  
setTimer(function() xOldCmd = {} end, 5000, 0) 
  

جاهز بالويكي :mrgreen:

local commandSpam = {} 
  
function preventCommandSpam() 
    if (not commandSpam[source]) then 
        commandSpam[source] = 1 
        -- New person so add to table 
    elseif (commandSpam[source] == 5) then 
        cancelEvent() 
        outputChatBox("Please refrain from command spamming!", source, 255, 0, 0) 
        -- This person is command spamming! 
    else 
        commandSpam[source] = commandSpam[source] + 1 
        -- Add one to the table 
    end 
end 
addEventHandler("onPlayerCommand", root, preventCommandSpam) 
setTimer(function() commandSpam = {} end, 1000, 0) -- Clear the table every second 
Link to comment
م انصحك فيه ولا انصحك تركبه اصلا تدري ليه ؟

اغلب المودات تسوي اختصار على الكوماند زي مود الادمنية

يعني بتخليه يفتح نافذة اي مود وينتظر 5 ثواني ويقفلها ؟

مهم : انا مو متاكد من كلامي جرب ورد خبر

شكلك مافهمت قصدي انا ابيه لمن يكتب الكلمة يقعد 5 ثواني لين يقدر يكتبها مرة ثانية

Link to comment
م انصحك فيه ولا انصحك تركبه اصلا تدري ليه ؟

اغلب المودات تسوي اختصار على الكوماند زي مود الادمنية

يعني بتخليه يفتح نافذة اي مود وينتظر 5 ثواني ويقفلها ؟

مهم : انا مو متاكد من كلامي جرب ورد خبر

شكلك مافهمت قصدي انا ابيه لمن يكتب الكلمة يقعد 5 ثواني لين يقدر يكتبها مرة ثانية

Event : onPlayerCommand

في طريقتين :

Functions : getTickCount - cancelEvent مع جدول

أو

Functions : setTimer - setElementData - cancelEvent

Link to comment
م انصحك فيه ولا انصحك تركبه اصلا تدري ليه ؟

اغلب المودات تسوي اختصار على الكوماند زي مود الادمنية

يعني بتخليه يفتح نافذة اي مود وينتظر 5 ثواني ويقفلها ؟

مهم : انا مو متاكد من كلامي جرب ورد خبر

شكلك مافهمت قصدي انا ابيه لمن يكتب الكلمة يقعد 5 ثواني لين يقدر يكتبها مرة ثانية

انا فاهمك بس انت اللي مافهمتني

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