SA-MP Forums Archive
[URGENT HELP] Is there any way? - 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)
+--- Thread: [URGENT HELP] Is there any way? (/showthread.php?tid=362709)



[URGENT HELP] Is there any way? - Jarnu - 25.07.2012

Done on my own ^^


Re: [URGENT HELP] Is there any way? - DeathOnaStick - 25.07.2012

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
well, i created a text draw for OnPlayerConnect and OnPlayerDisconnect.. and works perfect.
But i want to create more than one and i am confused totally.

Can anyone help me making it?

For 1st its like this
pawn Код:
public OnPlayerConnect(playerid)
{
//My other codes.
TextDrawSetString(/*myTextDraw*/,"%s has joined the server",Name);
return 1;
}
What do you need the others for?
Do you want it to "scroll down" like a list of textdraws like this here?

Код:
X connected.
Y connected.
Z connected.



Re: [URGENT HELP] Is there any way? - Jarnu - 25.07.2012

Exactly.


Re: [URGENT HELP] Is there any way? - DeathOnaStick - 25.07.2012

I didn't script with Textdraws for a very long time, but isn't it possible to put "\n" in the text?

Usually this starts a new line. Let me give you a small example of my thought.

pawn Код:
new conString[256]={}; //has to be big enough, but dunno the exact size

//conString will be the text of the Textdraw
//player connects:

new tmp[64];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(tmp, sizeof(tmp), "%s connected.\n", pName);
strcat(conString, tmp); //appends the value of tmp to conString (your textdraw text)
Then you only need to think about how you would like to delete that stuff from the Textdraw.

You can probably use strdel for that, but that's up to you.

#EDIT#: Damn I forgot the \n lol. I updated the script part.


Re: [URGENT HELP] Is there any way? - Jarnu - 25.07.2012

uh.. its gone out of my mind..
can't understand one point.. help me. properly.. :S


Re: [URGENT HELP] Is there any way? - Kiets - 26.07.2012

-----