Jump to content

SOLVED little problem


DrPhoX

Recommended Posts

Hey again... i have problem

function fck(command) 
    addCommandHandler("fck", getRootElement()) 
    outputChatBox("#FFFFFFFck You! #abcdef(type: /fu)", getRootElement(), fck, 255, 255, 255, true) 
    end 
    setTimer(fck,5000,1,true) 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", getRootElement, setTimer, hateMap, 255, 255, 255, true) 
     
function hateMap(command) 
    addCommandHandler("hatemap", getRootElement()) 
    outputChatBox("#FFFFFFI hate this map! #abcdef(type: /hatemap)", getRootElement(), hateMap, 255, 255, 255, true) 
    end 
    setTimer(hateMap,5000,1,true) 
    outputChatBox("#FF0000You must wait 5 seconds to write this command again.", getRootElement, setTimer, hateMap, 255, 255, 255, true) 
     
function loveYou(command) 
    addCommandHandler("ilu", getRootElement()) 
    outputChatBox("#FFFFFFI love you :-* #abcdef(type: /ilu)", getRootElement(), ilu, 255, 255, 255, true) 
    end 
    setTimer(ilu,5000,1,true) 
    outputChatBox("#FF0000You must wait 5 seconds to write this command again.", getRootElement, setTimer, hateMap, 255, 255, 255, true) 

Why dont works colors and settimer?

Thx for help ;)

Edited by Guest
Link to comment

Maybe because that's a f** mess?

local restriction = {} 
  
function fck(player, cmd) 
    if (not restriction[player]) then restriction[player] = {} end 
    if not restriction[player][cmd] then 
        outputChatBox("#FFFFFFFck You! #abcdef(type: /fu)", root, 255, 255, 255, true) 
        restriction[player][cmd] = true 
        setTimer(function () restriction[player][cmd] = false end, 5000, 1) 
    else 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", root, 255, 255, 255, true) 
    end 
end 
addCommandHandler("fck", fck) 
    
function hateMap(player, cmd) 
    if (not restriction[player]) then restriction[player] = {} end 
    if not restriction[player][cmd] then 
        outputChatBox("#FFFFFFI hate this map! #abcdef(type: /hatemap)", root, 255, 255, 255, true) 
        restriction[player][cmd] = true 
        setTimer(function () restriction[player][cmd] = false end, 5000, 1) 
    else 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", root, 255, 255, 255, true) 
    end 
end 
addCommandHandler("hatemap", hateMap) 
    
function loveYou(player, cmd) 
    if (not restriction[player]) then restriction[player] = {} end 
    if not restriction[player][cmd] then 
        outputChatBox("#FFFFFFI love you :-* #abcdef(type: /ilu)", root, 255, 255, 255, true) 
        restriction[player][cmd] = true 
        setTimer(function () restriction[player][cmd] = false end, 5000, 1) 
    else 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", root, 255, 255, 255, true) 
    end 
end 
addCommandHandler("ilu", loveYou) 

Link to comment

Ye its work but... "You must wait 5 seconeds to write this command again." need, whether it will write only the players who wrote the command...

and let's write the player who wrote the command. Example: (.. player .. I hate this map! (Type: /hatemap) Will you help me please? :)

Link to comment
local restriction = {} 
  
function fck(player, cmd) 
    if (not restriction[player]) then restriction[player] = {} end 
    if not restriction[player][cmd] then 
        outputChatBox("#FFFFFF ".. getPlayerName(player) .." Fck You! #abcdef(type: /fu)", root, 255, 255, 255, true) 
        restriction[player][cmd] = true 
        setTimer(function () restriction[player][cmd] = false end, 5000, 1) 
    else 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", player, 255, 255, 255, true) 
    end 
end 
addCommandHandler("fck", fck) 
    
function hateMap(player, cmd) 
    if (not restriction[player]) then restriction[player] = {} end 
    if not restriction[player][cmd] then 
        outputChatBox("#FFFFFFI ".. getPlayerName(player) .." I hate this map! #abcdef(type: /hatemap)", root, 255, 255, 255, true) 
        restriction[player][cmd] = true 
        setTimer(function () restriction[player][cmd] = false end, 5000, 1) 
    else 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", player, 255, 255, 255, true) 
    end 
end 
addCommandHandler("hatemap", hateMap) 
    
function loveYou(player, cmd) 
    if (not restriction[player]) then restriction[player] = {} end 
    if not restriction[player][cmd] then 
        outputChatBox("#FFFFFFI ".. getPlayerName(player) .." I love you :-* #abcdef(type: /ilu)", root, 255, 255, 255, true) 
        restriction[player][cmd] = true 
        setTimer(function () restriction[player][cmd] = false end, 5000, 1) 
    else 
        outputChatBox("#FF0000You must wait 5 seconds to write this command again.", player, 255, 255, 255, true) 
    end 
end 
addCommandHandler("ilu", loveYou) 

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