Beiträge von Marschl
-
-
Hallo,
wie kann man bei einem Auto einen Kilometerstand und ein Tank einbauen?
Ansätze reichen
Ich hoffe ihr könnt mir helfen
Mit freundlichen Grüßen
-
Code
Alles anzeigenCMD:lieferung(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(GetVehicleModel(vehicleid) == 428) { ShowPlayerDialog(playerid, DIALOG_LIEFERUNGW, DIALOG_STYLE_LIST, "Transport GmbH - Firmen Übersicht", "Waffenkammer LSPD\nWaffenkammer FBI\nWaffenkammer LVPD", "GPS", "Schließen"); } else if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514) { if(GetVehicleModel(GetVehicleTrailer(vehicleid)) == 435) { ShowPlayerDialog(playerid, DIALOG_LIEFERUNGP, DIALOG_STYLE_LIST, "Transport GmbH - Firmen Übersicht","Ammunation LS\nAmmunation SF\nAmmunation LV\nTelefon BIZ\nHaus Upgrade\nWerbeagentur\nSupermarkt\nPaintball\nKart Bahn\nFahrzeuglackiererei","GPS", "Schließen"); } } else if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514) //Geht nicht { if(GetVehicleModel(GetVehicleTrailer(vehicleid)) == 584) { ShowPlayerDialog(playerid, DIALOG_LIEFERUNGT, DIALOG_STYLE_LIST, "Transport GmbH - Tankstellen Übersicht","Temple Station\nIdlewood\nFlint County\nWhetstone\nDoherty\nJuniper Hill\nAngel Pine\nEaster Basin\nEmerald Isle\nBone County\nTierra Robada\nFort Carson","GPS", "Schließen"); } } return 1; }probiere es mal so

-
Ja hat sich erledigt danke. Wie Health Float vom Auto wie kann man die umrechnen? dass die nur von 100 -0 geht anstatt von 1000-0
-
Dann muss ich ja den Timer ändern oder?
-
Funktioniert immer noch nicht. Steht nur im Textdraw eine 1
-
Ich hab ja schon ein Teil

Also wenn der Spieler in das Auto einsteigt wird ein Timer gestartet der das aufruft:
forward GetVehicleSpeed(playerid);
public GetVehicleSpeed(playerid)
{
new vID = GetPlayerVehicleID(playerid);
VehicleSpeed(vID);
return vID;
}Vehicle Speed:
stock VehicleSpeed(vehicleid)
{
new Float:xPos[3];
GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00);
}format(tcn1, sizeof(tcn), "%d", GetVehicleSpeed(playerid));
PlayerTextDrawSetString(playerid, Tacho9[playerid], tcn1);Leider Funktioniert es nicht

-
Wie kann ich den Speed vom Fahrzeug und den Zustand abfragen?
-
Ich möchte, dass wenn der Spieler in irgendeiner Art und weiße das Auto Verlässt, die Textdraws gelöscht werden.
Wo liegt hier der Fehler?
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_NONE)
{
PlayerTextDrawDestroy(playerid, Tacho1[playerid]);
PlayerTextDrawDestroy(playerid, Tacho2[playerid]);
PlayerTextDrawDestroy(playerid, Tacho3[playerid]);
PlayerTextDrawDestroy(playerid, Tacho4[playerid]);
PlayerTextDrawDestroy(playerid, Tacho5[playerid]);
PlayerTextDrawDestroy(playerid, Tacho6[playerid]);
PlayerTextDrawDestroy(playerid, Tacho7[playerid]);
PlayerTextDrawDestroy(playerid, Tacho8[playerid]);
PlayerTextDrawDestroy(playerid, Tacho9[playerid]);
PlayerTextDrawDestroy(playerid, Tacho10[playerid]);
PlayerTextDrawDestroy(playerid, Tacho11[playerid]);
PlayerTextDrawDestroy(playerid, Tacho12[playerid]);
} -
wie kann ich das beheben?
-
Wie gesagt dann geht es ja
-
Also bei mir nicht, kann es eventuell daran liegen wie ich den Car Name Abfrage?
Weil ohne das geht es nämlich
-
public OnPlayerConnect(playerid)
{
//Tacho
Tacho1[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 360.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Tacho1[playerid], 255);
PlayerTextDrawFont(playerid, Tacho1[playerid], 1);
PlayerTextDrawLetterSize(playerid, Tacho1[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Tacho1[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho1[playerid], 0);
PlayerTextDrawSetProportional(playerid, Tacho1[playerid], 1);
PlayerTextDrawSetShadow(playerid, Tacho1[playerid], 1);
PlayerTextDrawUseBox(playerid, Tacho1[playerid], 1);
PlayerTextDrawBoxColor(playerid, Tacho1[playerid], 119);
PlayerTextDrawTextSize(playerid, Tacho1[playerid], 621.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid, Tacho1[playerid], 0);Tacho2[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 374.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Tacho2[playerid], 255);
PlayerTextDrawFont(playerid, Tacho2[playerid], 1);
PlayerTextDrawLetterSize(playerid, Tacho2[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Tacho2[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho2[playerid], 0);
PlayerTextDrawSetProportional(playerid, Tacho2[playerid], 1);
PlayerTextDrawSetShadow(playerid, Tacho2[playerid], 1);
PlayerTextDrawUseBox(playerid, Tacho2[playerid], 1);
PlayerTextDrawBoxColor(playerid, Tacho2[playerid], 119);
PlayerTextDrawTextSize(playerid, Tacho2[playerid], 621.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid, Tacho2[playerid], 0);Tacho3[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 388.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Tacho3[playerid], 255);
PlayerTextDrawFont(playerid, Tacho3[playerid], 1);
PlayerTextDrawLetterSize(playerid, Tacho3[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Tacho3[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho3[playerid], 0);
PlayerTextDrawSetProportional(playerid, Tacho3[playerid], 1);
PlayerTextDrawSetShadow(playerid, Tacho3[playerid], 1);
PlayerTextDrawUseBox(playerid, Tacho3[playerid], 1);
PlayerTextDrawBoxColor(playerid, Tacho3[playerid], 119);
PlayerTextDrawTextSize(playerid, Tacho3[playerid], 621.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid, Tacho3[playerid], 0);Tacho4[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 402.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Tacho4[playerid], 255);
PlayerTextDrawFont(playerid, Tacho4[playerid], 1);
PlayerTextDrawLetterSize(playerid, Tacho4[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Tacho4[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho4[playerid], 0);
PlayerTextDrawSetProportional(playerid, Tacho4[playerid], 1);
PlayerTextDrawSetShadow(playerid, Tacho4[playerid], 1);
PlayerTextDrawUseBox(playerid, Tacho4[playerid], 1);
PlayerTextDrawBoxColor(playerid, Tacho4[playerid], 119);
PlayerTextDrawTextSize(playerid, Tacho4[playerid], 621.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid, Tacho4[playerid], 0);Tacho5[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 416.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Tacho5[playerid], 255);
PlayerTextDrawFont(playerid, Tacho5[playerid], 1);
PlayerTextDrawLetterSize(playerid, Tacho5[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Tacho5[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho5[playerid], 0);
PlayerTextDrawSetProportional(playerid, Tacho5[playerid], 1);
PlayerTextDrawSetShadow(playerid, Tacho5[playerid], 1);
PlayerTextDrawUseBox(playerid, Tacho5[playerid], 1);
PlayerTextDrawBoxColor(playerid, Tacho5[playerid], 119);
PlayerTextDrawTextSize(playerid, Tacho5[playerid], 621.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid, Tacho5[playerid], 0);Tacho6[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 430.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Tacho6[playerid], 255);
PlayerTextDrawFont(playerid, Tacho6[playerid], 1);
PlayerTextDrawLetterSize(playerid, Tacho6[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Tacho6[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho6[playerid], 0);
PlayerTextDrawSetProportional(playerid, Tacho6[playerid], 1);
PlayerTextDrawSetShadow(playerid, Tacho6[playerid], 1);
PlayerTextDrawUseBox(playerid, Tacho6[playerid], 1);
PlayerTextDrawBoxColor(playerid, Tacho6[playerid], 119);
PlayerTextDrawTextSize(playerid, Tacho6[playerid], 621.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid, Tacho6[playerid], 0);Tacho7[playerid] = CreatePlayerTextDraw(playerid, 512.000000, 359.000000, " "); //Besitzer
PlayerTextDrawBackgroundColor(playerid, Tacho7[playerid], 255);
PlayerTextDrawFont(playerid, Tacho7[playerid], 2);
PlayerTextDrawLetterSize(playerid, Tacho7[playerid], 0.270000, 1.100000);
PlayerTextDrawColor(playerid, Tacho7[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho7[playerid], 1);
PlayerTextDrawSetProportional(playerid, Tacho7[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tacho7[playerid], 0);Tacho8[playerid] = CreatePlayerTextDraw(playerid, 512.000000, 373.000000, " "); //Autoname
PlayerTextDrawBackgroundColor(playerid, Tacho8[playerid], 255);
PlayerTextDrawFont(playerid, Tacho8[playerid], 2);
PlayerTextDrawLetterSize(playerid, Tacho8[playerid], 0.270000, 1.100000);
PlayerTextDrawColor(playerid, Tacho8[playerid], -16776961);
PlayerTextDrawSetOutline(playerid, Tacho8[playerid], 1);
PlayerTextDrawSetProportional(playerid, Tacho8[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tacho8[playerid], 0);Tacho9[playerid] = CreatePlayerTextDraw(playerid, 512.000000, 387.000000, " "); //Schnelligkeit
PlayerTextDrawBackgroundColor(playerid, Tacho9[playerid], 255);
PlayerTextDrawFont(playerid, Tacho9[playerid], 2);
PlayerTextDrawLetterSize(playerid, Tacho9[playerid], 0.270000, 1.100000);
PlayerTextDrawColor(playerid, Tacho9[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho9[playerid], 1);
PlayerTextDrawSetProportional(playerid, Tacho9[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tacho9[playerid], 0);Tacho10[playerid] = CreatePlayerTextDraw(playerid, 512.000000, 401.000000, " "); //Zustand
PlayerTextDrawBackgroundColor(playerid, Tacho10[playerid], 255);
PlayerTextDrawFont(playerid, Tacho10[playerid], 2);
PlayerTextDrawLetterSize(playerid, Tacho10[playerid], 0.270000, 1.100000);
PlayerTextDrawColor(playerid, Tacho10[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho10[playerid], 1);
PlayerTextDrawSetProportional(playerid, Tacho10[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tacho10[playerid], 0);Tacho11[playerid] = CreatePlayerTextDraw(playerid, 512.000000, 415.000000, " "); //Tank
PlayerTextDrawBackgroundColor(playerid, Tacho11[playerid], 255);
PlayerTextDrawFont(playerid, Tacho11[playerid], 2);
PlayerTextDrawLetterSize(playerid, Tacho11[playerid], 0.270000, 1.100000);
PlayerTextDrawColor(playerid, Tacho11[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho11[playerid], 1);
PlayerTextDrawSetProportional(playerid, Tacho11[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tacho11[playerid], 0);Tacho12[playerid] = CreatePlayerTextDraw(playerid, 512.000000, 429.000000, " "); //Kilometerstand
PlayerTextDrawBackgroundColor(playerid, Tacho12[playerid], 255);
PlayerTextDrawFont(playerid, Tacho12[playerid], 2);
PlayerTextDrawLetterSize(playerid, Tacho12[playerid], 0.270000, 1.100000);
PlayerTextDrawColor(playerid, Tacho12[playerid], -1);
PlayerTextDrawSetOutline(playerid, Tacho12[playerid], 1);
PlayerTextDrawSetProportional(playerid, Tacho12[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tacho12[playerid], 0);
return 1;
} -
Funktioniert immer noch nicht

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_GELB, "Info: "HTML_WEIS"Du kannst das Fahrzeug "HTML_GELB"mit der Taste 2 oder mit /motor "HTML_WEIS"starten!");new tcn[24];
new mID = GetVehicleModel(GetPlayerVehicleID(playerid));
format(tcn, sizeof(tcn), "%s", VehicleNames[mID]);
PlayerTextDrawSetString(playerid, Tacho8[playerid], tcn);PlayerTextDrawShow(playerid, Tacho1[playerid]);
PlayerTextDrawShow(playerid, Tacho2[playerid]);
PlayerTextDrawShow(playerid, Tacho3[playerid]);
PlayerTextDrawShow(playerid, Tacho4[playerid]);
PlayerTextDrawShow(playerid, Tacho5[playerid]);
PlayerTextDrawShow(playerid, Tacho6[playerid]);
PlayerTextDrawShow(playerid, Tacho7[playerid]);
PlayerTextDrawShow(playerid, Tacho8[playerid]);
PlayerTextDrawShow(playerid, Tacho9[playerid]);
PlayerTextDrawShow(playerid, Tacho10[playerid]);
PlayerTextDrawShow(playerid, Tacho11[playerid]);
PlayerTextDrawShow(playerid, Tacho12[playerid]);
}
return 1;
} -
Funktioniert immernoch nicht

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_GELB, "Info: "HTML_WEIS"Du kannst das Fahrzeug "HTML_GELB"mit der Taste 2 oder mit /motor "HTML_WEIS"starten!");new tachocarname[24];
new vehicleid = GetPlayerVehicleID(playerid);
format(tachocarname, sizeof(tachocarname), "%s", vehName[vehicleid]);
PlayerTextDrawSetString(playerid, Tacho8[playerid], tachocarname);PlayerTextDrawShow(playerid, Tacho1[playerid]);
PlayerTextDrawShow(playerid, Tacho2[playerid]);
PlayerTextDrawShow(playerid, Tacho3[playerid]);
PlayerTextDrawShow(playerid, Tacho4[playerid]);
PlayerTextDrawShow(playerid, Tacho5[playerid]);
PlayerTextDrawShow(playerid, Tacho6[playerid]);
PlayerTextDrawShow(playerid, Tacho7[playerid]);
PlayerTextDrawShow(playerid, Tacho8[playerid]);
PlayerTextDrawShow(playerid, Tacho9[playerid]);
PlayerTextDrawShow(playerid, Tacho10[playerid]);
PlayerTextDrawShow(playerid, Tacho11[playerid]);
PlayerTextDrawShow(playerid, Tacho12[playerid]);
}
return 1;
} -
Ja werden sie
-
Oki danke

Noch eine Frage warum werden die Textdraws nicht beim einsteigen erstellt?
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_GELB, "Info: "HTML_WEIS"Du kannst das Fahrzeug "HTML_GELB"mit der Taste 2 oder mit /motor "HTML_WEIS"starten!");
PlayerTextDrawShow(playerid, Tacho1[playerid]);
PlayerTextDrawShow(playerid, Tacho2[playerid]);
PlayerTextDrawShow(playerid, Tacho3[playerid]);
PlayerTextDrawShow(playerid, Tacho4[playerid]);
PlayerTextDrawShow(playerid, Tacho5[playerid]);
PlayerTextDrawShow(playerid, Tacho6[playerid]);
PlayerTextDrawShow(playerid, Tacho7[playerid]);
PlayerTextDrawShow(playerid, Tacho8[playerid]);
PlayerTextDrawShow(playerid, Tacho9[playerid]);
PlayerTextDrawShow(playerid, Tacho10[playerid]);
PlayerTextDrawShow(playerid, Tacho11[playerid]);
PlayerTextDrawShow(playerid, Tacho12[playerid]);
}
return 1;
} -
Bei Sekunde wird nur ein % angezeigt
-
Danke @Canna
wie kann ich bei der Uhrzeit noch Sekunden ranhängen?
forward UpdateUhrzeit(playerid);
public UpdateUhrzeit(playerid)
{
new Hour,Minute,Sec,String[256];
gettime(Hour,Minute,Sec);
if(Hour<9 && Minute<9){format(String,sizeof(String),"0%d:0%d",Hour,Minute);}
else if(Hour>9 && Minute<9){format(String,sizeof(String),"%d:0%d",Hour,Minute);}
else if(Hour<9 && Minute>9){format(String,sizeof(String),"0%d:%d",Hour,Minute);}
else{format(String,sizeof(String),"%d:%d",Hour,Minute);}
PlayerTextDrawSetString(playerid, TimeDraw[playerid],String);
SetWorldTime(Hour);
return 1;
} -
Hallo,
wie kann ich in mein Textdraw dass aktuelle Datum eintragen?Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 559.000000, 6.000000, " ");
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 255);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.270000, 1.200000);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -16776961);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Textdraw0[playerid], 0);