Paplo Posted June 20, 2013 Posted June 20, 2013 randomTime = 10 -- hours randomPlayer = getRandomPlayer ( ) rplayer = getPlayerName ( randomPlayer ) setTimer(function() local money = math.random(3000, 15000) for i,randomPlayer in ipairs(getElementsByType("player")) do givePlayerMoney(randomPlayer, money) outputChatBox ("[RANDOM] #FFFFFF"..getPlayerName ( randomPlayer ).." #FFFFFFget "..money.." !",root,255,136,0,true) end end , randomTime*1000, 0) this mode give players money at 10 sc i need to give 1 player random in 10 sc not all player how i can do that?
iMr.3a[Z]eF Posted June 20, 2013 Posted June 20, 2013 to who you want to give? To Visit Us Press Here: mtasa://5.9.206.180:22002
Paplo Posted June 20, 2013 Author Posted June 20, 2013 to who you want to give? Luck is not one particular
iMr.3a[Z]eF Posted June 20, 2013 Posted June 20, 2013 you mean random players in the server? To Visit Us Press Here: mtasa://5.9.206.180:22002
Paplo Posted June 20, 2013 Author Posted June 20, 2013 you mean random players in the server? yes I want to give money randomly on players
iPrestege Posted June 20, 2013 Posted June 20, 2013 addEventHandler('onResourceStart',resourceRoot, function ( ) setTimer ( function ( ) local aPlayer = getRandomPlayer ( ) local aMoney = math.random ( 3000,15000 ) if aPlayer and aMoney then givePlayerMoney ( aPlayer,aMoney ) outputChatBox ('[RANDOM] #FFFFFF'..getPlayerName ( aPlayer )..' #FFFFFFget '..aMoney..' !',root,255,136,0,true) end end,10000,0 ) end ) Not tested.
Paplo Posted June 20, 2013 Author Posted June 20, 2013 addEventHandler('onResourceStart',resourceRoot, function ( ) setTimer ( function ( ) local aPlayer = getRandomPlayer ( ) local aMoney = math.random ( 3000,15000 ) if aPlayer and aMoney then givePlayerMoney ( aPlayer,aMoney ) outputChatBox ('[RANDOM] #FFFFFF'..getPlayerName ( aPlayer )..' #FFFFFFget '..aMoney..' !',root,255,136,0,true) end end,10000,0 ) end ) Not tested. thank you ^^
iPrestege Posted June 20, 2013 Posted June 20, 2013 You're welcome . P.S : I know you're 6ArHxiMr'3a[Z]eF .
ixjf Posted June 20, 2013 Posted June 20, 2013 addEventHandler('onResourceStart',resourceRoot, function ( ) setTimer ( function ( ) local aPlayer = getRandomPlayer ( ) local aMoney = math.random ( 3000,15000 ) if aPlayer and aMoney then givePlayerMoney ( aPlayer,aMoney ) outputChatBox ('[RANDOM] #FFFFFF'..getPlayerName ( aPlayer )..' #FFFFFFget '..aMoney..' !',root,255,136,0,true) end end,10000,0 ) end ) Not tested. Since when are element and number variables tables? I used to know how to code, but then I took an arrow in the knee. Project Redivivus - Remaking Old School MTA With New Code MTA 0.6 Nightly 1 released
iMr.3a[Z]eF Posted June 20, 2013 Posted June 20, 2013 You're welcome .P.S : I know you're 6ArHxiMr'3a[Z]eF . i dont understand you lol To Visit Us Press Here: mtasa://5.9.206.180:22002
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