DisableNameTag help
#1

Hello,
i need help with my /name off & /name on.
It compiles, but nothing happends.
pawn Код:
{
    if(PlayerInfo[playerid][power] || PlayerInfo[playerid][premium] || PlayerInfo[playerid][playerteam]==HITMAN || PlayerInfo[playerid][playerteam]==FBI || PlayerInfo[playerid][playerlvl]>= 15)
    {
    new tmp[4];
    if(sscanf(params, "s", tmp)) return SCP(playerid, "[on/off]");
    if(strcmp(tmp,"on",true)==0)

    {
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    ShowPlayerNameTagForPlayer(playerid, i, true);
    PlayerTemp[playerid][hname]=0;
  }
  return 1;
    }
    else if(strcmp(tmp,"off",true)==0)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    ShowPlayerNameTagForPlayer(playerid, i, false);
    PlayerTemp[playerid][hname]=1;
  }
  return 1;
}
}
}
Anything wrong here?
hname is a diffrent script that makes the name Stranger
Reply
#2

ShowPlayerNameTagForPlayer
Show that function
Reply
#3

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
ShowPlayerNameTagForPlayer
Show that function
ShowPlayerNameTagForPlayer is a native SAMP function.
https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer

Quote:
Originally Posted by justjamie
Посмотреть сообщение
Hello,
i need help with my /name off & /name on.
It compiles, but nothing happends.
pawn Код:
{
    if(PlayerInfo[playerid][power] || PlayerInfo[playerid][premium] || PlayerInfo[playerid][playerteam]==HITMAN || PlayerInfo[playerid][playerteam]==FBI || PlayerInfo[playerid][playerlvl]>= 15)
    {
    new tmp[4];
    if(sscanf(params, "s", tmp)) return SCP(playerid, "[on/off]");
    if(strcmp(tmp,"on",true)==0)

    {
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    ShowPlayerNameTagForPlayer(playerid, i, true);
    PlayerTemp[playerid][hname]=0;
  }
  return 1;
    }
    else if(strcmp(tmp,"off",true)==0)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    ShowPlayerNameTagForPlayer(playerid, i, false);
    PlayerTemp[playerid][hname]=1;
  }
  return 1;
}
}
}
Anything wrong here?
hname is a diffrent script that makes the name Stranger
In order for ShowPlayerNameTagForPlayer to work, ShowNameTags must be set to 1. Also make sure you use ShowPlayerNameTagForPlayer in OnPlayerStreamIn.

pawn Код:
for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(i, playerid, false);
Your code makes every players name tag disappear for the player writing /name off.
Reply
#4

Quote:
Originally Posted by introzen
Посмотреть сообщение
Your code makes every players name tag disappear for the player writing /name off.
Makes sense, but how do i fix it?
I already have ShowNameTags(1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)