Textdraw for a player
#1

Hi, im trying to show a textdraw for each player, but i can't get it to show to only a player... this is what i've done :

at the top :
Код:
new Text:TextDrawsd[MAX_PLAYERS];
and above :
Код:
public OnPlayerConnect(playerid) {
    TextDrawsd[playerid] = TextDrawCreate(549.0,310.0," ");
    TextDrawShowForPlayer(playerid,TextDrawsd[playerid]);
	return 1;
}

public OnPlayerDisconnect(playerid, reason) {
    TextDrawDestroy(TextDrawsd[playerid]);
    return 1;
}
im updating the textdraw with :
Код:
TextDrawSetString(TextDrawsd[playerid], "Some text here");
But all the textdraw show to the same player and all others players don't see any textdraw. how can i fix this?

Thank you for your help
Reply
#2

Create texdraw in ongamemodeinit and show it in onplayerconnect...
Reply
#3

How do i create it in ongamemodeinit? because i used to create them like this :
Код:
TextDrawsd[playerid] = TextDrawCreate(549.0,310.0," ");
but there is no playerid in ongamemodeinit
Reply
#4

OnGameModeInt
TextDrawsd = TextDrawCreate(549.0,310.0," ");
OnPlayerConnect
TextDrawShowForPlayer(playerid,TextDrawsd);
Reply
#5

i get this error on the line for the ongamemodeinit :

error 033: array must be indexed (variable "TextDrawsd")

why?
Reply
#6

Because you need to change your define for it...
new TextDrawsd[MAX_PLAYERS]; change to new TextDrawsd;
Reply
#7

oh ok, thank you
Reply
#8

so it can be different for each player now? thats what i was trying to do
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)