17.09.2012, 21:14
pawn Код:
// Somewhere in your script
new NameTag[MAX_PLAYERS];
if (strcmp("/nameoff", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i, playerid, false);
NameTag[playerid] = 0;
GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i, playerid, true);
NameTag[playerid] = 1;
GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
return 1;
}
public OnPlayerConnect(playerid)
{
NameTag[playerid] = 1;
for(new i = 0; i < MAX_PLAYERS; i++)
if(NameTag[i] == 0)
ShowPlayerNameTagForPlayer(playerid, i, false);
return 1;
}