Checkpoints
#2

Well, if you need to show another checkpoint and hide the old one, you can do that without Streamer, using only SetPlayerCheckpoint

1. Store checkpoint positions in prefered order into an array
PHP код:
#define NUMBER_OF_CP_POSITIONS (16) // Number of different positions for checkpoints
enum Vector3 {
    
Float:X,
    
Float:Y,
    
Float:Z
}
checkpointPositions[NUMBER_OF_CP_POSITIONS][Vector3] = {
    { 
100.0200.05.0 },   // 1-st checkpoint player should go to
    
200.0300.010.0 }, // 2-nd, which we'll show as soon as player enter first
    
...
}; 
2. Create an array where you'll store ID of current checkpoint for each player
PHP код:
new currentPlayerCheckpoint[MAX_PLAYERS]; 
3. When player starts doing something (I don't know what you are going to do with checkpoints), set that ID to 0 and show the first checkpoint (whick has index 0 in positions array)
PHP код:
// Simply shows current checkpoint player has to go to
public ShowCurrentPlayerCheckpointplayerid ) {
    new 
idx currentPlayerCheckpointplayerid ];
    
SetPlayerCheckpointplayeridcheckpointPositionsidx ][ ], checkpointPositionsidx ][ ], checkpointPositionsidx ][ ], 5.0 );
}

// This public is called on event start
public WhenSomethingStartsplayerid ) {
    
currentPlayerCheckpointplayerid ] = 0;
    
ShowCurrentPlayerCheckpointplayerid );  // Show the first CP

4. Finaly, callback handling
PHP код:
public OnPlayerEnterCheckpointplayerid ) {
    new 
cpID currentPlayerCheckpointplayerid  ]; // That's the ID of CP player entered
    // To get CP position, use checkpointPositions[ cpID ][ X / Y / Z ]
    
    // Now lets show him the next CP or do something else if he entered the last one
    
if ( cpID == NUMBER_OF_CP_POSITIONS ) {
        
// That was the last CP, player walked through all of them and now we can give him something / finish event / start it again etc.
    
} else {
        
// That checkpoint was not last, let's show the next one
        
currentPlayerCheckpointplayerid  ]++;
        
ShowCurrentPlayerCheckpointplayerid );
    }

That's the idea. This code may have errors, you should use it as an example but not as completed working thing
Reply


Messages In This Thread
CreateDynamicCP as SetPlayerCheckpoint? - by Sheperc - 16.12.2015, 14:03
Re: Checkpoints - by prineside - 16.12.2015, 16:39
Re: Checkpoints - by Sheperc - 16.12.2015, 17:46

Forum Jump:


Users browsing this thread: 1 Guest(s)