25.04.2015, 15:51
targetid? I'll comment the line because I don't know what you're doing with that.
PHP код:
new Player_NextKidnapp[MAX_PLAYERS char];
new Float:NextKidnapp[][3] = /// change the next POS
{
{213.8458,1867.2299,13.1406},
{404.7588,2443.3687,16.5000},
{760.2078,381.6906,23.1719},
{-777.8541,1436.0165,13.7891}
};
// OnPlayerConnect
Player_NextKidnapp{playerid} = 255;
// wherever you want to start setting the first checkpoint:
Player_NextKidnapp{playerid} = 0;
SetPlayerRaceCheckpoint(playerid, 0, NextKidnapp[0][0], NextKidnapp[0][1], NextKidnapp[0][2], NextKidnapp[1][0],NextKidnapp[1][1],NextKidnapp[1][2], 5.0);
// OnPlayerEnterRaceCheckpoint
if (Player_NextKidnapp{playerid} == 255) return 1;
switch (sizeof (NextKidnapp) - Player_NextKidnapp{playerid})
{
case 1:
{
Player_NextKidnapp{playerid} = 255;
DisablePlayerRaceCheckpoint(playerid);
//SetPlayerHealth(targetid, 0);
}
case 2:
{
new cp = ++Player_NextKidnapp{playerid};
SetPlayerRaceCheckpoint(playerid, 1, NextKidnapp[cp][0], NextKidnapp[cp][1], NextKidnapp[cp][2], 0.0, 0.0, 0.0, 5.0);
}
default:
{
new cp = ++Player_NextKidnapp{playerid};
SetPlayerRaceCheckpoint(playerid, 1, NextKidnapp[cp][0], NextKidnapp[cp][1], NextKidnapp[cp][2], NextKidnapp[cp + 1][0], NextKidnapp[cp + 1][1], NextKidnapp[cp + 1][2], 5.0);
}
}