Textdraw list [+REP]
#1

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
Reply
#2

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

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.
Reply
#4

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(...)
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)