Hallo User
ich habe mir ein Tacho gemacht per Testdraw
dazu habe ich 2 fragen
1. ich würde gerne das teile des Tachos weiß machen
ich hätte es gerne so:
Carname (weiß)
Km/h(Grün) 78(Weiß)
Tank(Grün) 66 (Weiß)
Zustand(grün) 1000 (weiß)
2: Möchte ich es gerne so haben das wen der Motor an Ist der I strich grün ist und wen er aus ist Rot
wie machen ich das (das gleiche bei Licht)?
Code:
new Text:pSpeedo[MAX_PLAYERS][5];
new pSpeedoOn[MAX_PLAYERS];
new pSpeedoT[MAX_PLAYERS];
if(pSpeedoOn[playerid] == 0)
{
pSpeedo[playerid][0] = TextDrawCreate(525.000000, 350.000000, "Carname");
TextDrawBackgroundColor(pSpeedo[playerid][0], 255);
TextDrawFont(pSpeedo[playerid][0], 1);
TextDrawLetterSize(pSpeedo[playerid][0], 0.449999, 1.000000);
TextDrawColor(pSpeedo[playerid][0], 8913151);
TextDrawSetOutline(pSpeedo[playerid][0], 0);
TextDrawSetProportional(pSpeedo[playerid][0], 1);
TextDrawSetShadow(pSpeedo[playerid][0], 1);
TextDrawUseBox(pSpeedo[playerid][0], 1);
TextDrawBoxColor(pSpeedo[playerid][0], 101);
TextDrawTextSize(pSpeedo[playerid][0], 643.000000, -113.000000);
pSpeedo[playerid][1] = TextDrawCreate(525.000000, 362.000000, "Km/h:");
TextDrawBackgroundColor(pSpeedo[playerid][1], 255);
TextDrawFont(pSpeedo[playerid][1], 1);
TextDrawLetterSize(pSpeedo[playerid][1], 0.449999, 1.000000);
TextDrawColor(pSpeedo[playerid][1], 8913151);
TextDrawSetOutline(pSpeedo[playerid][1], 0);
TextDrawSetProportional(pSpeedo[playerid][1], 1);
TextDrawSetShadow(pSpeedo[playerid][1], 1);
TextDrawUseBox(pSpeedo[playerid][1], 1);
TextDrawBoxColor(pSpeedo[playerid][1], 101);
TextDrawTextSize(pSpeedo[playerid][1], 640.000000, 0.000000);
pSpeedo[playerid][2] = TextDrawCreate(525.000000, 374.000000, "Tank:");
TextDrawBackgroundColor(pSpeedo[playerid][2], 255);
TextDrawFont(pSpeedo[playerid][2], 1);
TextDrawLetterSize(pSpeedo[playerid][2], 0.449999, 1.000000);
TextDrawColor(pSpeedo[playerid][2], 8913151);
TextDrawSetOutline(pSpeedo[playerid][2], 0);
TextDrawSetProportional(pSpeedo[playerid][2], 1);
TextDrawSetShadow(pSpeedo[playerid][2], 1);
TextDrawUseBox(pSpeedo[playerid][2], 1);
TextDrawBoxColor(pSpeedo[playerid][2], 101);
TextDrawTextSize(pSpeedo[playerid][2], 640.000000, 0.000000);
pSpeedo[playerid][3] = TextDrawCreate(525.000000, 386.000000, "Zustand:");
TextDrawBackgroundColor(pSpeedo[playerid][3], 255);
TextDrawFont(pSpeedo[playerid][3], 1);
TextDrawLetterSize(pSpeedo[playerid][3], 0.450000, 1.000000);
TextDrawColor(pSpeedo[playerid][3], 8913151);
TextDrawSetOutline(pSpeedo[playerid][3], 0);
TextDrawSetProportional(pSpeedo[playerid][3], 1);
TextDrawSetShadow(pSpeedo[playerid][3], 1);
TextDrawUseBox(pSpeedo[playerid][3], 1);
TextDrawBoxColor(pSpeedo[playerid][3], 101);
TextDrawTextSize(pSpeedo[playerid][3], 640.000000, 0.000000);
pSpeedo[playerid][4] = TextDrawCreate(525.000000, 398.000000, "Motor: I Licht: I");
TextDrawBackgroundColor(pSpeedo[playerid][4], 255);
TextDrawFont(pSpeedo[playerid][4], 1);
TextDrawLetterSize(pSpeedo[playerid][4], 0.300000, 0.899999);
TextDrawColor(pSpeedo[playerid][4], 8913151);
TextDrawSetOutline(pSpeedo[playerid][4], 0);
TextDrawSetProportional(pSpeedo[playerid][4], 1);
TextDrawSetShadow(pSpeedo[playerid][4], 1);
TextDrawUseBox(pSpeedo[playerid][4], 1);
TextDrawBoxColor(pSpeedo[playerid][4], 101);
TextDrawTextSize(pSpeedo[playerid][4], 650.000000, 0.000000);
pSpeedoOn[playerid] = 1;
}
Alles anzeigen
stock UpdateSpeedo(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
{
Speedo(playerid,0);
} else if(pSpeedoOn[playerid] == 2) {
new veh = GetPlayerVehicleID(playerid);
new model= GetVehicleModel(veh);
new str[60];
TextDrawSetString(pSpeedo[playerid][0],CarName[model-400]);
new speed = GetPlayerSpeed(playerid, true);
if(model == 509 || model == 510|| model == 481)
{
speed = floatround(speed *0.5);
} else {
speed = floatround(speed * 0.95);
}
format(str,sizeof(str),"Km/H: %d",speed);
TextDrawSetString(pSpeedo[playerid][1],str);
new zustand = GetVehicleZustandProzent(veh,true);
format(str,sizeof(str),"Zustand: %d",zustand);
TextDrawSetString(pSpeedo[playerid][3],str);
}
}
stock Speedo(playerid,speedostate)
{
switch (speedostate)
{
case 0: //aus
{
if(pSpeedoOn[playerid] != 2) {return 0;}
KillTimer(pSpeedoT[playerid]);
for(new i=0;i<5;i++)
{
TextDrawHideForPlayer(playerid,pSpeedo[playerid][i]);
}
pSpeedoOn[playerid] = 1;
}
case 1: // An
{
if(pSpeedoOn[playerid] != 1) {return 0;}
pSpeedoT[playerid] = SetTimerEx("PlayerSpeedo",175,1,"d",playerid);
UpdateSpeedo(playerid);
for(new i=0;i<5;i++)
{
TextDrawShowForPlayer(playerid,pSpeedo[playerid][i]);
}
pSpeedoOn[playerid] = 2;
}
}
return 1;
}
Alles anzeigen