SA-MP Forums Archive
why this text dos'nt hide! ? with time helpp - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: why this text dos'nt hide! ? with time helpp (/showthread.php?tid=599781)



why this text dos'nt hide! ? with time helpp - JuzDoiT - 30.01.2016

#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;
}


Re: why this text dos'nt hide! ? with time helpp - Tamy - 30.01.2016

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]);
}



Re: why this text dos'nt hide! ? with time helpp - JuzDoiT - 30.01.2016

thx Fixed!