why this text dos'nt hide! ? with time helpp
#1

#define FILTERSCRIPT
#include <a_samp>
new Text: DescriptionText[MAX_PLAYERS];
new DescriptionTimer[MAX_PLAYERS];

stock ShowDescriptionText(playerid, string[])
{
KillTimer(DescriptionTimer[playerid]);
TextDrawSetString(DescriptionText[playerid], string);
TextDrawShowForPlayer(playerid, DescriptionText[playerid]);
DescriptionTimer[playerid] = SetTimerEx("HideDescriptionText", 5000, 0, "i", playerid);
return 1;
}

public OnFilterScriptInit()
{
print("*****************************");
print(" A tutorial by Jack Leslie ");
print("*****************************");
return 1;
}

public OnPlayerConnect(playerid)
{
DescriptionText[playerid] = TextDrawCreate(320.0, 380.0, " ");
TextDrawAlignment(DescriptionText[playerid], 2);
TextDrawFont(DescriptionText[playerid], 1);
TextDrawLetterSize(DescriptionText[playerid], 0.320000, 1.700000);
TextDrawSetOutline(DescriptionText[playerid], 1);
TextDrawHideForPlayer(playerid, DescriptionText[playerid]);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/whatsmyname", cmdtext, true) == 0)
{
new string[126], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "~w~Your username is: ~y~%s~w~.", playername);
ShowDescriptionText(playerid, string);
return 1;
}
else if(strcmp("/lol", cmdtext, true) == 0)
{
ShowDescriptionText(playerid, "~p~Laugh Out Loud");
return 1;
}
return 0;
}
Reply
#2

Make sure you have the function you're calling in the script, it should look like this

Код:
forward HideDescriptionText(playerid);
public HideDescriptionText(playerid)
{
    TextDrawHideForPlayer(playerid, DescriptionText[playerid]);
}
Reply
#3

thx Fixed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)