14.03.2018, 05:41
(
Последний раз редактировалось KayJ; 06.01.2019 в 03:52.
Причина: Fixed the timer 'false' mistake
)
InfoText TextDraw
About:It's a simple include which is modified version of "[INC] TextDraw, Information Box." by Shadow(made in 2010).
Usage:
- Can put messages of Syntax, News, Information, Event Information, etc.
PHP код:
#include <infotext>
// IF USING IN FILTERSCRIPT
public OnFilterScriptInit()
{
OnShadowInit();
return 1;
}
// IF USING IN GAMEMODE
public OnGameModeInit()
{
OnShadowInit();
return 1;
}
PHP код:
public OnPlayerConnect(playerid) // Welcoming a player showing textdraw (using format and string)
{
new string[150];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "~y~Welcome ~y~~h~~h~%s!~N~~y~ID: ~y~~h~~h~%d~w~~N~~y~", pName, playerid);
ShadInfoBoxForPlayer(playerid, string);
return 1;
}
public OnPlayerSpawn(playerid) // Spawning player with message that he's spawned (without format and string)
{
ShadInfoBoxForPlayer(playerid, "~r~Spawned!");
return 1;
}
Click Here (REF: T(DM)-V.I.P)
Note:
- There's no change in the position of TextDraw. (REF: Original Include)
- The TextDraw will automatically close after 15 seconds, you can change it by giving a value in the include:
PHP код:#define CLOSETIMER 15000 // 1000 = 1 second
- If you don't want it to hide, find remove these from include:
PHP код:#define CLOSETIMER 15000
SetTimerEx("CloseTextdraw", CLOSETIMER, false, "i", playerid);
SA:MP Wikipedia > GameText
Download:
infotext.inc: Pastebin| RAW | Github