02.06.2015, 19:47
Help with checkpoints
02.06.2015, 19:52
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
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
02.06.2015, 20:23
i don't understand
Thank you.

03.06.2015, 10:49
up?
somebody >?
somebody >?


03.06.2015, 11:13
Well, you make a Checkpoint Array:
I hope you understand
PHP код:
stock const Float:cPoints[][] = {
{0.0, 0.0, 0.0}, //Start Position
{1.0, 0.0, 0.0},
{2.0, 0.0, 0.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
}
}

07.06.2015, 21:53
Quote:
Well, you make a Checkpoint Array:
PHP код:
![]() |
PHP код:
stock const Float:cPoints[][] = {
{0.0, 0.0, 0.0}, //Start Position
{1.0, 0.0, 0.0},
{2.0, 0.0, 0.0} //etc
08.06.2015, 12:33
up? suggestions ?
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)