DrPhoX Posted February 5, 2012 Share Posted February 5, 2012 (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 February 7, 2012 by Guest Link to comment
Castillo Posted February 5, 2012 Share Posted February 5, 2012 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
DrPhoX Posted February 7, 2012 Author Share Posted February 7, 2012 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
Castillo Posted February 7, 2012 Share Posted February 7, 2012 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
DrPhoX Posted February 7, 2012 Author Share Posted February 7, 2012 And "setTimer" message will show only for him? Who wrote command /fck Link to comment
Castillo Posted February 7, 2012 Share Posted February 7, 2012 Copy the code again to show only the player who used the command. Link to comment
DrPhoX Posted February 7, 2012 Author Share Posted February 7, 2012 settimmer message show for all players... not for him who used the command. please help I DONT KNOW :// Link to comment
Castillo Posted February 7, 2012 Share Posted February 7, 2012 I said copy the script again. Link to comment
DrPhoX Posted February 7, 2012 Author Share Posted February 7, 2012 I copied and dont work.... setTimer message is displayed for all players... but not only for me :// HELP! pleasee Link to comment
DrPhoX Posted February 7, 2012 Author Share Posted February 7, 2012 SolidSnake14 Thanks you so much SOLVED! it was folder bug... when i replace lua script, server cant update data...even after refresh 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