All pastes #824184 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-19 20:58 UTC
rendered paste body
forward checkpointUpdate();

public checkpointUpdate()
{
	for(new i=0; i<MAX_PLAYERS; i++){
	    if(IsPlayerConnected(i)) {
	        if(TaxiDriver[i] == 1 || sprintracer[i]==1 || motorracer[i] == 1){
				if(TaxiDriver[i] == 1){
			        for(new j=1; j < MAX_TAXIPOINTS; j++) {
			            if(isPlayerInArea(i, TaxiCheckCheckpoints[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
				        }
					}
				}
				if(deathmatcher18[i] == 1){
			        for(new j=1; j < SPRINTRACE3CPS; j++) {
			            if(isPlayerInArea2(i, SprintRace3Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher19[i] == 1){
			        for(new j=1; j < SPRINTRACE4CPS; j++) {
			            if(isPlayerInArea2(i, SprintRace4Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher20[i] == 1){
			        for(new j=1; j < SPRINTRACE5CPS; j++) {
			            if(isPlayerInArea2(i, SprintRace5Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher21[i] == 1){
			        for(new j=1; j < SPRINTRACE6CPS; j++) {
			            if(isPlayerInArea2(i, SprintRace6Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher22[i] == 1){
			        for(new j=1; j < SPRINTRACE7CPS; j++) {
			            if(isPlayerInArea2(i, SprintRace7Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher24[i] == 1){
			        for(new j=1; j < MOTORRACE1CPS; j++) {
			            if(isPlayerInArea2(i, MotorRace1Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher25[i] == 1){
			        for(new j=1; j < MOTORRACE2CPS; j++) {
			            if(isPlayerInArea2(i, MotorRace2Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher26[i] == 1){
			        for(new j=1; j < MOTORRACE3CPS; j++) {
			            if(isPlayerInArea2(i, MotorRace3Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher27[i] == 1){
			        for(new j=1; j < MOTORRACE4CPS; j++) {
			            if(isPlayerInArea2(i, MotorRace4Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
				if(deathmatcher28[i] == 1){
			        for(new j=1; j < MOTORRACE5CPS; j++) {
			            if(isPlayerInArea2(i, MotorRace5Boundaries[j])) {
			                if(playerCheckpoint[i]!=j) {
								playerCheckpoint[i] = j;
							}
						}
			        }
				}
			} else {
		        for(new j=0; j < MAX_POINTS; j++) {
		            if(isPlayerInArea(i, checkCoords[j])) {
		                if(j >= 206 && j <= 237){
		                    if(GoldPotActive == 0) {
		                        GoldPotActive = 0;
		                    } else {
				                if(playerCheckpoint[i]!=j) {
									if(j == GoldPotChoice) {
					                    DisablePlayerCheckpoint(i);
										SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2], 2);
										playerCheckpoint[i] = j;
									}
								}
							}
						} else {
			                if(playerCheckpoint[i]!=j) {
						        if(Pizza[i] == 0){
				                    DisablePlayerCheckpoint(i);
									SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2], 2);
								}
								playerCheckpoint[i] = j;
							}
						}
		            } else {
				        if(Pizza[i] == 0){
			            	if(playerCheckpoint[i]==j) {
		    	        	    DisablePlayerCheckpoint(i);
		        	    	    playerCheckpoint[i] = 999;
		        	    	}
	         	    	}
			        }
				}
			}
		}
	}
}

	SetTimer("checkpointUpdate", 200, 1);