PDA

View Full Version : Help Script Error 17: undefined symbol "ShowPlayerNameTag"


khanhbgpro
10/08/2017, 06:56 AM
I'm trying to hide the blood and armor of the player, but it's a bug
(114855) : error 017: undefined symbol "ShowPlayerNameTag"

114855 full code
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTag(i, playerid, 0);
}
}

Ghazal
10/08/2017, 06:58 AM
I can't find the ShowPlayerNameTag on the SA-MP wiki, did you make it yourself?

You can disable hp/armor for all players by using a code similar to this

public OnGameModeInit()
{
ShowNameTags(0);
}

khanhbgpro
10/08/2017, 07:04 AM
I can't find the ShowPlayerNameTag on the SA-MP wiki, did you make it yourself?

You can disable hp/armor for all players by using a code similar to this

public OnGameModeInit()
{
ShowNameTags(0);
}



I searched in this article
http://forum.sa-mp.com/showthread.php?t=543135

Can you tell me where to put it?
When I put on public onplayerconnect, it's an error

Ghazal
10/08/2017, 07:05 AM
I searched in this article
http://forum.sa-mp.com/showthread.php?t=543135

Can you tell me where to put it?
When I put on public onplayerconnect, it's an error

It probably is removed then. Just use my code, put ShowNameTags(0); under OnGameModeInit

khanhbgpro
10/08/2017, 07:12 AM
It probably is removed then. Just use my code, put ShowNameTags(0); under OnGameModeInit

Strictly speaking, I'm dealing with an anti name tag (cleo wall hack)
But when I use it, it only hides names without hiding blood and armor
#define MAX_DISTANCIA 30.0

// Gamemode init
SetTimer("AntiNameTag",500,true);


forward AntiNameTag();
public AntiNameTag()
{
foreach(Player,playerid)
{
foreach(Player,i)
{
if(i == playerid) continue;
if(GetPlayerDistanceFromPlayer(playerid, i) <= MAX_DISTANCIA)
{
ShowPlayerNameTagForPlayer(playerid,i,true);
}
else
{
ShowPlayerNameTagForPlayer(playerid,i,false);
}
}
}
}
Float:GetPlayerDistanceFromPlayer(playerid, targetid)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
return GetPlayerDistanceFromPoint(targetid, Pos[0], Pos[1], Pos[2]);
}

khanhbgpro
13/08/2017, 05:32 PM
help me

pabloalber84ban
13/08/2017, 06:48 PM
help me

This never works, because the wallhack have a semi timer 100ms to update players tags.

xLucy
15/08/2017, 04:52 PM
its supposed to be ShowPlayerNameTagForPlayer...
alas
depending on your preference you can pick to use switch or the if's and else if's.
im not the best at scripting but i have a decent amount of experience. i can imagine that switch would be slightly faster.

stock ShowPlayerNameTag(playerid, value)
{
if(value == 0)
{
for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, false);
}
else if(value == 1)
{
for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, true);
}
else if(value != 0 || value != 1) return 0;
return 1;
}

stock ShowPlayerNameTag(playerid, value)
{
switch(value)
{
case 0:
{
for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, false);
}
case 1:
{
for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, true);
}
else return 0;
}
return 1;
}