Problem with a name Textdraw
#1

Howdy', well i just finish with the name Textdraw near the mini-map.
But there's a wierd problem, when i'm login in, all fine i see my name but when more players getting into my server i see their names too.

Here's the code -
PHP код:
    new name[MAX_PLAYER_NAME]; // Player Name Textdraw
    
GetPlayerName(playerid,name,MAX_PLAYER_NAME);// Player Name Textdraw
    
PlayerN=TextDrawCreate(115,416,name);// Player Name Textdraw
    
TextDrawShowForPlayer(playeridPlayerN);// Player Name Textdraw
    
TextDrawColor(PlayerN,0xFFFFFFAA);// Player Name Textdraw
    
TextDrawFont(PlayerN,3);// Player Name Textdraw
    
TextDrawSetShadow(PlayerN,1);// Player Name Textdraw 
It's on public OnPlayerConnect.
Thanks for support.
Reply
#2

Try this:
pawn Код:
new name; // Player Name Textdraw
    GetPlayerName(playerid);// Player Name Textdraw
    PlayerN=TextDrawCreate(115,416,name);// Player Name Textdraw
    TextDrawShowForPlayer(playerid, PlayerN);// Player Name Textdraw
    TextDrawColor(PlayerN,0xFFFFFFAA);// Player Name Textdraw
    TextDrawFont(PlayerN,3);// Player Name Textdraw
    TextDrawSetShadow(PlayerN,1);// Player Name Textdraw
PS: Use pawn tags not PHP tags.
Reply
#3

Try
pawn Код:
new name[MAX_PLAYER_NAME];
new Nplayer[MAX_PLAYERS];
    GetPlayerName(playerid,name,sizeof(name));// Player Name Textdraw
    Nplayer[playerid] =TextDrawCreate(115,416,name);// Player Name Textdraw
    TextDrawShowForPlayer(playerid, Nplayer[playerid]);// Player Name Textdraw
    TextDrawColor(Nplayer[playerid],0xFFFFFFAA);// Player Name Textdraw
    TextDrawFont(Nplayer[playerid],3);// Player Name Textdraw
    TextDrawSetShadow(Nplayer[playerid],1);// Player Name Textdraw
Reply
#4

@Second post: All you did was change his correct GetPlayerName to one with too little arguments, and changed the name array (which is correct) to an integer, which is then used to display a string.

I wouldn't accept scripting lessons from you.

@OP, what do you mean you start seeing their name too? Does it flicker between names, overlap names, or what?
Reply
#5

Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
@Second post: All you did was change his correct GetPlayerName to one with too little arguments, and changed the name array (which is correct) to an integer, which is then used to display a string.

I wouldn't accept scripting lessons from you.

@OP, what do you mean you start seeing their name too? Does it flicker between names, overlap names, or what?

As you can see or not My nickname is 'Firo' and you see mixed nicks there (was 6 players on my server that time).
Reply
#6

Quote:
Originally Posted by IRio97
Посмотреть сообщение
Try
pawn Код:
new name[MAX_PLAYER_NAME];
new Nplayer[MAX_PLAYERS];
    GetPlayerName(playerid,name,sizeof(name));// Player Name Textdraw
    Nplayer[playerid] =TextDrawCreate(115,416,name);// Player Name Textdraw
    TextDrawShowForPlayer(playerid, Nplayer[playerid]);// Player Name Textdraw
    TextDrawColor(Nplayer[playerid],0xFFFFFFAA);// Player Name Textdraw
    TextDrawFont(Nplayer[playerid],3);// Player Name Textdraw
    TextDrawSetShadow(Nplayer[playerid],1);// Player Name Textdraw
IRio97's post should work then. You're using one textdraw for all names, so it's just gonna keep showing the one variable.

Try what IRio97 posted.
Reply
#7

Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
IRio97's post should work then. You're using one textdraw for all names, so it's just gonna keep showing the one variable.

Try what IRio97 posted.
pawn Код:
(272) : warning 213: tag mismatch
(273) : warning 213: tag mismatch
(274) : warning 213: tag mismatch
(275) : warning 213: tag mismatch
(276) : warning 213: tag mismatch

Lines:

pawn Код:
Nplayer[playerid] =TextDrawCreate(115,416,name);// Player Name Textdraw
    TextDrawShowForPlayer(playerid, Nplayer[playerid]);// Player Name Textdraw
    TextDrawColor(Nplayer[playerid],0xFFFFFFAA);// Player Name Textdraw
    TextDrawFont(Nplayer[playerid],3);// Player Name Textdraw
    TextDrawSetShadow(Nplayer[playerid],1);// Player Name Textdraw
Reply
#8

Where you define Nplayer put [MAX_PLAYERS] on it.
Reply
#9

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
Where you define Nplayer put [MAX_PLAYERS] on it.
pawn Код:
new name[MAX_PLAYER_NAME];
new Nplayer[MAX_PLAYERS];
    GetPlayerName(playerid,name,sizeof(name));// Player Name Textdraw
    Nplayer[playerid] =TextDrawCreate(115,416,name);// Player Name Textdraw
    TextDrawShowForPlayer(playerid, Nplayer[playerid]);// Player Name Textdraw
    TextDrawColor(Nplayer[playerid],0xFFFFFFAA);// Player Name Textdraw
    TextDrawFont(Nplayer[playerid],3);// Player Name Textdraw
    TextDrawSetShadow(Nplayer[playerid],1);// Player Name Textdraw
It's already have MAX PLAYERS..
Reply
#10

Outside of everything...

new Text:Nplayer[MAX_PLAYERS];

That way you can destroy/hide it else where...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)