3D Text on Player
#1

So i wanted to make that when you go on duty as an administrator it attaches you a 3D Text Label so on the top of your character will be written Administrator,this is the function from LARP,edited,what is wrong with it?
pawn Код:
if(!strcmp(cmdtext, "/adminduty", true)) // By Ellis
    {
        if(IsPlayerConnected(playerid))
        {
          if(gPlayerLogged[playerid] == 0)
          {
            SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
                return 1;
          }
          if(PlayerInfo[playerid][pAdmin] > 0)
          {
            if(AdminDuty[playerid] == 0)
            {
          new Admin3DText[50];
          Admin3DText = "Administrator";
          new Text3D:Created3D = Create3DTextLabel(Admin3DText,0xFF0000FF,0.0,0.0,0.0,0.0,0);
          Attach3DTextLabelToPlayer(Created3D,playerid,0.0,0.0,0.0);
              AdminDuty[playerid] = 1;
              SetPlayerArmour(playerid, 999);
                    SetPlayerHealth(playerid, 999);
                    SetPlayerColor(playerid,TEAM_ADMIN_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "[ADMIN] [ID:%d]%s is now on duty as an Administrator", playerid, sendername);
                    ABroadCast(COLOR_ASKQ,string,1);
                    if(PlayerInfo[playerid][pAdmin] >= 1337)
                    {
                      for(new i = 0; i < sizeof(CarInfo); i++)
                        {
                            SetVehicleParamsForPlayer(i,playerid,0,0);
                        }
                    }
                    return 1;
            }
            else if(AdminDuty[playerid] == 1)
            {
              AdminDuty[playerid] = 0;
              SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "[ADMIN] [ID:%d]%s is no longer on duty as an Administrator", playerid, sendername);
                    ABroadCast(COLOR_ASKQ,string,1);
                    return 1;
            }
          }
          else
          {
            SendClientMessage(playerid, COLOR_GREY, "  Wait a minute!You're not an Admin !");
            return 1;
          }
        }
      return 1;
    }
Reply
#2

bump!
Reply
#3

Try this:
Код:
if(!strcmp(cmdtext, "/adminduty", true)) // By Ellis
{
if(IsPlayerConnected(playerid))
{
  if(gPlayerLogged[playerid] == 0)
  {
    SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
return 1;
  }
  if(PlayerInfo[playerid][pAdmin] > 0)
  {
    if(AdminDuty[playerid] == 0)
    {
          new Text3D:AdminText[MAX_PLAYERS];
          AdminText[playerid] = Create3DTextLabel("Administrator",0xFF0000FF,0.0,0.0,0.0,0.0,0);
          Attach3DTextLabelToPlayer(AdminText[playerid],playerid,0.0,0.0,0.0);
      AdminDuty[playerid] = 1;
      SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid,TEAM_ADMIN_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s is now on duty as an Administrator", playerid, sendername);
ABroadCast(COLOR_ASKQ,string,1);
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
  for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
    }
    else if(AdminDuty[playerid] == 1)
    {
      AdminDuty[playerid] = 0;
      SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s is no longer on duty as an Administrator", playerid, sendername);
ABroadCast(COLOR_ASKQ,string,1);
return 1;
    }
  }
  else
  {
    SendClientMessage(playerid, COLOR_GREY, "  Wait a minute!You're not an Admin !");
    return 1;
  }
}
  return 1;
}
Reply
#4

Didn't work for me.
Reply
#5

pawn Код:
new Text3D:Created3D = Create3DTextLabel("Administrator",0xFF0000FF,0.0,0.0,0.0,50.0,0);
Changed DrawDistance to 50.0, maybe that helps.
Reply
#6

Quote:
Originally Posted by MadeMan
pawn Код:
new Text3D:Created3D = Create3DTextLabel("Administrator",0xFF0000FF,0.0,0.0,0.0,50.0,0);
Changed DrawDistance to 50.0, maybe that helps.
works great!thanks man
Reply
#7

You should add instead of Administrator, 'GameMaster' it sounds much more cooler xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)