SA-MP Forums Archive
Name show or not show - 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: Name show or not show (/showthread.php?tid=633298)



Name show or not show - Brandon001 - 28.04.2017

Hi all!

My problem is all player see other player name, but should not!

Код:
public Names(playerid)
{
    if(spawnnolt[playerid] == 1)
	{
	    new Float:posx, Float:posy, Float:posz;
	    GetPlayerPos(playerid, posx, posy, posz);

		for(new i; i < MAX_PLAYERS; i++)
		{
		    if(IsPlayerConnected(i) && i != playerid)
			{
			    if(IsPlayerInRangeOfPoint(i, 50, posx, posy, posz))
			    {
						new query[70], line[70];
						format(query, sizeof(query), "SELECT * FROM Friends WHERE Friend = '%s' AND Who = '%s'",Nev(i), Nev(playerid));
						mysql_query(query);
					    mysql_store_result();
					    mysql_fetch_row(line);
						if(mysql_num_rows() != 0)
						{
						    ShowPlayerNameTagForPlayer(playerid, i, true);
						    printf("%s see %s ", Nev(playerid) , Nev(i));
						}
						else
						{
						    ShowPlayerNameTagForPlayer(playerid, i, false);
						    printf("%s don't see %s -t!", Nev(playerid) , Nev(i));
						}
						mysql_free_result();
			    }
			}
		}
	}
	return 1;
}
What is that problem?

Thank you.