ShowPlayerNameTagForPlayer

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 09:04, 27 August 2019
OstGot (Talk | contribs)

← Previous diff
Current revision
OstGot (Talk | contribs)

Line 6: Line 6:
{{Param|playerid|Player who will see the results of this function}} {{Param|playerid|Player who will see the results of this function}}
{{Param|showplayerid|Player whose name tag will be shown or hidden}} {{Param|showplayerid|Player whose name tag will be shown or hidden}}
-{{Param|show|'''1'''-show name tag, '''0'''-hide name tag}}+{{Param|show|'''1''' - show name tag, '''0''' - hide name tag}}
{{note2| ShowNameTags must be set to 1 to be able to show name tags with ShowPlayerNameTagForPlayer, that means that in order to be effective you need to ShowPlayerNameTagForPlayer(forplayerid, playerid, 0) ahead of time(OnPlayerStreamIn is a good spot).}} {{note2| ShowNameTags must be set to 1 to be able to show name tags with ShowPlayerNameTagForPlayer, that means that in order to be effective you need to ShowPlayerNameTagForPlayer(forplayerid, playerid, 0) ahead of time(OnPlayerStreamIn is a good spot).}}

Current revision



Description:

This functions allows you to toggle the drawing of player nametags, healthbars and armor bars which display above their head. For use of a similar function like this on a global level, ShowNameTags function.


Parameters:
(playerid, showplayerid, show)
playeridPlayer who will see the results of this function
showplayeridPlayer whose name tag will be shown or hidden
show1 - show name tag, 0 - hide name tag


Image:32px-Circle-style-warning.png

Important
Note

ShowNameTags must be set to 1 to be able to show name tags with ShowPlayerNameTagForPlayer, that means that in order to be effective you need to ShowPlayerNameTagForPlayer(forplayerid, playerid, 0) ahead of time(OnPlayerStreamIn is a good spot).


Return Values:

  • 1: The function was executed successfully.
  • 0: The function failed to execute. This means the player specified does not exist.


Example Usage:

//The player who typed /nameoff will not be able to see any other players nametag.
if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, false);
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.

Personal tools