Jump to content

My 1st script


A7mad-78

Recommended Posts

Posted

Hi Every one i have problem in my script

it's very small script just for test

But it's has a problem

local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( RandomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000, 1, "xD!" ) 
  

And what i mean it's Get random player then give him a 1025$

And it's getrandomplayer every 1000second

Please help

Posted
  
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000000, 1000 ) -- 1000 = 1 second 
  

I could be wrong.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
  
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000000, 1000 ) -- 1000 = 1 second 
  

I could be wrong.

it's steel not working

Posted

omg volk-rus! you did it wrong lol, try this.

local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
setTimer ( randomPlayer, 1000, 0 ) -- 1000 = 1 second 0 = how much times will the timer work (0 = infinite) 

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 didn't even checked it, i just changed the timer arguments o_O.

btw thats because he never added a function :roll:

  
function random() 
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount 
end 
setTimer ( random, 1000, 0 ) -- 1000 = 1 second 0 = how much times will the timer work (0 = infinite) 

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

work checked on the server!

  
setTimer ( function ()  
local randomPlayer = getRandomPlayer ( ) 
outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) 
    givePlayerMoney ( randomPlayer, 1025 )  
end, 1000, 0 )  -- Put some time you want!  
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

so my code works now, right?

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

now i'm totally lost, you said you wanted to give a random player $1250 every 1 second and now what are you saying??

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

Yes I wanted to give random player $1250 Every 1 second Just this

And the script it's not working in my server

look i want when the ranndom player has $1250

it's write on server funcitons (randomPlayer, Has win 1025$ " )

Just like that

Posted

try this(server-side):

  
function hobo() 
local  player = getRandomPlayer ( ) 
givePlayerMoney(player, CASH HERE!) 
outputChatBox ( getPlayerName ( player ).." Won: CASH NUMBER HERE!" ) 
end 
setTimer(hobo, 1000, 0) 
  

Posted

jesse, volk's code and mine are the same as yours :roll:

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

1000 = TIME

0 = HOW MUCH TIMES WILL THE TIMER WORK 0 = INFINITE

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.

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