Jump to content

Value increses depending on checkpoint count in same place


kuwalda

Recommended Posts

I have this part of code that I am trying to fix:

function testejam() 
    destroyElement(getElementData(thePlayer, "checkpoints")) 
    setElementData(thePlayer, "checkpoints", createMarker(..., "checkpoint", 6, 190, 156, 252, 50, thePlayer)) 
    setMarkerTarget(getElementData(thePlayer, "checkpoints"), ... ) 
    setElementVisibleTo(getElementData(thePlayer, "checkpoints"), root, false) 
    setElementVisibleTo(getElementData(thePlayer, "checkpoints"), thePlayer, true) 
    setElementData ( thePlayer, "dbid", getElementData ( thePlayer, "dbid" ) + 1 ) 
end 
    if isElementVisibleTo(getElementData(thePlayer, "checkpoints"),thePlayer) then 
        addEventHandler( "onMarkerHit", getElementData(thePlayer, "checkpoints"), testejam ) 
    end 

The thing I can`t manage to fix:

if 2 players have to drive through 1 checkpoint, the first one who drives through gets "dbid" value added by +2

if 3 players have checkpoint there - first one will get "dbid" +3, second "dbid" +2 and third +1

I need that it only counts your checkpoints and only adds +1 vaule every time you hit checkpoint.

Where is the problem and how can I fix it? :|

Edited by Guest
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...