Help me , Playerid NameTags
#1

Help me fix this so that it shows the player ID on the head, please?



Code:

Quote:

#include <a_samp>

#define NAME_DRAWDISTANCE (30) // The distance of the 3d text nametags to appear.

new Text3D:NameTag[MAX_PLAYERS];
new playerName[MAX_PLAYER_NAME];

public OnGameModeInit()
{
SetNameTagDrawDistance(0.0);
ShowNameTags(false);
return 1;
}

public OnPlayerConnect(playerid)
{
playerName = p_name( playerid );
NameTag[playerid] = Create3DTextLabel( playerName, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel( NameTag[playerid] );
return 1;
}

stock p_name( playerid )
{
new p_namev[MAX_PLAYER_NAME];
GetPlayerName(playerid, p_namev, MAX_PLAYER_NAME);
return p_namev;
}

Reply
#2

Код:
#include <a_samp>

#define NAME_DRAWDISTANCE 30 // The distance of the 3d text nametags to appear.

new Text3D:NameTag[MAX_PLAYERS];
new playerName[MAX_PLAYER_NAME];

public OnGameModeInit()
{
SetNameTagDrawDistance(0.0);
ShowNameTags(false);
return 1;
}

public OnPlayerConnect(playerid)
{
NameTag[playerid] = Create3DTextLabel( p_name( playerid ), 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel( NameTag[playerid] );
return 1;
}

stock p_name( playerid )
{
new p_namev[MAX_PLAYER_NAME];
GetPlayerName(playerid, p_namev, MAX_PLAYER_NAME);
return p_namev;
}
Reply
#3

pawn Код:
public OnPlayerConnect(playerid)
{
new fullname[32];
playerName = p_name( playerid );
format(fullname,sizeof(fullname),"%s (%d)",playerName,playerid);
NameTag[playerid] = Create3DTextLabel( fullname, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
return 1;
}
Reply
#4

Quote:
Originally Posted by DTV
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
new fullname[32];
playerName = p_name( playerid );
format(fullname,sizeof(fullname),"%s (%d)",playerName,playerid);
NameTag[playerid] = Create3DTextLabel( fullname, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
return 1;
}
You can't equal anything to p_name(playerid) since its returning a string.

I forget this tho
Код:
format(fullname,sizeof(fullname),"%s (%d)", p_name(playerid)  ,playerid);
Reply
#5

thanks, how do the players in the organization / badge show it up color help me with please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)