Jump to content

EventHandler "onMarkerHit" triggers


kuwalda

Recommended Posts

Posted

Hello.

I wanted to ask some questions. I have made table with all my race checkpoints and want to make "chain effect", with that I mean, you enter checkpoint1 and then checkpoint2 appears and so on. But how can I do it, because onMarkerHit is server sided event, but I want every player to "go trough this chain" not like 1 player drives through checkpoint 1 and server shows checkpoint 2 for everyone.

Also, how can I make this "chain effect"? Will simple "checkpoint["1" +1 ]" work? And also, how do I determen which player won the race? Like when they hit last checkpoint, how can I make something like - ("onMarkerHit", checkpoint[LAST ELEMENT], dothat)?

Posted

Anyone please?

How to make "checkpoint chain" where first checkpoint leads to second, when checkpoints are stored in table and also make them appear for each player induvidualy , so there is no thing like playerX hits checkpoint1 and playerY sees checkpoint2.

I have been trying to figure it out myself, but nothing is leading me anywhere. I googled it and there is no article about it.

  
blueBerryRallyz = createMarker ( 679.20001, 312.39999, 18.9, "checkpoint", 6, 190, 156, 252, 170 ) 
  
addEventHandler( "onClientElementColShapeHit", getRootElement( ), 
    function ( ) 
    destroyElement(blueBerryRallyz) 
    end 
); 
  

Does not work out for me

  
blueBerryRallyz = createMarker ( 679.20001, 312.39999, 18.9, "checkpoint", 6, 190, 156, 252, 170 ) 
  
function ColShapeHit ( thePlayer ) 
    local detection = isElementWithinColShape ( thePlayer, blueBerryRallyz ) 
        if detection then 
            destroyElement( blueBerryRallyz ) 
            createMarker ( 574,59998, 286.39999, 16.9, "checkpoint", 6, 190, 156, 252, 170 ) 
        end 
end 
addEventHandler( "onClientElementColShapeHit", getRootElement( ), ColShapeHit ) 
  

And this neather. So what is correct way doing this?

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