Thread: [Include] InfoText TextDraw
View Single Post
Old 14/03/2018, 05:41 AM   #1
KayJ
Gangsta
 
Join Date: Apr 2014
Posts: 704
Reputation: 64
Flowers InfoText TextDraw

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.

How To Implement:
PHP Code:
#include <infotext>

// IF USING IN FILTERSCRIPT
public OnFilterScriptInit()
{
    
OnShadowInit();
    return 
1;
}

// IF USING IN GAMEMODE
public OnGameModeInit()
{
    
OnShadowInit();
    return 
1;

How to Use:
PHP Code:
public OnPlayerConnect(playerid// Welcoming a player showing textdraw (using format and string)
{
    new 
string[150];
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNamesizeof(pName));
    
format(stringsizeof(string), "~y~Welcome ~y~~h~~h~%s!~N~~y~ID: ~y~~h~~h~%d~w~~N~~y~"pNameplayerid);
    
ShadInfoBoxForPlayer(playeridstring);
    return 
1;
}

public 
OnPlayerSpawn(playerid// Spawning player with message that he's spawned (without format and string)
{
    
ShadInfoBoxForPlayer(playerid"~r~Spawned!");
    return 
1;

Media:
Click Here (REF: T(DM)-V.I.P)

Note:
  1. There's no change in the position of TextDraw. (REF: Original Include)
  2. The TextDraw will automatically close after 15 seconds, you can change it by giving a value in the include:
    PHP Code:
     #define CLOSETIMER 15000 // 1000 = 1 second 
  3. If you don't want it to hide, find remove these from include:
    PHP Code:
    #define CLOSETIMER 15000
    SetTimerEx("CloseTextdraw"CLOSETIMERfalse"i"playerid); 

Color Source:
SA:MP Wikipedia > GameText

Download:
infotext.inc: Pastebin| RAW

Last edited by KayJ; 26/09/2018 at 05:11 AM. Reason: Fixed the timer 'false' mistake
KayJ is offline   Reply With Quote