SA-MP Forums Archive
Attach 3DText to The Player whene he Connect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Attach 3DText to The Player whene he Connect (/showthread.php?tid=287210)



Attach 3DText to The Player whene he Connect - ServerScripter - 02.10.2011

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


Re: Attach 3DText to The Player whene he Connect - Pharrel - 02.10.2011

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


Re: Attach 3DText to The Player whene he Connect - Kingunit - 02.10.2011

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);
    }



Re: Attach 3DText to The Player whene he Connect - DRIFT_HUNTER - 02.10.2011

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


Re: Attach 3DText to The Player whene he Connect - Pharrel - 02.10.2011

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...


Re: Attach 3DText to The Player whene he Connect - ServerScripter - 02.10.2011

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 ?


Re: Attach 3DText to The Player whene he Connect - Pharrel - 02.10.2011

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.


Re: Attach 3DText to The Player whene he Connect - ServerScripter - 02.10.2011

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


Re: Attach 3DText to The Player whene he Connect - Pharrel - 02.10.2011

So your code is perfect.


Re: Attach 3DText to The Player whene he Connect - ServerScripter - 02.10.2011

thanks for helping