Textdraws as sort of "database"
#1

I'm not sure what the hell am I doing (I started to "learn how to script few days ago) so don't rage on me if I say smtng stupid...
I was wondering if is it possible to use global textdraws (global textdraws can be changed by player and that will apply for all players?Right?) as sort of data base?
So if you create a global textdraw and a player changes it on his screen,will that be changed for everyone who will use that textdraw?
Example:
Wanted list of sort,

So if you make a wanted list that police officers can use with /wlist and when they do that they get the textdraws created and they can see the suspects.
So if they click on a suspects name and change it from idk Adolf_Hitler to Adolp_Hiter will it permanently change that textdraw to all players?So the other officers will see that name instead of the first version?
Reply
#2

Global textdraws should work with no problems, all players should see Adolp_Hitler after it gets changed (it's global, after all). However I wouldn't call it a "database" (actually, it's no where near to be a database), see it as a global instance with different modifiable properties (text, size, font size, position, color, box, etc) that you can access with native SA-MP functions.

These properties are safe and stored as long the server is running, once the server starts again the textdraw will have the properties you set by default (like in OnGameModeInit when you create the textdraw). In this case, for a permanent wanted list you need to save the information that the textdraw will show in an external data structure (ini file, SQL database).
Reply
#3

Okay thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)