TextDraw String Function
#1

Hey all,

I have created a textdraw at the buttom right (under the mini-map).
I want to use this textdraw for my server, as a function.
I want to know how can i create a function like this:
pawn Код:
SendTextMessageForAll(message);
and in the function i want to show the textdraw and set his string

Example:

pawn Код:
public OnPlayerConnect(playerid) {
format(str,sizeof(str),"~Y~[NEWS]: ~R~%s (%d) ~B~has joined the server.", PlayerName, playerid);
SendTextMessageToAll(str);
return 1;
}
* I need also that when the message will show up, it will dissaper after seconds

Please Help!
Reply
#2

Declarations (Right at the top):
Код:
forward HideText();

forward SendMessageToAll(string[]);
public SendMessageToAll(string[])
{
	// Textdraw settings here
	// Also values
	TextDrawShowForAll(TEXTDRAW:TEXT);
	SetTimer(HideText, 4000, false);
}

public HideText()
{
	TextDrawHideForAll(TEXTDRAW:TEXT);
}
Rest of code:
Код:
public OnPlayerConnect(playerid)
{
  format(str,sizeof(str),"~Y~[NEWS]: ~R~%s (%d) ~B~has joined the server.", PlayerName, playerid);
	SendMessageToAll(str);
	return 1;
}
Reply
#3

I did this:
pawn Код:
forward SendMessageToAll(string[]);
public SendMessageToAll(string[])
{
    TextDrawSetString(News, string);
    TextDrawShowForAll(News);
    SetTimer("HideText", 4000, false);
}
forward HideText();
public HideText()
{
    TextDrawHideForAll(News);
}
OnPlayerConnect:
pawn Код:
format(string,sizeof(string),"~Y~[NEWS]: ~R~%s (%d) ~B~has joined the server.", PlayerName, playerid);
                SendMessageToAll(string);
And the textdraw is not showing up!
Reply
#4

Someone? Please Help!
Reply
#5

Bump!
Reply
#6

Do you have textdraw defines in OnGameModeInIt?
Reply
#7

Yes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)