Jump to content

help


Paplo

Recommended Posts

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?

Link to comment
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.

Link to comment
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 ^^

Link to comment
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?

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