Help with checkpoints
#1

Hello. Help me please to make this :
Reply
#2

Just make a variable counter and every time the player enters a checkpoint make it add 1.

It's been a while since I've worked with pawn but something like:
public OnPlayerEnterCheckpoint(playerid)
{
drivingSchoolExam[playerid]++;
}

And then make it update the textdraw obviously
Reply
#3

i don't understand Thank you.
Reply
#4

up?
somebody >?
Reply
#5

Well, you make a Checkpoint Array:

PHP код:
stock const Float:cPoints[][] = {
    {
0.00.00.0}, //Start Position
    
{1.00.00.0},
    {
2.00.00.0//etc
};
//The Makro to short it up
#define xCH[%0] cPoints[c_idx[playerid]][%0]
//And a Variable
new c_idx[MAX_PLAYERS]; //And an Checkpoint Index for all players
//OnPlayerConnect
c_idx[playerid] = 0//To reset it
//Now when he starts the driving school
SetPlayerCheckpoint(playerid,xCH[0],xCH[1],xCH[2]);
c_idx[playerid]++; //To show him the next checkpoint
//OnPlayerEnterCheckpoint
if(c_idx[playerid] != 0//To check he is in driving school
{
    if(
c_idx[playerid] == sizeof(cPoints))
    {
        
//Here he is finished
    
}
    else
    {
        
//Here you show him the next Checkpoint
        
new string[64];
        
SetPlayerCheckpoint(playerid,xCH[0],xCH[1],xCH[2]);
        
c_idx[playerid]++;
        
format(string,64,"Checkpoint %d / %d",c_idx[playerid],sizeof(cPoints)+1); //Can you show in a TextDraw
        
TextDrawSetString(textid[playerid], string); //For Example...better use PlayerTextDraws
    
}

I hope you understand
Reply
#6

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Well, you make a Checkpoint Array:

PHP код:
stock const Float:cPoints[][] = {
    {
0.00.00.0}, //Start Position
    
{1.00.00.0},
    {
2.00.00.0//etc
};
//The Makro to short it up
#define xCH[%0] cPoints[c_idx[playerid]][%0]
//And a Variable
new c_idx[MAX_PLAYERS]; //And an Checkpoint Index for all players
//OnPlayerConnect
c_idx[playerid] = 0//To reset it
//Now when he starts the driving school
SetPlayerCheckpoint(playerid,xCH[0],xCH[1],xCH[2]);
c_idx[playerid]++; //To show him the next checkpoint
//OnPlayerEnterCheckpoint
if(c_idx[playerid] != 0//To check he is in driving school
{
    if(
c_idx[playerid] == sizeof(cPoints))
    {
        
//Here he is finished
    
}
    else
    {
        
//Here you show him the next Checkpoint
        
new string[64];
        
SetPlayerCheckpoint(playerid,xCH[0],xCH[1],xCH[2]);
        
c_idx[playerid]++;
        
format(string,64,"Checkpoint %d / %d",c_idx[playerid],sizeof(cPoints)+1); //Can you show in a TextDraw
        
TextDrawSetString(textid[playerid], string); //For Example...better use PlayerTextDraws
    
}

I hope you understand
Here
PHP код:
stock const Float:cPoints[][] = {
    {
0.00.00.0}, //Start Position
    
{1.00.00.0},
    {
2.00.00.0//etc 
I put checkpoints on SetPlayerRaceCheckpoint ? +REP PLS
Reply
#7

up? suggestions ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)