All pastes #583512 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-22 12:10 UTC
rendered paste body
public speed(){
	for(new i = 0; i <= MAX_PLAYERS; i+){
	    if(IsPlayerConnected(i)){
	        if(IsPlayerInAnyVehicle(i)){
	            new dis, string[256];
	            if(gSpeedo[i] == 1) {
					dis = PlayerToCoord(i, gLastX[i], gLastY[i], gLastZ[i]);
					dis = dis * 60;
					dis = dis * 60;
					dis = floatround(dis / 1000);

	        		format(string, sizeof(string), "%i km/h", dis);

					TextDrawDestroy(showspeed[i]);
					showspeed[i] = TextDrawCreate(550, 50, string);
					TextDrawSetShadow(showspeed[i], 0);
					TextDrawColor(showspeed[i], COLOR_GREEN);
					TextDrawSetOutline(showspeed[i], 1);
					TextDrawShowForPlayer(i, showspeed[i]);

	                GetPlayerPos(i, gLastX[i], gLastY[i], gLastZ[i]);
				}
				if(gSpeedo[i] == 2) {
				    dis = PlayerToCoord(i, gLastX[i], gLastY[i], gLastZ[i]);
				    dis = dis / 1;
				    dis = dis * 2;
				    format(string, sizeof(string), "%i mp/h", dis);

					TextDrawDestroy(showspeed[i]);
					showspeed[i] = TextDrawCreate(550, 50, string);
					TextDrawSetShadow(showspeed[i], 0);
					TextDrawColor(showspeed[i], COLOR_GREEN);
					TextDrawSetOutline(showspeed[i], 1);
					TextDrawShowForPlayer(i, showspeed[i]);
					GetPlayerPos(i, gLastX[i], gLastY[i], gLastZ[i]);
				}
			}
		}
	}
}