QUESTION ABOUT TEXTDRAWS -
buburuzu19 - 11.12.2014
Hello guys.
I want you to tell me if you know, where the Global Textdraws need to be put, i mean a per / player textdraw look like this:
new Text:Fuel[MAX_PLAYERS] if i am right , and where to put the creation of it i mean the code for creating Fuel[playerid] = Textdraw... , and where to put only for player textdraws and how can i destroy both to don't reach the limit?
I tried to put global textdraws at on player connect and the player textdraws on gamemode init and everything fucked up ..
Thanks!
FIRST OF ALL , PLEASE EXPLAIN TO ME HOW TO MAKE THE DIFFERENCE BETWEEN GLOBAL AND PLAYER TEXTDRAWS.
Thanks
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
JeaSon - 11.12.2014
here you go
https://sampwiki.blast.hk/wiki/TextDrawCreate
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
-
buburuzu19 - 11.12.2014
And what is the difference between TextDrawCreate and CreatePlayerTextDraw?
I was looking for someone who can explain me , where the god damn put the textdraws, not showing , there are 2 types of textdraws: Per player / Global , and now who can explain to me where at wich line the Global Textdraws needs to be put and where the Per Player (E.g Fuel[playerid] = TextDrawCreate ... ) need to be put too.
At OnPlayerConnect / OnGameModeInit ?
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
Infinity - 11.12.2014
It depends on what you want to use them for.
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
buburuzu19 - 11.12.2014
Quote:
Originally Posted by Infinity
It depends on what you want to use them for.
|
Let's say i have a tutorial textdraw who shows the steps.
If i create the Step Textdraw like this:
pawn Код:
STEPS = TextDrawCreate... and more lines down
......
......
......
......
and there are 2 players in tutorial , the steps will gonna be fucked , and the numbers will be rode with the 2nd player.
So , i decided to put it like this STEPS[playerid] = TextDrawCreate... and i added it OnPlayerConnect.
But i have more than 40 globally textdraws and my bug is that if there are 4+ players on my server and 5th is connecting textdraw limit reached, and i destroy the global textdraws with TextDrawDestroy at OnPlayerDisconnect and the per/player ones with TextDrawHideForPlayer.
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
buburuzu19 - 11.12.2014
More easier:
Where to add the creation of textdraws like:
pawn Код:
DMV1 = TextDrawCreate(223.000000, 347.083404, "Driving School Exam");
TextDrawLetterSize(DMV1, 0.465000, 1.938334);
TextDrawAlignment(DMV1, 1);
TextDrawColor(DMV1, -1);
TextDrawSetShadow(DMV1, 0);
TextDrawSetOutline(DMV1, 1);
TextDrawBackgroundColor(DMV1, 51);
TextDrawFont(DMV1, 2);
TextDrawSetProportional(DMV1, 1);
And the creation of textdraws like:
pawn Код:
carspeed[playerid] = TextDrawCreate(256.470581, 408.333374, "Speed: 69 KM/H");
TextDrawLetterSize(carspeed[playerid], 0.449999, 1.600000);
TextDrawAlignment(carspeed[playerid], 1);
TextDrawColor(carspeed[playerid], -1);
TextDrawSetShadow(carspeed[playerid], 0);
TextDrawSetOutline(carspeed[playerid], 1);
TextDrawBackgroundColor(carspeed[playerid], 51);
TextDrawFont(carspeed[playerid], 1);
TextDrawSetProportional(carspeed[playerid], 1);
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
Vince - 11.12.2014
Player textdraws are only useful to extend the textdraw limit. You can create 256 textdraws per player (so 256,000 in total for a full 1000 player server) as opposed to 2048 global. Global textdraw should in most cases be created in OnGameModeInit, player textdraw should in most cases be created in OnPlayerConnect.
Vince -
buburuzu19 - 11.12.2014
Quote:
Originally Posted by Vince
Player textdraws are only useful to extend the textdraw limit. You can create 256 textdraws per player (so 256,000 in total for a full 1000 player server) as opposed to 2048 global. Global textdraw should in most cases be created in OnGameModeInit, player textdraw should in most cases be created in OnPlayerConnect.
|
carspeed[playerid] -> if he has "[playerid]" is a global textdraw or a player textdraw?
Thanks!
Quote:
Originally Posted by Vince
Player textdraws are only useful to extend the textdraw limit. You can create 256 textdraws per player (so 256,000 in total for a full 1000 player server) as opposed to 2048 global. Global textdraw should in most cases be created in OnGameModeInit, player textdraw should in most cases be created in OnPlayerConnect.
|
If i put all my GLOBAL TEXTDRAWS at on gamemodeinit , all compiles fine but after this is sayning Unknown at "Gamemode".
What to do?
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
Admigo - 11.12.2014
Quote:
Originally Posted by buburuzu19
If i put all my GLOBAL TEXTDRAWS at on gamemodeinit , all compiles fine but after this is sayning Unknown at "Gamemode".
What to do?
|
Show us your code?
Re: QUESTION ABOUT TEXTDRAWS - I GIVE REPUTATION -
M4D - 11.12.2014
Create player textdraw and global textdraw has different functions !
When you use a global textdraw like this : td[playerid] you will make textdraw for players
If 100 player join server it will create 100 global textdraws because you made them in array
Global textdraws and player textdraws has different functions
Read wiki