Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(new i=0; i<SLOTS; i++)
- {
- new vehid = GetPlayerVehicleID(i);
- new vehmodel = GetVehicleModel(vehid);
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsANoTachoVehicle(vehid))
- {
- for(new x = 0; x < MaxVeh; x++)
- {
- GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
- GetVehicleHealth(vehid, Speedo_HP);
- new str1[256],str2[256],str3[256],str4[256];
- if(SpeedoON[i] == 0)
- {
- TextDrawShowForPlayer(i, box[i]); TextDrawShowForPlayer(i, fahrzeug[i]); TextDrawShowForPlayer(i, kmh[i]);
- TextDrawShowForPlayer(i, hoehe[i]); TextDrawShowForPlayer(i, zustand[i]); TextDrawShowForPlayer(i, kilometer[i]);
- SpeedoON[i] = 1;
- }
- new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
- GetVehicleVelocity(vehid, speed_x, speed_y, speed_z);
- final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*120.0; // 136.666667 = kmph // 85.4166672= mph
- final_speed_int = floatround(final_speed,floatround_round);
- new kmh_anzahl = final_speed_int;
- format(str1,sizeof(str1),"Fahrzeug: ~y~%s",VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
- TextDrawSetString(fahrzeug[i], str1);
- if(kmh_anzahl >= 150)
- {
- format(str2,sizeof(str2),"KM/H: ~r~%d",kmh_anzahl);
- TextDrawSetString(kmh[i], str2);
- }
- else if(kmh_anzahl >= 100)
- {
- format(str2,sizeof(str2),"KM/H: ~y~%d",kmh_anzahl);
- TextDrawSetString(kmh[i], str2);
- }
- else if(kmh_anzahl >= 50)
- {
- format(str2,sizeof(str2),"KM/H: ~g~%d",kmh_anzahl);
- TextDrawSetString(kmh[i], str2);
- }
- else
- {
- format(str2,sizeof(str2),"KM/H: ~b~%d",kmh_anzahl);
- TextDrawSetString(kmh[i], str2);
- }
- if(Speedo_HP >= 551)
- {
- format(str4,sizeof(str4),"Zustand: ~g~%.1f%", Speedo_HP/10); //%.2f
- TextDrawSetString(zustand[i], str4);
- }
- else if(Speedo_HP >= 361)
- {
- format(str4,sizeof(str4),"Zustand: ~y~%.1f%", Speedo_HP/10);
- TextDrawSetString(zustand[i], str4);
- }
- else
- {
- format(str4,sizeof(str4),"Zustand: ~r~%.1f%", Speedo_HP/10);
- TextDrawSetString(zustand[i], str4);
- }
- //new Float:mycarX,Float:mycarY,Float:mycarZ;
- //GetPlayerPos(i, mycarX,mycarY,mycarZ);
- //PlayerCar[i][Dtc_PlayerKey[i]][CarPos_x] = mycarX;
- //PlayerCar[i][Dtc_PlayerKey[i]][CarPos_y] = mycarY;
- //PlayerCar[i][Dtc_PlayerKey[i]][CarPos_z] = mycarZ;
- new owner = GetPlayerIdFromName(GetPlayerCarOwner(GetPlayerVehicleID(i))); //breadfish
- if(engine == 1)
- {
- if(IsAPlane(vehid) || IsABoat(vehid) || vehmodel == 462 || vehmodel == 481 || vehmodel == 431 || vehmodel == 437 || vehmodel == 511 || vehmodel == 577) // 462 = Faggio , 481 = BMX , 431 = Bus , 437 = Coach
- {
- return 1;
- }
- if(PlayerCar[owner][x][CarId] == vehid)
- {
- if(PlayerCar[owner][x][Fuel] < 99)
- {
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- if(vehid != INVALID_VEHICLE_ID)
- {
- SetVehicleParamsEx(vehid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
- }
- PlayerCar[owner][x][Fuel] = 0;
- format(string, sizeof(string), "~r~Tank leer");
- GameTextForPlayer(i,string,5000,3);
- }
- }
- }
- else
- {
- SendClientMessage(i,F_Gray,"Woran scheiterts 1 ?");
- for(new fc = 0; fc<sizeof(FactionCars); fc++)
- {
- format(string, sizeof(string), "1 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
- SendClientMessage(i,F_Gray,string);
- if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
- {
- format(string, sizeof(string), "2 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
- SendClientMessage(i,F_Gray,string);
- if(vehid == FactionCars[fc][fCarid])
- {
- format(string, sizeof(string), "3 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
- SendClientMessage(i,F_Gray,string);
- if(FactionCars[fc][fFuel] < 99)
- {
- format(string, sizeof(string), "4 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
- SendClientMessage(i,F_Gray,string);
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- SendClientMessage(i,F_Gray,"Woran scheiterts 6 ?");
- if(vehid != INVALID_VEHICLE_ID)
- {
- SendClientMessage(i,F_Gray,"Woran scheiterts 7 ?");
- SetVehicleParamsEx(vehid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
- }
- SendClientMessage(i,F_Gray,"Woran scheiterts 8 ?");
- FactionCars[fc][fFuel] = 0;
- format(string, sizeof(string), "~r~Tank leer");
- GameTextForPlayer(i,string,5000,3);
- SendClientMessage(i,F_Gray,"Woran scheiterts 9 ?");
- }
- }
- }
- }
- }
- }
- if(PlayerCar[owner][x][Fuel]/99 > 3)
- {
- format(str3,sizeof(str3),"Tank: ~g~%d / %d Liter", PlayerCar[owner][x][Fuel]/99, CarInfo[vehmodel-400][ci_CarMaxGas]);
- }
- else
- {
- PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
- format(str3,sizeof(str3),"Tank: ~r~%d~g~ / %d Liter", PlayerCar[owner][x][Fuel]/99, CarInfo[vehmodel-400][ci_CarMaxGas]);
- }
- TextDrawSetString(hoehe[i], str3);
- SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement