On Screen Message
#5

Well. First create variable for Textdraw.

pawn Код:
new Text:Textdraw
Then, should create the Textdraw under OnFilterScriptInit if you're using a Filterscript, or OnGameModeInit() if you're using a Gamemode.

pawn Код:
public OnGameModeInit()
{
    Textdraw = TextDrawCreate(........);
    TextDrawSetFont(........);
    // etc.
    return 1;
}
More info:

- TextDrawCreate();
If you want Textdraw to be more preety, use an Textdraw Edtior, like: iPLEOMAX's Textdraw Editor.

Then, create that command to make a screen announce and to set string of Textdraw.

pawn Код:
CMD:message(playerid, params[]) //Command Message. Change if you want.
{ // Open bracket.
    new string[50]; // Variables.
    if(isnull(params)) return SendClientMessage(playerid, -1, "{FF0000}USAGE: {FFFFFF}/Message [Text]"); // Use isnull(params) function, because it's more efficiently, and you check more faster if params are null.
    if(!strlen(params)) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}You didn't write anything."); // Use this function strlen(params); to check if the player have writed something in params.
    format(string, sizeof(string), "%s", params); // Formatting the params.
    TextDrawSetString(Textdraw, string); // Set's params string to our created Textdraw.
    TextDrawShowForAll(Textdraw); // Use this function to show created textdraw too all players.
    return 1; // Return 1;
} // Close bracket.
Now, should work, and hope you understood and learned.

Can make a /Hide command to hide that textdraw.

pawn Код:
CMD:hide(playerid, params[]) // Command hide.
{ // Open bracket.
    TextDrawHideForAll(Textdraw); // Will hide textdraw for all players.
    return 1; // Returns 1;
} // Close bracket.
Reply


Messages In This Thread
On Screen Message - by nezo2001 - 01.02.2015, 20:14
Re: On Screen Message - by HY - 01.02.2015, 20:24
Re: On Screen Message - by nezo2001 - 01.02.2015, 20:31
Re: On Screen Message - by nezo2001 - 02.02.2015, 09:07
Re: On Screen Message - by HY - 02.02.2015, 09:34
Re: On Screen Message - by nezo2001 - 02.02.2015, 09:45
Re: On Screen Message - by Vince - 02.02.2015, 12:00
Re: On Screen Message - by nezo2001 - 02.02.2015, 12:58

Forum Jump:


Users browsing this thread: 3 Guest(s)