Help in CreatePlayerTextdraw.
#1

Hello, I just created some player textdraws and variables look like:
pawn Код:
new PlayerText:TextdrawName;
I just checked the wiki and it have variables like:
pawn Код:
new PlayerText:TextdrawName[MAX_PLAYERS];
So whats the difference here, both are per player textdraws? Which is more better?
Reply
#2

the 2nd one saves it like enums ... like when you use

if(TextdrawName[playerid])
that time this comes in use
new PlayerText:TextdrawName[MAX_PLAYERS];
Reply
#3

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
the 2nd one saves it like enums ... like when you use

if(TextdrawName[playerid])
that time this comes in use
new PlayerText:TextdrawName[MAX_PLAYERS];
So..

pawn Код:
new PlayerText:TextdrawName;

TextdrawName = ..........
and

pawn Код:
new PlayerText:TextdrawName[MAX_PLAYERS];

TextdrawName[playerid] = ......
Both are same in working?
Reply
#4

No dude for example ..
like new game;

and then you use it in SendClientMessage and so on , but when you want to count something like

new game[MAX_PLAYERS];
and in all games you type like this

game[playerid] += 1;

and if you want it max like 8

if(game[playerid] == 8 )
{
// what you want to do
}

this thing you cant do with new game;
Reply
#5

still haven't got it.

pawn Код:
new Test;
test += 1; //Will increase test by 1
pawn Код:
new Test[MAX_PLAYERS];
test[playerid] += 1; //Will increase test by 1 for the playerid
But Player Textdraws are already Per Player.
Reply
#6

The second method is the correct way.
pawn Код:
new PlayerText:TextdrawName[MAX_PLAYERS];
Its Player related and for sure you need MAX_PLAYERS for tracking the id. I don't know about he flaws of not putting MAX_PLAYERS cause i never tried it and moreover pawn don't even warn or show errors!

I think it will cause bug when you try a single var player textdraw with multiple players platform in a server.
Reply
#7

The same thing i said him gammix , just i said him in a different way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)