Hey liebe Leute,
ich habe das Problem, dass ich gerne die KMH + Benzinanzeige gleichzeitig laufen lassen würde. Beide werden aber per GameText angezeigt =/. Also muss ich ja mind. eins in Textdraw umwandeln.
Versteh das aber nicht so ganz.
Könnte mir jemand helfen?
Codes:
Benzin:
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);
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), "~g~~n~~n~~n~~n~~n~~n~~n~ Benzin:~w~ %d",Gas[vehicle]);
}
if(IsAPlane(vehicle) || IsABoat(vehicle)) { Gas[vehicle]++; }
Gas[vehicle]--;
}
else
{
NoFuel[i] = 1;
TogglePlayerControllable(i, 0);
GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~Der Tank ist leer~n~Benutze /exit um das Fahrzeug zu verlassen",1500,3);
}
}
}
}
return 1;
}
KMH:
if(TelePos[i][0] != 0.0)
{
new Float:xdist = TelePos[i][3]-TelePos[i][0];
new Float:ydist = TelePos[i][4]-TelePos[i][1];
new Float:sqxdist = xdist*xdist;
new Float:sqydist = ydist*ydist;
new Float:distance = (sqxdist+sqydist)/31;
new Float:speed2 = distance * 1.609;
if(gSpeedo[i] == 2)
{
if(distance <10)
{
format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~KMH: ~w~%.0f",speed2);
}
if(distance > 10 && distance < 100)
{
format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~KMH: ~w~%.0f",speed2);
}
if(distance > 100)
{
format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~KMH:~w~%.0f",speed2);
}
GameTextForPlayer(i, string, 2000, 3);
}
if(distance > maxspeed && PlayerInfo[i][pAdmin] < 1)
{
new tmpcar = GetPlayerVehicleID(i);
if(!IsAPlane(tmpcar))
{
GetPlayerName(i, plname, sizeof(plname));
format(string, 256, "AdmWarnung: [%d]%s %.KMH",i,plname,speed2);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}