SA-MP Forums Archive
(ShowPlayerNameTagForPlayer) Problem. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (ShowPlayerNameTagForPlayer) Problem. (/showthread.php?tid=78032)



(ShowPlayerNameTagForPlayer) Problem. - FreeSoul - 16.05.2009

I got a problem.

Quote:

if (strcmp("/nameoff", cmdtext, true, 7) == 0)
{
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] ==
{
if (NameOff[playerid] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
SendClientMessage(playerid,COLOR_GREY,"Nobody knows your real identity now!");
NameOff[playerid] = 1;
return 1;
}
}
}
if (strcmp("/nameon", cmdtext, true, 6) == 0)
{
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] ==
{
if (NameOff[playerid] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
NameOff[playerid] = 0;
SendClientMessage(playerid,COLOR_GREY,"You now have your real identity!");
return 1;
}
}
}

This just won't work !!!
The nametag dissapears like for,1 millisecond.
I tried everything,putting both commands just in one,changing some things but still the same problem.

Please,this command is a very important one for my RPG mode.

If you have time to help me,I would be grateful.
Regards - FreeSoul


Re: (ShowPlayerNameTagForPlayer) Problem. - dice7 - 16.05.2009

OnPlayerCommandText
pawn Код:
if (strcmp("/namesoff", cmdtext, true, 10) == 0)
    {
    Namesoff(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "You have turned nametags off.");
    return 1;
    }

    if (strcmp("/nameson", cmdtext, true, 10) == 0)
    {
    Nameson(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "You have turned nametags on.");
    return 1;
    }
Anywhere
pawn Код:
stock Namesoff(playerid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  ShowPlayerNameTagForPlayer(playerid, i, false);
  }
}
//---------------------------------------------------
stock Nameson(playerid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  ShowPlayerNameTagForPlayer(playerid, i, true);
  }
}



Re: (ShowPlayerNameTagForPlayer) Problem. - FreeSoul - 16.05.2009

Same thing.
If you look at your code and at mine,they are prettyy much the same.
Still won't work.The name togs off just for a second...


Re: (ShowPlayerNameTagForPlayer) Problem. - member - 16.05.2009

other people have had the same problems as well with this, search and they might contain a solution.

Alternatively, if you want nametags COMPLETELY off use the ShowNameTags function under OnGameModeInit.

https://sampwiki.blast.hk/wiki/ShowNameTags

Note: this will turn off nametags and you will not be able to turn them back on again unless you change enable it or remove that line.




Re: (ShowPlayerNameTagForPlayer) Problem. - FreeSoul - 16.05.2009

Quote:
Originally Posted by [B2K
Hustler ]
other people have had the same problems as well with this, search and they might contain a solution.

Alternatively, if you want nametags COMPLETELY off use the ShowNameTags function under OnGameModeInit.

https://sampwiki.blast.hk/wiki/ShowNameTags

Note: this will turn off nametags and you will not be able to turn them back on again unless you change enable it or remove that line.

I searched,they had the same problem.The thread went dead and nobody answered their problems.
In one thread I saw that somebody said that this may be because it's GF or a GF edit and the function doesn't work in GF.
Why doesn't the function work for GF?


Re: (ShowPlayerNameTagForPlayer) Problem. - FreeSoul - 17.05.2009

Nobody knows ?