public SekundenTimer9()
{
for(new i; i<MAX_PLAYERS; i++)
{
new string[500],Float:maxspeed = 200.0,playername[MAX_PLAYER_NAME],value,Float:xX,Float:yY,Float:zZ,Float:X,Float:Y,Float:Z;
if(IsPlayerConnected(i) && gPlayerLogged[i] && !IsPlayerNPC(i) && AFKModus[i] == 0)
{
new VID = GetPlayerVehicleID(i);
if(IsPlayerInAnyVehicle(i))
{
GetVehiclePos(VID, xX, yY, zZ);
GetVehicleVelocity(VID, X, Y, Z);
value = floatround(floatsqroot((X*X) + (Y*Y) + (Z*Z)) * 100 * 1.40);
new Float:TankInProzent = GasDaten[GetVehicleModel(VID)-400][Tankvolumen]/100;
if(Gas[VID]/TankInProzent >= 95)
{
SetPlayerProgressBarValue(i, TachoBar[i], 100);
}
else if(Gas[VID]/TankInProzent >= 90)
{
SetPlayerProgressBarValue(i, TachoBar[i], 90);
}
else if(Gas[VID]/TankInProzent >= 80)
{
SetPlayerProgressBarValue(i, TachoBar[i], 80);
}
else if(Gas[VID]/TankInProzent >= 70)
{
SetPlayerProgressBarValue(i, TachoBar[i], 70);
}
else if(Gas[VID]/TankInProzent >= 60)
{
SetPlayerProgressBarValue(i, TachoBar[i], 60);
}
else if(Gas[VID]/TankInProzent >= 50)
{
SetPlayerProgressBarValue(i, TachoBar[i], 50);
}
else if(Gas[VID]/TankInProzent >= 40)
{
SetPlayerProgressBarValue(i, TachoBar[i], 40);
}
else if(Gas[VID]/TankInProzent >= 30)
{
SetPlayerProgressBarValue(i, TachoBar[i], 30);
}
else if(Gas[VID]/TankInProzent >= 20)
{
SetPlayerProgressBarValue(i, TachoBar[i], 20);
}
else if(Gas[VID]/TankInProzent >= 10)
{
SetPlayerProgressBarValue(i, TachoBar[i], 10);
}
else if(Gas[VID]/TankInProzent >= 0)
{
SetPlayerProgressBarValue(i, TachoBar[i], 0);
}
if(GetPlayerState(i) == 2){
UpdatePlayerProgressBar(i, TachoBar[i]);
}
GetVehicleVelocity(GetPlayerVehicleID(i) ,X, Y, Z);
value = floatround(floatsqroot((X*X) + (Y*Y) + (Z*Z)) * 100 * 1.40);
new Motor[80], HBremse[80], Licht[80];
new Float:carhealth;
GetVehicleHealth(GetPlayerVehicleID(i),carhealth);
new Float:x,Float:y,Float:z;
GetPlayerPos(i,x,y,z);
new Float:x2, Float:y2, Float:z2, Float:output;
GetVehiclePos(VID, x2, y2, z2);
output = floatsqroot(floatpower(floatabs(floatsub(x2, vLastX[VID])), 2)+floatpower(floatabs(floatsub(y2, vLastY[VID])), 2)+floatpower(floatabs(floatsub(z2, vLastZ[VID])), 2));
Kilometerstand[VID] += output;
vLastX[VID] = x2; vLastY[VID] = y2; vLastZ[VID] = z2;
Tankkm[VID] += output;
if(Gas[GetPlayerVehicleID(i)] <= 0.00)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPlayerVehicleID(i),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(i),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Gas[GetPlayerVehicleID(i)] = 0.00;
}
if(Motorschaden[VID] == 1 && carhealth < 250)
{
SetVehicleHealth(VID, 250);
}
/*if(carhealth < 250 && Motorschaden[VID] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SetVehicleHealth(VID, 250);
Motorschaden[VID] = 1;
}*/
if((Tankkm[GetPlayerVehicleID(i)]/1000) >= 1)
{
Gas[GetPlayerVehicleID(i)] -= GasDaten[GetVehicleModel(GetPlayerVehicleID(i))-400][Tankverbrauch];
Tankkm[GetPlayerVehicleID(i)] = 0.00;
}
if(IsAPlane(VID) || IsABoat(VID) || IsAFahrrad(VID))
{
format(string,sizeof(string),"Fahrzeug: ~g~%s",VehNames[GetVehicleModel(VID)-400]);
PlayerTextDrawSetString(i, Tacho[i][1], string);
format(string,sizeof(string),"Geschwindigkeit: ~g~%d",value);
PlayerTextDrawSetString(i, Tacho[i][2], string);
format(string,sizeof(string),"Zustand: ~g~%.2f%%",carhealth);
PlayerTextDrawSetString(i, Tacho[i][3], string);
format(string,sizeof(string),"KM-Stand: ~g~%.2f",Kilometerstand[VID]/1000);
PlayerTextDrawSetString(i, Tacho[i][4], string);
format(string,sizeof(string),"~g~Nicht Vorhanden");
PlayerTextDrawSetString(i, Tacho[i][6], string);
if(MotorSystemMotor[VID] == false){
format(Motor,sizeof(Motor),"~r~Motor");
}else{
format(Motor,sizeof(Motor),"~g~Motor");
}
if(MotorSystemLight[VID] == false){
format(Licht,sizeof(Licht),"~r~Licht");
}else{
format(Licht,sizeof(Licht),"~g~Licht");
}
if(Handbremse[VID] == false){
format(HBremse,sizeof(HBremse),"~r~Handbremse");
}else{
format(HBremse,sizeof(HBremse),"~g~Handbremse");
}
format(string,sizeof(string),"%s %s %s", Motor, HBremse, Licht);
PlayerTextDrawSetString(i, Tacho[i][8], string);
}
if(!IsAPlane(VID) && !IsABoat(VID) && !IsAFahrrad(VID))
{
format(string,sizeof(string),"Fahrzeug: ~g~%s",VehNames[GetVehicleModel(VID)-400]);
PlayerTextDrawSetString(i, Tacho[i][1], string);
format(string,sizeof(string),"Geschwindigkeit: ~g~%d",value);
PlayerTextDrawSetString(i, Tacho[i][2], string);
format(string,sizeof(string),"Zustand: ~g~%.2f%%",carhealth);
PlayerTextDrawSetString(i, Tacho[i][3], string);
format(string,sizeof(string),"KM-Stand: ~g~%.2f",Kilometerstand[VID]/1000);
PlayerTextDrawSetString(i, Tacho[i][4], string);
format(string,sizeof(string),"~g~%.2f/%.2fL",Gas[VID],GasDaten[GetVehicleModel(VID)-400][Tankvolumen]);
PlayerTextDrawSetString(i, Tacho[i][6], string);
if(MotorSystemMotor[VID] == false)
{
format(Motor,sizeof(Motor),"~r~Motor");
}
else
{
format(Motor,sizeof(Motor),"~g~Motor");
}
if(MotorSystemLight[VID] == false)
{
format(Licht,sizeof(Licht),"~r~Licht");
}
else
{
format(Licht,sizeof(Licht),"~g~Licht");
}
if(Handbremse[VID] == false)
{
format(HBremse,sizeof(HBremse),"~r~Handbremse");
}
else
{
format(HBremse,sizeof(HBremse),"~g~Handbremse");
}
format(string,sizeof(string),"%s %s %s", Motor, HBremse, Licht);
PlayerTextDrawSetString(i, Tacho[i][8], string);
VehSpeed[VID] = value;
new model = GetVehicleModel(VID);
if(model == 528){
GetPlayerPos(i,x,y,z);
format(string,sizeof(string),"~w~X: ~g~%.1f ~w~Y: ~g~%.1f ~w~Z: ~g~%.1f",x,y,z);
PlayerTextDrawSetString(i, FBITacho[i], string);
}
}
if(Gas[GetPlayerVehicleID(i)] > GasDaten[GetPlayerVehicleID(i)][Tankvolumen])
{
Gas[GetPlayerVehicleID(i)] = GasDaten[GetPlayerVehicleID(i)][Tankvolumen];
}
}
else
{
PlayerTextDrawHide(i,Tacho[i][0]);
PlayerTextDrawHide(i,Tacho[i][1]);
PlayerTextDrawHide(i,Tacho[i][2]);
PlayerTextDrawHide(i,Tacho[i][3]);
PlayerTextDrawHide(i,Tacho[i][4]);
PlayerTextDrawHide(i,Tacho[i][5]);
PlayerTextDrawHide(i,Tacho[i][6]);
PlayerTextDrawHide(i,Tacho[i][7]);
PlayerTextDrawHide(i,Tacho[i][8]);
HidePlayerProgressBar(i, TachoBar[i]);
PlayerTextDrawHide(i,FBITacho[i]);
}
}
}
return 1;
}
Alles anzeigen