Jump to content

Random player


boro

Recommended Posts

Hi all i have problem with my bonus script but it don't work

i want give player bonus weapon but only for one player not for all players

i don't know what is bad.

function gibvebonus ( player, command ) 
    if getElementByType ( players ) == 'player' then 
    local bonus = math.random ( player ) 
    giveWeapon ( player, 38, 9999 ) 
    outputChatBox("* ".. getPlayerName(player) .." have bonus weapon") 
end 
end 
addCommandHandler ( "playerbonus", givebonus  ) 

Link to comment

Is it good?

function gibvebonus ( player, command ) 
local randomPlayer = getRandomPlayer ( ) 
    giveWeapon ( randomPlayer, 38, 9999 ) 
    outputChatBox("* ".. getPlayerName(randomPlayer) .." have bonus weapon") 
end 
addCommandHandler ( "bonus", givebonus  ) 

i won't t test it because am on phone ty.

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