Guten Morgen Community,
Ich habe das Problem, dass das Textdraw was ich erstellt habe sich nicht löscht, wenn ich es zweimal innerhalb des Timers [1500s] mit einem Befehl einblenden lasse.
Wenn ich den /gz Befehl eingebe, erscheint das Textdraw. Wenn das Textdraw verschwunden ist, kann ich wieder den /gz Befehl nutzen und das Textdraw erscheint erneut problemlos.
dcmd_gz(playerid,params[])
{
if (AccInfo[playerid][Level] <= 1)
return SendClientMessage (playerid, COLOR_GREY, "* You are not an Administrator to perform this command.");
new Float:x,Float:y,Float:z, Float:zz;
if(sscanf(params, "f",zz)) return SendClientMessage(playerid, COLOR_GREY, "* Usage: /gz [Meters in Z Direction") && SendClientMessage(playerid, COLOR_GREY,"* Function: Moves you in the specified Z - Direction.");
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+zz);
if (Float:zz >= 0)
{
new tdstring[7];
TextDrawShowForPlayer(playerid, Textdraw2);
Textdraw2 = TextDrawCreate(117.000000, 338.000000, tdstring);
format(tdstring, sizeof(tdstring), "Z %.2f ", zz);
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 2);
TextDrawLetterSize(Textdraw2, 0.290000, 1.200000);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
TextDrawSetString(Textdraw2, tdstring);
TextDrawShowForPlayer(playerid, Textdraw2);
SetTimerEx("DisableTextDraw2", 1500, false, "i", playerid);
}
if (Float:zz <= 0)
{
new tdstring[7];
TextDrawShowForPlayer(playerid, Textdraw2);
Textdraw2 = TextDrawCreate(117.000000, 338.000000, tdstring);
format(tdstring, sizeof(tdstring), "Z %.2f ", zz);
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 2);
TextDrawLetterSize(Textdraw2, 0.290000, 1.200000);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
TextDrawSetString(Textdraw2, tdstring);
TextDrawShowForPlayer(playerid, Textdraw2);
SetTimerEx("DisableTextDraw2", 1500, false, "i", playerid);
}
return 1;
}
forward DisableTextDraw2(playerid);
public DisableTextDraw2(playerid)
{
new tdstring[7];
TextDrawDestroy(Textdraw2);
TextDrawHideForPlayer(playerid, Textdraw2);
Textdraw2 = TextDrawCreate(117.000000, 338.000000, tdstring);
return 1;
}
Mfg Salpoe