Player Name(3d Text) doesn't show at all! -_-
#1

I've tried very many various methods such as SetPlayerChatBubble etc etc and I've followed a FILTERSCRIPT(credits to whom who made this):
pawn Код:
#define FILTERSCRIPT
#include <a_samp>

new Text3D:NameTag[MAX_PLAYERS];
new playerName[MAX_PLAYER_NAME];
#if defined FILTERSCRIPT


stock GetName(playerid)
{
    new name1[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name1, sizeof(name1));
    return name1;
}


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    playerName = GetName(playerid);
    NameTag[playerid] = Create3DTextLabel(playerName,GetPlayerColor(playerid), 0, 0, 0, 250.0, 0, 1 );
    Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.3);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(NameTag[playerid]);
    return 1;
}
It still doesn't work!! Help!
Reply
#2

try on

pawn Код:
public OnPlayerSpawn(playerid)
{
playerName = GetName(playerid);
    NameTag[playerid] = Create3DTextLabel(playerName,GetPlayerColor(playerid),30.0, 40.0, 50.0, 40.0, 0 );
    Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.3);
    return 1;
}
Reply
#3

I don't really know about the solution but I think I can help.

The variable named playerName[MAX_PLAYER_NAME]; is normally a string, and to change strings/edit them you don't use the = sign.

Try using
pawn Код:
format(playerName,sizeof(playerName), "%s",GetName(playerid));
Reply
#4

I tried both but it didn't work, bump, help, TIA.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)