Jump to content

this takes 1(000) minute, here is my code


Recommended Posts

first this http://pastebin.com/05ir1YY6

how do i put a timer between it with a message like (when someone roll and after that again he gets a message )

"Don't roll the dice more then 1 time every 30 sec" in red color

i tried and a friend of mine tried but no succes

2nd

what did i do wrong?? in this line "outputChatBox ( getPlayerName ( thePlayer ) .. ' has won $700 as last player"

this is link for full script (if needed)

http://pastebin.com/Vys6JPJT

Link to comment

Try something like this:

local restriction = nil
addCommandHandler("roll",
function(thePlayer,comd)
 
if restriction then
outputChatBox( "your message", getRootElement(), 255, 0, 0)
return false;
end
 
 restriction = true
local resetRestriction = setTimer( restrictionEnd, 30000,1)
   randomroll = math.random(1, 3000)
   lossorwin = math.random(1, 3)
if lossorwin == 1 then
givePlayerMoney(thePlayer, 5500)
outputChatBox ( getPlayerName ( thePlayer ) .. ' roll and wins ' .. randomroll .. ' !', getRootElement(), 255, 255, 0)
elseif lossorwin == 2 then
takePlayerMoney(thePlayer, 5000)
outputChatBox (  getPlayerName ( thePlayer ) .. ' roll and losses ' .. randomroll .. ' !', getRootElement(), 255, 255, 0)
elseif lossorwin == 3 then
setPlayerMuted(player, true)
setTimer(setPlayerMuted, 30000, 1, player, false)   
outputChatBox (  getPlayerName ( thePlayer ) .. ' roll and is now muted !', getRootElement(), 255, 255, 0)
end
end
)
 
function restrictionEnd()
restriction = false;
end

2.

addEvent("onPlayerDestructionDerbyWin",true)
addEventHandler("onPlayerDestructionDerbyWin",getRootElement(),
function (winner)
givePlayerMoney(winner, 700)
outputChatBox(getPlayerName ( winner ) .. " has won $700 as last player alive",getRootElement(),0,255,0)
end
)

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