Attaching 3DTextLabel's to Player
#1

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
Reply
#2

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!
Reply
#3

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;
}
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)