Hi Leute ..
Ich habe ein ziemlich großes Problem und zwar habe ich ein neuen Tacho eingebaut und nun wenn der Tank leer ist fährt der wagen noch ein Stück weiter am besten wäre wenn ihr euch das mal per Teamviewer anschaut weil ich es schwer erklären kann addet mich in skype wenn ihr mir Helfen könnt
Skype: xxxRoberxxx
Code Schnippsel der Tachos
public OnPlayerStateChange(playerid, newstate, oldstate)
{
M_OnPlayerStateChange(playerid, newstate, oldstate);
new string[256];
if(newstate == PLAYER_STATE_DRIVER) {
new Float:health;
GetVehicleHealth(GetPlayerVehicleID(playerid),health);
SendClientMessage(playerid, COLOR_LIGHTBLUE,"* Du kannst deinen Motor nun mithilfe von /Engine [on/off] oder mit der rechten STRG Taste starten");
if (health >= 900 && health <= 1000)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,TACHO4);
}
else if (health >= 800 && health <= 900)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND10);
}
else if (health >= 700 && health <= 800)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND9);
}
else if (health >= 600 && health <= 700)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND8);
}
else if (health >= 500 && health <= 600)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND7);
}
else if (health >= 400 && health <= 500)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND6);
}
else if (health >= 300 && health <= 400)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND5);
}
else if (health >= 200 && health <= 300)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND4);
}
else if (health >= 100 && health <= 200)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND3);
}
else if (health >= 0 && health <= 100)
{
TextDrawShowForPlayer(playerid,TACHO0);
TextDrawShowForPlayer(playerid,TACHO1);
TextDrawShowForPlayer(playerid,TACHO2);
TextDrawShowForPlayer(playerid,TACHO3);
TextDrawShowForPlayer(playerid,TACHO6);
TextDrawShowForPlayer(playerid,TACHO5);
TextDrawShowForPlayer(playerid,ZUSTAND0);
}
}
else {
TextDrawHideForPlayer(playerid,TACHO0);
TextDrawHideForPlayer(playerid,TACHO1);
TextDrawHideForPlayer(playerid,TACHO2);
TextDrawHideForPlayer(playerid,TACHO3);
TextDrawHideForPlayer(playerid,TACHO6);
TextDrawHideForPlayer(playerid,TACHO5);
TextDrawHideForPlayer(playerid,TACHO4);
TextDrawHideForPlayer(playerid,ZUSTAND3);
TextDrawHideForPlayer(playerid,ZUSTAND0);
TextDrawHideForPlayer(playerid,ZUSTAND4);
TextDrawHideForPlayer(playerid,ZUSTAND5);
TextDrawHideForPlayer(playerid,ZUSTAND6);
TextDrawHideForPlayer(playerid,ZUSTAND7);
TextDrawHideForPlayer(playerid,ZUSTAND8);
TextDrawHideForPlayer(playerid,ZUSTAND9);
TextDrawHideForPlayer(playerid,ZUSTAND10);
}
public VehStateCheck(playerid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && !IsANoTachoVehicle(GetPlayerVehicleID(i)))
{
if(M_Bot[i][PAFK] == 0)
{
new Float:health,vehicleid = GetPlayerVehicleID(i),string[256],Float:value,Float:x,Float:y,Float:z;
GetPlayerPos(i, x, y, z);
GetVehicleSpeed(GetPlayerVehicleID(i),value);
GetVehicleHealth(vehicleid,health);
// 0 BENZIN ; 1 KMH; 2 ZUSTAND; 3 NONE; 4 NONE; 5 NAME VOM SERVER;
//format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~w~%d~w~ ~n~~w~%d ~b~/~w~ %d~r~ ~n~~g~%s",floatround(value, floatround_floor),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
//GameTextForPlayer(i,string,850,3);
format(string, sizeof(string),"~w~%d ~b~/~w~ %d Benzin",Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)));
TextDrawSetString(TACHO0,string);
format(string, sizeof(string),"~w~%d KM/H",floatround(value, floatround_floor));
TextDrawSetString(TACHO1,string);
format(string, sizeof(string),"~r~%s",VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
TextDrawSetString(TACHO6,string);
//format(string, sizeof(string),"",);
PCarPos[i][PCarX] = x;
PCarPos[i][PCarY] = y;
PCarPos[i][PCarZ] = z;
}
}
}
return 1;
}
//Timer dazu :
public CheckGas()
{
new string[256];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(i);
new Model = GetVehicleModel(GetPlayerVehicleID(i));
if(Gas[vehicle] >= 1)
{
if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); }
if(gGas[i] == 1) {
format(string, sizeof(string),"~w~%d ~b~/~w~ %d Benzin",Gas[vehicle]);
TextDrawSetString(TACHO0,string); }
if(IsAPlane(vehicle) || IsABoat(vehicle) || Model == 462 || Model == 481) { Gas[vehicle]++; }
Gas[vehicle]--;
}
else
{
NoFuel[i] = 1;
FreezePlayer(i);
GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~Kein Benzin mehr~n~Gib /exit zum ausgestiegen ein",1500,3);
}
if(Gas[vehicle] > GetGasMax(GetVehicleModel(vehicle)))
{
Gas[vehicle] = GetGasMax(GetVehicleModel(vehicle));
}
}
}
}
return 1;
}
PS : der Zustand wird leider auch nicht aktualisiert wer mir dabei auch helfen könnte wäre wirklich sehr Freundlich !!
Mfg Rober