SA-MP Forums Archive
TextDraw String Function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: TextDraw String Function (/showthread.php?tid=128628)



TextDraw String Function - -PunisheR- - 18.02.2010

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!


Re: TextDraw String Function - iron_war_lord - 18.02.2010

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;
}



Re: TextDraw String Function - -PunisheR- - 19.02.2010

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!



Re: TextDraw String Function - -PunisheR- - 19.02.2010

Someone? Please Help!


Re: TextDraw String Function - -PunisheR- - 21.02.2010

Bump!


Re: TextDraw String Function - kLx - 21.02.2010

Do you have textdraw defines in OnGameModeInIt?


Re: TextDraw String Function - -PunisheR- - 21.02.2010

Yes.