Ganz oben:new Text:ZUSTAND;
new Text:TextZUSTAND[MAX_PLAYERS];
OnGameModeInit:
ZUSTAND = TextDrawCreate(500.000000, 381.000000, "Zustand: ");
TextDrawBackgroundColor(ZUSTAND, 255);
TextDrawFont(ZUSTAND, 1);
TextDrawLetterSize(ZUSTAND, 0.300000, 0.799999);
TextDrawColor(ZUSTAND, -1);
TextDrawSetOutline(ZUSTAND, 0);
TextDrawSetProportional(ZUSTAND, 1);
TextDrawSetShadow(ZUSTAND, 1);
TextDrawUseBox(ZUSTAND, 1);
TextDrawBoxColor(ZUSTAND, 225);
TextDrawTextSize(ZUSTAND, 605.000000, 0.000000);
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{ TextZUSTAND[playerid] = TextDrawCreate(500.000000, 392.000000, " ");
TextDrawBackgroundColor(TextZUSTAND[playerid], 255);
TextDrawFont(TextZUSTAND[playerid], 1);
TextDrawLetterSize(TextZUSTAND[playerid], 0.300000, 0.799999);
TextDrawColor(TextZUSTAND[playerid], -1);
TextDrawSetOutline(TextZUSTAND[playerid], 0);
TextDrawSetProportional(TextZUSTAND[playerid], 1);
TextDrawSetShadow(TextZUSTAND[playerid], 1);
TextDrawUseBox(TextZUSTAND[playerid], 1);
TextDrawBoxColor(TextZUSTAND[playerid], 225);
TextDrawTextSize(TextZUSTAND[playerid], 605.000000, 0.000000);
}
Wenn er im Auto ist:
if(newstate == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid,ZUSTAND);
TextDrawShowForPlayer(playerid,TextZUSTAND[playerid]);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid,ZUSTAND);
TextDrawHideForPlayer(playerid,TextZUSTAND[playerid]);
}
Public:
forward Zustand();
public Zustand()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i) && GetPlayerState(i) == 2)
{
new veh, Float:health;
GetPlayerVehicleID(i);
GetVehicleHealth(veh,health);
new Tachostring[256];
format(Tachostring, sizeof(Tachostring), "Zustand: %.2f",health);
TextDrawSetString(TextZUSTAND[i], Tachostring);
}
}
return 1;
}
MfG