QUESTION ABOUT TEXTDRAWS
#1

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

here you go

https://sampwiki.blast.hk/wiki/TextDrawCreate


https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
Reply
#3

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

It depends on what you want to use them for.
Reply
#5

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

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);
Reply
#7

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

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?
Reply
#9

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?
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)