Attach 3DText to The Player whene he Connect
#1

I'm just asking if it should working :
pawn Код:
public OnPlayerConnect(playerid)
{
if(PlayerInfo[playerid][pLevel] == 1)
{
label[playerid] = Create3DTextLabel("Nouveau Joueur[Lvl 1]", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
else if(PlayerInfo[playerid][pLevel] == 2)
{
label[playerid] = Create3DTextLabel("Nouveau Joueur[Lvl 2]", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
Thanks
Reply
#2

Your way works but that way is better ->

pawn Код:
public OnPlayerConnect(playerid)
{
    new lstring[25];
    format(string, sizeof(lstring),"Nouveau Joueur[Lvl %d]",PlayerInfo[playerid][pLevel]);
    label[playerid] = Create3DTextLabel(lstring, 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    return 1;
}
and you must destroy it when the player leaves the server
Reply
#3

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
Your way works but that way is better ->

pawn Код:
public OnPlayerConnect(playerid)
{
    new lstring[25];
    format(string, sizeof(lstring),"Nouveau Joueur[Lvl %d]",PlayerInfo[playerid][pLevel]);
    label[playerid] = Create3DTextLabel(lstring, 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    return 1;
}
and you must destroy it when the player leaves the server
No, your one is difference. This one is working:
pawn Код:
public OnPlayerConnect(playerid)
{
    if(PlayerInfo[playerid][pLevel] == 1)
    {
        label[playerid] = Create3DTextLabel("Nouveau Joueur[Lvl 1]", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if(PlayerInfo[playerid][pLevel] == 2)
    {
        label[playerid] = Create3DTextLabel("Nouveau Joueur[Lvl 2]", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    }
Reply
#4

Im not sure but i think that 3D text must be attached on player spawn.
Why? Well cos the player character is not created OnPlayerConnect
Reply
#5

Quote:
Originally Posted by Pharrel
Your way works...
Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Im not sure but i think that 3D text must be attached on player spawn.
Why? Well cos the player character is not created OnPlayerConnect
I use only onplayerconnect and works fine...
Reply
#6

So , whene a player connect and Spawn , if he is lvl 1 , The Text 1 Shown in the top of his name also for Ex 2 ?
Reply
#7

yes, if he is lvl 1 will show lvl 1 if he is lvl 2 will show 2 if 4 will show 4... and you dont need to use if a lot of times.
Reply
#8

I only need if he is Lvl 1 shown that in the TOP of his Name "Nouveau Joueur[Lvl 1]" else if 2 "Nouveau Joueur[Lvl 2]" BTW: i'm not using your Ex , because i don't want showing the Levels, Only If the player have Lvl 1 or 2 , say to players that he is NewPlayer , if he is LVL 3 Clear it
Reply
#9

So your code is perfect.
Reply
#10

thanks for helping
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)