SA-MP Forums Archive
Textdraw list [+REP] - 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: Textdraw list [+REP] (/showthread.php?tid=610011)



Textdraw list [+REP] - Amit1998 - 18.06.2016

Hey guys,
I'd like to make a a textdraw for a certain amount of players.
Hum, as example, there's a /creategame CMD.
when a player uses /joingame it'll display a black textdraw box with a list of all players that join.

E.G:
There are 3 players in the server.
SAMP_FORUM uses /creategame -> a textdraw is created in the right side of the screen.
~w~Game~n~
_ INFO GOES HERE _

The INFO_GOES_HERE Gets updated when a player uses /joingame GameHosterID and it'll be like
~w~Game~n~
-> SAMP_USER~n~
-> USER_2



My question is how can I make this work? I have no idea on how to start this. How can I create a textdraw for a user that uses /joingame ID with the information(that gets updated live) of the hoster ID's game?


+REPing the helpers

I thought about making an array
Games[MAX_PLAYERS][Game_Info]
GameInfo should include the textdraw definition and a true/false whether a game is active.
when a user uses /creategame it sets the textdraw to active and whenever a player uses /joingame ID it shows the Games[i] (i = host ID) for the player and I should update it with strcat.

I'm getting really confused with how to do that, TIPS PLEASE

+REPing


Re: Textdraw list [+REP] - Matz - 18.06.2016

Did you script the rest? I mean, do those commands exist but they need textdraw or what?


Re: Textdraw list [+REP] - Amit1998 - 18.06.2016

Quote:
Originally Posted by Matz
Посмотреть сообщение
Did you script the rest? I mean, do those commands exist but they need textdraw or what?
Yeah, I scripted the create a game and stuff but none relate to the textdraw.


Re: Textdraw list [+REP] - Matz - 18.06.2016

Quote:
Originally Posted by Amit1998
Посмотреть сообщение
Yeah, I scripted the create a game and stuff but none relate to the textdraw.
So as you said there are games per player Games[MAX_PLAYERS][Game_Info]. Assuming you have IDs for games, add textdraw for them:

Код:
new Text:BlackBoxForScreen[MAX_GAME_IDS];
Under OnGameModeInit
Код:
for(new t = 0; t < MAX_GAME_IDS; t++)
{
//create textdraw
}
Under /creategame
Код:
TextDrawSetString(BlackBoxForScreen[theirgameid], strblabla);
TextDrawShowForPlayer(...)
Under /joingame
Код:
TextDrawSetString(BlackBoxForScreen[joinedgameid], strblabla);
TextDrawShowForPlayer(...)



Re: Textdraw list [+REP] - GTLS - 19.06.2016

You can use adri1's or Iplomex's[i hope thats the spelling :P] TextDraw Editors to create Textdraws very easily. then Under OnPlayerClickTextDraw, add your function(if you are creating a clickable textdraw) then use TextDrawShowForPlayer if you made a Global Textdraw(recommended) and PlaterTextDrawShow if you Made Player Textdraw.

hope it reduces some of your burdun