Jump to content

Recieve points


Memory

Recommended Posts

Hi,

Can you are help, make this function for all players, who finished, get points?

function raceWin( rank ) 
local acc = getPlayerAccount( source ) 
local ptzData = getAccountData( acc, "Points" ) 
    if rank < 4 then 
        if ptzData then 
        setAccountData( acc, "Points", ptzData + pointswin ) 
        else 
        setAccountData( acc, "Points", pointswin ) 
        end 
    outputChatBox("[Points]#FFFFFF " .. getPlayerName(source).. " #00FF00 receive 1 point", getRootElement(), 255, 255, 255, true ) 
    end 
end 
addEventHandler("onPlayerFinish", getRootElement(), raceWin) 

How can make points for 2 and 3 places?

function check() 
local alive = getAlivePlayers() 
local player = alive[1] 
local acc = getPlayerAccount( player ) 
local ptzData = getAccountData( acc, "Points" ) 
   if (#alive == 1) then 
        if ptzData then 
        setAccountData( acc, "Points", ptzData + pointsToWin ) 
        else 
        setAccountData( acc, "Points", pointsToWin ) 
        end 
    outputChatBox("[Points]#FFFFFF " .. getPlayerName(player).. " #00FF00 receive 10 points", getRootElement(), 255, 255, 255, true ) 
   end 
end 
addEventHandler("onPlayerWasted",getRootElement(),check) 

Link to comment
Can you are help, make this function for all players, who finished, get points?
function raceWin( rank ) 
local acc = getPlayerAccount( source ) 
local ptzData = getAccountData( acc, "Points" ) 
        if ptzData then 
        setAccountData( acc, "Points", ptzData + pointswin ) 
        else 
        setAccountData( acc, "Points", pointswin ) 
        end 
    outputChatBox("[Points]#FFFFFF " .. getPlayerName(source).. " #00FF00 receive 1 point", getRootElement(), 255, 255, 255, true ) 
end 
addEventHandler("onPlayerFinish", getRootElement(), raceWin) 

How can make points for 2 and 3 places?
function check() 
local alive = getAlivePlayers() 
local player = alive[1] 
local acc = getPlayerAccount( player ) 
local ptzData = getAccountData( acc, "Points" ) 
   if (#alive <= 3) then 
        if ptzData then 
        setAccountData( acc, "Points", ptzData + pointsToWin ) 
        else 
        setAccountData( acc, "Points", pointsToWin ) 
        end 
    outputChatBox("[Points]#FFFFFF " .. getPlayerName(player).. " #00FF00 receive 10 points", getRootElement(), 255, 255, 255, true ) 
   end 
end 
addEventHandler("onPlayerWasted",getRootElement(),check) 

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