03.06.2011, 18:20
Код:
public StoppedVehicle() { new Float:x,Float:y,Float:z; new Float:distance,value; for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInAnyVehicle(i)) { new VID; VID = GetPlayerVehicleID(i); GetPlayerPos(i, x, y, z); distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2)); value = floatround(distance * 3600); if(UpdateSeconds > 1) { value = floatround(value / UpdateSeconds); } if(SpeedMode) { } if(value == 0) { Gas[VID]++; } SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; } } } return 1; }