SA-MP Forums Archive
Textdraw on Joining - 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 on Joining (/showthread.php?tid=74880)



Textdraw on Joining - DauerDicht - 26.04.2009

Hi,

i want have a textdraw in middle of my monitor if i join my server.

Like: Welcome To xxxxxxxxx
Visit: xxxxxxxxxx
(with colours)

have anyone the code for it


Re: Textdraw on Joining - *ToM* - 26.04.2009

Im not sure what you mean, but if you want a message to all when a player joins a server try this

Add this under OnPlayerConnect

Код:
  new pName[MAX_PLAYER_NAME];
  new string[48];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "Welcome to % (Joining)", pName);
  SendClientMessageToAll(COLOR_GREY, string);



Re: Textdraw on Joining - DauerDicht - 26.04.2009

here, that i mean:

http://www.myimg.de/?img=samp176c23b6.png


Re: Textdraw on Joining - Mike-Chip - 26.04.2009

You have to edit to fit your needs... like text size, positions, colors, etc.

pawn Код:
public OnPlayerConnect(playerid)
{
    new Text:JoinText;
    new JName[64], string[128];
    GetPlayerName(playerid, JName, sizeof(JName));

    JoinText = TextDrawCreate(300.000000,350.000000,"-");
    TextDrawFont(JoinText,2);
    TextDrawLetterSize(JoinText,0.399999,2.000000);
    TextDrawSetShadow(JoinText,1);
    TextDrawSetOutline(JoinText,1);
    format(string, sizeof(string), "%s Welcome To server", JName);
    TextDrawSetString(JoinText, string);
    TimeTextForPlayer(playerid, JoinText, 6000);
You need this in your script too:
pawn Код:
forward TimeTextForPlayer(playerid, Text:text, time)
public TimeTextForPlayer(playerid, Text:text, time)
{
    TextDrawShowForPlayer(playerid,text);
    SetTimerEx("DestroyTextTimer",time,0,"i",_:text); // from Simon
}

forward DestroyTextTimer(Text:text);
public DestroyTextTimer(Text:text)
{
    TextDrawDestroy(text);
}



Re: Textdraw on Joining - DauerDicht - 26.04.2009

OK thx and where i must paste it?

nd how can i add more lines?

format(string, sizeof(string), "%s Welcome To server", JName);
format(string, sizeof(string), "Visit us: xxxx", JName);

is this right?


Re: Textdraw on Joining - Jefff - 26.04.2009

Код:
format(string, sizeof(string), "%s Welcome To server~n~Visit us: xxxx", JName,something);



Re: Textdraw on Joining - DauerDicht - 26.04.2009

Okay ty, and how can i colour it? And where i must paste it


Re: Textdraw on Joining - Mike-Chip - 26.04.2009

pawn Код:
TextDrawColor(JoinText, 0xFF0000FF); // Red
Just put it under TextDrawSetOutline....


Re: Textdraw on Joining - Francis[French] - 26.04.2009

Hi there,

You can use "~n~" to insert a new line.

For example, this:
Код:
~g~Hello~w~,~n~~b~%s~w~.
Would print out:
Quote:
Hello,
%s.

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com


Re: Textdraw on Joining - RenisiL - 27.04.2009

error
D:\VISKAS~1\Serveris\Server1\GAMEMO~1\LT-SF.pwn(546) : error 001: expected token: ";", but found "public"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

forward TimeTextForPlayer(playerid, Text:text, time)
public TimeTextForPlayer(playerid, Text:text, time)
{
TextDrawShowForPlayer(playerid,text);
SetTimerEx("DestroyTextTimer",time,0,"i",_:text); // from Simon
}

forward DestroyTextTimer(Text:text);
public DestroyTextTimer(Text:text)
{
TextDrawDestroy(text);
}