Jump to content

SOLVED little problem


DrPhoX

Recommended Posts

Posted (edited)

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
Posted

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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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? :)

Posted
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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Copy the code again to show only the player who used the command.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I said copy the script again.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

SolidSnake14 Thanks you so much ;)

SOLVED! :) it was folder bug... when i replace lua script, server cant update data...even after refresh ;)

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