SA-MP Forums Archive
Attaching 3DTextLabel's to Player - 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: Attaching 3DTextLabel's to Player (/showthread.php?tid=518007)



Attaching 3DTextLabel's to Player - minijackc - 07.06.2014

Hi guys im having trouble making a Attach3DTextLabelToPlayer. i need it for when my admins log in so it follows them saying Admin on duty/n Do Not Shoot


Re: Attaching 3DTextLabel's to Player - SilentSoul - 07.06.2014

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][Admin] > 0) //Change this to your admin variable!
    {
        new Text3D:label = Create3DTextLabel("Admin on duty/n Do Not Shoot", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
    }
    return 1;
}
Source: Here!


Re: Attaching 3DTextLabel's to Player - Threshold - 08.06.2014

Yes, but you'll need to delete the label when the player disconnects.
pawn Код:
new Text3D:label[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][Admin] > 0) //Change this to your admin variable!
    {
        label[playerid] = Create3DTextLabel("Admin on duty/n Do Not Shoot", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    }
    return 1;
}

//Source: SilentSoul
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(label[playerid]);
    //Rest of code..
    return 1;
}



Re: Attaching 3DTextLabel's to Player - Laure - 08.06.2014

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(aDuty[playerid]) // checks if an admin is onduty then adds the label. ( change it to your own variable )
    {
    if(pInfo[playerid][Admin] > 0) //Change this to your admin variable!
    {
        new Text3D:label = Create3DTextLabel("Admin on duty/n Do Not Shoot", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
    }
  }
    return 1;
}