Name in 3dtextlabel
#1

Hey i want the ugly health bar out and replace the SetNameTags off but how do i attach a 3d text label onto a player with his name above it?

Thank you
Reply
#2

pawn Код:
public OnGameModeInit()
{
     ShowNameTags( 0 );
}

new Text3D:NameTag[500];
public OnPlayerConnect(playerid)
{
     new pName[24], string[30];
     GetPlayerName(playerid, pName, 24);
     format(string, sizeof(string), "%s (%i)", pName, playerid);
     NameTag[playerid] = Create3DTextLabel(string, GetPlayerColor(playerid), 0.0, 0.0, 0.0, 0.0, 0);
     Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, +2.5) //Not sure about the Z Offset, you might have to play with it
     return 1;
}
Reply
#3

C:\Users\Thimo\Desktop\sa-mp\gamemodes\PPC_Trucking.pwn(10 : error 029: invalid expression, assumed zero
C:\Users\Thimo\Desktop\sa-mp\gamemodes\PPC_Trucking.pwn(10 : warning 215: expression has no effect
C:\Users\Thimo\Desktop\sa-mp\gamemodes\PPC_Trucking.pwn(10 : error 001: expected token: ";", but found ")"
C:\Users\Thimo\Desktop\sa-mp\gamemodes\PPC_Trucking.pwn(10 : error 029: invalid expression, assumed zero
C:\Users\Thimo\Desktop\sa-mp\gamemodes\PPC_Trucking.pwn(10 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Sorry, untested

I'll have a play for you
Reply
#5

Fixed, just noticed a missing semicolon and a "+" that shouldnt be there,

here;

pawn Код:
#include <a_samp>

public OnGameModeInit()
{
     ShowNameTags( 0 );
}

new Text3D:NameTag[500];
public OnPlayerConnect(playerid)
{
     new pName[24], string[30];
     GetPlayerName(playerid, pName, 24);
     format(string, sizeof(string), "%s (%i)", pName, playerid);
     NameTag[playerid] = Create3DTextLabel(string, GetPlayerColor(playerid), 0.0, 0.0, 0.0, 0.0, 0);
     Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 2.5); //Not sure about the Z Offset, you might have to play with it
     return 1;
}
Reply
#6

It doesnt work
Reply
#7

BUMP help me pl0x
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)