Jump to content

How get number of checkpoints in race?


Boris.

Recommended Posts

Hello. Im creating money and score system for finish race with onPlayerFinish. 

How I can got number of checkpoints in this race? I need it for calculate money and points.

 

Code is example

 

addEvent("onPlayerFinish",true)
addEventHandler("onPlayerFinish", getRootElement(),
function ( rank, time )
	local account = getPlayerAccount(source) 50000
	if rank == 1 then
    	if not (isGuestAccount(account)) then
        	blabaldaslvadgfad
    	else
    		hgdsfgdsfgds
    	end
    else
    	
    end
end)

 

Link to comment
addEvent("onPlayerFinish",true)
addEventHandler("onPlayerFinish", getRootElement(),
function ( rank, time )
    local totalMarker = getMarkerCount()
	local account = getPlayerAccount(source)  
	if rank == 1 then
    	if not (isGuestAccount(account)) then
        	givePlayerMoney ( source, 2500*totalMarker ) -- change 2500 to the amount you wanna give per checkpoint in race*
       		outputChatBox("You finished the race in first place with "..totalMarker.." markers!", source, 0,255,0)
    	else
    		outputChatBox("You are not registered!", source,255,0,0)
        	return
    	end
    else
    	
    end
end)

Sorry for the late reply! Better get a reply now than never afterall :P

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