Ich habe ein Problem. Jedes mal wenn ich mein HealthBar Textdraw lade, sind alle Spieler auf meinem Server pausiert.
Dieses FilterScript zeigt das Heal in % an bei der Healthbar.
Ich kopiere das mal hier rein, hoffe du kannstm mir sagen woran das liegt.
#include <a_samp>
#include <ocmd>
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw1;
new Text:Health[MAX_PLAYERS];
new Text:Armour[MAX_PLAYERS];
new Text:Armour[MAX_PLAYERS];
forward vitals(playerid);
public vitals(playerid)
{
new string[5]
;new Float:pHealth, Float:pArmour;
GetPlayerHealth(playerid,pHealth);
GetPlayerArmour(playerid,pArmour);
format(string, sizeof(string), "%.0f%", pHealth);
TextDrawSetString(Health[playerid], string);
format(string, sizeof(string), "%.0f%", pArmour);
TextDrawSetString(Armour[playerid], string);
}
public vitals(playerid)
{
new string[5]
;new Float:pHealth, Float:pArmour;
GetPlayerHealth(playerid,pHealth);
GetPlayerArmour(playerid,pArmour);
format(string, sizeof(string), "%.0f%", pHealth);
TextDrawSetString(Health[playerid], string);
format(string, sizeof(string), "%.0f%", pArmour);
TextDrawSetString(Armour[playerid], string);
}
public OnFilterScriptInit()
{
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
Health[i] = TextDrawCreate(566.000000, 67.000000, "100%");
TextDrawBackgroundColor(Health[i], 255);
TextDrawFont(Health[i], 1);
TextDrawLetterSize(Health[i], 0.219999, 0.899999);
TextDrawColor(Health[i], -1);
TextDrawSetOutline(Health[i], 1);
TextDrawSetProportional(Health[i], 1);
{
Health[i] = TextDrawCreate(566.000000, 67.000000, "100%");
TextDrawBackgroundColor(Health[i], 255);
TextDrawFont(Health[i], 1);
TextDrawLetterSize(Health[i], 0.219999, 0.899999);
TextDrawColor(Health[i], -1);
TextDrawSetOutline(Health[i], 1);
TextDrawSetProportional(Health[i], 1);
Armour[i] = TextDrawCreate(566.000000, 44.000000, "100%");
TextDrawBackgroundColor(Armour[i], 255);
TextDrawFont(Armour[i], 1);
TextDrawLetterSize(Armour[i], 0.219999, 0.899999);
TextDrawColor(Armour[i], -1);
TextDrawSetOutline(Armour[i], 1);
TextDrawSetProportional(Armour[i], 1);
}
SetTimer("vitals",1000,1);
}
TextDrawBackgroundColor(Armour[i], 255);
TextDrawFont(Armour[i], 1);
TextDrawLetterSize(Armour[i], 0.219999, 0.899999);
TextDrawColor(Armour[i], -1);
TextDrawSetOutline(Armour[i], 1);
TextDrawSetProportional(Armour[i], 1);
}
SetTimer("vitals",1000,1);
}
public OnFilterScriptExit()
{
TextDrawHideForAll(Textdraw0);
TextDrawDestroy(Textdraw0);
TextDrawHideForAll(Textdraw1);
TextDrawDestroy(Textdraw1);
return 1;
}
{
TextDrawHideForAll(Textdraw0);
TextDrawDestroy(Textdraw0);
TextDrawHideForAll(Textdraw1);
TextDrawDestroy(Textdraw1);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Health[playerid]);
return 1;
}
{
TextDrawShowForPlayer(playerid, Health[playerid]);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:pArmour;
GetPlayerArmour(playerid, pArmour);
if(pArmour == 0){
TextDrawHideForPlayer(playerid, Armour[playerid]);
}else{
TextDrawShowForPlayer(playerid, Armour[playerid]);
}
}
{
new Float:pArmour;
GetPlayerArmour(playerid, pArmour);
if(pArmour == 0){
TextDrawHideForPlayer(playerid, Armour[playerid]);
}else{
TextDrawShowForPlayer(playerid, Armour[playerid]);
}
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
return 1;
}
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
return 1;
}
