03.07.2014, 18:08
Hi, I'm experiencing some difficulties. Here is my code:
Now, when I go on to the game, if a certain player has ID 0, they can always see other people's names, even if they use [/maskon]. However, if a player does not have ID 0 and another player uses [/maskon], that other player's name disappears but for ID 0 it remains exposed.
Thanks.
pawn Код:
CMD:maskon(playerid, params[])
{
if(pRegistered[playerid] == 0)
for(new i = 0; i < MAX_PLAYERS; i ++)
{
ShowPlayerNameTagForPlayer(i, playerid, true);
}
SendClientMessage(playerid, 0xFFFFFFFF, "{FFCC00}Info: {FFFFFF}Your name is now hidden.");
new string[200];
format(string, sizeof(string), "{FFFF00}AdmWarning: {FFFFFF}%s has hidden his name.", pName[playerid]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(PlayerData[i][pAdmin] > 0)
{
SendClientMessage(i, 0xFFFFFFFF, string);
}
}
return 1;
}
CMD:maskoff(playerid, params[])
{
if(pRegistered[playerid] == 0)
for(new i = 0; i < MAX_PLAYERS; i ++)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
}
SendClientMessage(playerid, 0xFFFFFFFF, "{FFCC00}Info: {FFFFFF}Your name is no longer hidden.");
new string[200];
format(string, sizeof(string), "{FFFF00}AdmWarning: {FFFFFF}%s has shown his name.", pName[playerid]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(PlayerData[i][pAdmin] > 0)
{
SendClientMessage(i, 0xFFFFFFFF, string);
}
}
return 1;
}
Thanks.