Hey ich weiß nicht richtig wie ich es beschreiben soll ich zeig einfach mal das was ich habe auf jedenfall wird im Textdraw nur %i angezeigt....
new tanktimer =0;
public Sekunde(playerid)
{
new sekunden,minuten,stunden,string[128];
gettime(stunden,minuten,sekunden);
format(string,sizeof(string),"%02d:%02d:%02d",stunden,minuten,sekunden);
TextDrawSetString(TDEditor_TD[0],string);
TextDrawShowForPlayer(playerid,TDEditor_TD[0]);
new string1[128];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))continue;
if(IsPlayerInAnyVehicle(i))continue;
new vID = GetPlayerVehicleID(i);
format(string1, sizeof(string), "Tank: %i%%", tank[vID]);
PlayerTextDrawSetString(i,TDEditor_PTD[i][5],string1);
}
tanktimer++;
if(tanktimer == 26)
{
tanktimer = 0;
//Tanks red.
for(new i=1; i<sizeof(tank); i++)
{
if(isMotorOn(i))continue;
tank[i]--;
}
}
return 1;
}
Unter OnGameModeInit:
for(new i=0; i<sizeof(tank); i++)
{
tank[i]=100;
}
TDEditor_PTD[playerid][5] = CreatePlayerTextDraw(playerid, 512.588256, 384.250122, "Tank: %i");
PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][5], 0.400000, 1.600000);
PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][5], 1);
PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][5], -1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][5], 0);
PlayerTextDrawSetOutline(playerid, TDEditor_PTD[playerid][5], 0);
PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][5], 255);
PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][5], 1);
PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][5], 1);
PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][5], 0);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][5]);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_DRIVER)
{
new vID=GetPlayerVehicleID(playerid);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][1]);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][2]);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][3]);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][4]);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][5]);
PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][6]);
if(!hasEngine(vID))
{
new a,b,c,d,e,f;
//Motor an/ausschalten
GetVehicleParamsEx(vID, a,a,b,c,d,e,f);
SetVehicleParamsEx(vID, 1, a,b,c,d,e,f);
}
for(new i=0; i<sizeof(ahCars); i++)
{
if(ahCars[i][id_x]!=vID)continue;
//Verkaufsprozess
SetPVarInt(playerid,"buyCarID",i);
new string[256];
format(string,sizeof(string),"Möchten sie das Fahrzeug für %i$ kaufen?",ahCars[i][c_preis]);
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_STYLE_MSGBOX,"Autoverkauf",string,"Ja","Nein");
break;
}
return 1;
}
if(newstate==PLAYER_STATE_ONFOOT)
{
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][0]);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][1]);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][2]);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][3]);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][4]);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][5]);
PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][6]);
}
return 1;
}
sollte etwas fehlen bescheid sagen und schaue dann ob ich es im script habe //habe zudem keine Errors/Warnings