24.03.2012, 10:28
You need a variable, to see if the player has nametags on or off:
Don't forget about:
pawn Код:
new bool: pNames[MAX_PLAYERS];
CMD:name(playerid, params[])
{
if(pNames[playerid] == false)
{
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
GameTextForPlayer(playerid, "~W~Nametag ~g~On", 5000, 5);
pNames[playerid] = true; // which means the player can see names now
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
GameTextForPlayer(playerid, "~W~Nametags ~R~OFF", 5000, 5);
pNames[playerid] = false; // Which means the player can't see name tags now.
}
return 1;
}
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)