All pastes #754164 Raw Edit

Mine

public text v1 · immutable
#754164 ·published 2007-10-29 20:48 UTC
rendered paste body
/* [ Drifts ] */
#define		MAX_DRIFTS		1	// Max Drifts
// --> Drift 1
#define		D1_MAX_SPS		2	// Max Starting Positions
#define		D1_MAX_CPS		6	// Max Drift Checkpoints
//////////////////////////////////////////////////////////////
/* [ Drifts ] */
new CurrentDrift;
new bool:IsDriftOn[MAX_DRIFTS];
new JoinedDrift[MAX_PLAYERS][MAX_DRIFTS];
new InDrift[MAX_PLAYERS][MAX_DRIFTS];
new Drifters[MAX_DRIFTS];
new CurrentCheckpoint[MAX_PLAYERS];
enum DriftingPlayers1 { player1, player2 }
new DriftersDrift1[DriftingPlayers1];
new Winner[MAX_DRIFTS];
new Prizes[MAX_DRIFTS][2] = {
	{ 1, 1000 }/*,
	{ 2, 1000 }
	*/
};
// --> Drift 1
new Float:Drift1SP[D1_MAX_SPS][4] = {
	{2320.641357, 1387.512817, 43.727416, 0.000000},
	{2297.753173, 1511.801757, 42.524913, 0.000000}
};
new Float:Drift1[D1_MAX_CPS][4] = {
	{2306.864746, 1394.578369, 36.126873, 5.0},
	{2307.469482, 1512.850830, 29.729011, 5.0},
	{2306.949218, 1394.927001, 23.329879, 5.0},
	{2307.312988, 1512.443115, 16.923585, 5.0},
	{2300.603515, 1393.509277, 10.525998, 5.0},
	{2332.731689, 1449.351928, 10.524581, 10.0}
};
//////////////////////////////////////////////////////////////
public LoadDrift(driftid)
{
    for (new i=0; i<MAX_PLAYERS; i++) {
		if (IsPlayerConnected(i)) {
			IsDriftOn[CurrentDrift] = true;
			Winner[CurrentDrift] = 0;
			DisablePlayerCheckpoint(i);
			JoinedDrift[i][CurrentDrift] = 0;
			CurrentCheckpoint[i] = 0;
			InDrift[i][CurrentDrift] = 0;
		}
	}
	SendClientMessageToAll(COLOR_GREEN, "A drift has started! Type /joindrift to join.");
	return 1;
}
//////////////////////////////////////////////////////////////
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256], Index;
	cmd = strtok(cmdtext, Index);
	if (!strcmp(cmd, "/startdrift", true))
	{
		new tmp[256];
		tmp = strtok(cmdtext, Index);
		for (new i=0; i<MAX_DRIFTS; i++) if (IsDriftOn[i]) return SendClientMessage(playerid, COLOR_RED, "ERROR: There is already a drift on.");
		if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /startdrift <driftid>");
		if (!IsNumeric(tmp)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Drift ID must be a number.");
		if (strval(tmp) > MAX_DRIFTS) return SendClientMessage(playerid, COLOR_RED, "ERROR: This drift does not exists.");
		CurrentDrift = strval(tmp);
		LoadDrift(CurrentDrift);
		return 1;
	}
	return 0;
}