Jump to content

please help me !


ABu-ALi_

Recommended Posts

look this:

function Win(mapInfo) 
local alivePlayers = getAlivePlayers() 
info = mapInfo.modename 
if info == "Destruction derby" then 
if #alivePlayers == 1 then  
local playername = getPlayerName(alivePlayers[1]) 
local amount = math.random(1,9999) 
local money = getPlayerMoney ( source ) 
if ( money >= 0 ) then 
givePlayerMoney( source, amount ) 
outputChatBox(playername.." Win and give hem $"..amount.." !",getRootElement(),255,255,0)  
      end  
   end 
end 
addEventHandler("onPlayerWasted", getRootElement(), Win) 

but, this is not working

help me please ! :|

Link to comment

You have to create a table first.

alivePlayers = {} 
function Win(mapInfo) 
local alivePlayers = getAlivePlayers() 
info = mapInfo.modename 
if info == "Destruction derby" then 
if #alivePlayers == 1 then 
local playername = getPlayerName(alivePlayers[1]) 
local amount = math.random(1,9999) 
local money = getPlayerMoney ( source ) 
if ( money >= 0 ) then 
givePlayerMoney( source, amount ) 
outputChatBox(playername.." Win and give hem $"..amount.." !",getRootElement(),255,255,0) 
      end 
   end 
end 
addEventHandler("onPlayerWasted", getRootElement(), Win) 

Before you start the script, type ' /debugscript 3 ' and than start the script than tell us any errors found.

Link to comment

thank you ..

but this:

alivePlayers = {} 
function Win(mapInfo) 
local alivePlayers = getAlivePlayers() 
info = mapInfo.modename 
if info == "Destruction derby" then 
if #alivePlayers == 1 then 
local playername = getPlayerName(alivePlayers[1]) 
local amount = math.random(1,9999) 
local money = getPlayerMoney ( source ) 
if ( money >= 0 ) then 
givePlayerMoney( source, amount ) 
outputChatBox(playername.." Win and give hem $"..amount.." !",getRootElement(),255,255,0) 
      end 
   end 
end 
addEventHandler("onPlayerWasted", getRootElement(), Win) 

working now ..?

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