26.07.2014, 04:11
pawn Код:
#include <a_samp>
#include <foreach> // We need this for looping
new Text:DescriptionText[MAX_PLAYERS];
new DescriptionTimer[MAX_PLAYERS];
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;
}
forward HideDescriptionText(playerid);
public HideDescriptionText(playerid)
{
TextDrawHideForPlayer(playerid, DescriptionText[playerid]);
return 1;
}
CMD:smoke(playerid, params[])
{
foreach(new i : Player)
{
new string[128], sName[24];
GetPlayerName(playerid, sName, sizeof(sName));
format(string, sizeof(string), "~r~%s ~w~has used the command ~b~/smoke", sName);
ShowDescriptionText(i, string);
}
return 1;
}
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;
}