17.12.2009, 21:20
I'm having a problem with this code:
You told me in the last post to add this:
It didn't work,i can still see their name.
pawn Код:
if(strcmp(cmd, "/maskon", true) == 0) // by Ellis
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMask] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " You don't have a mask");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GRAD1, " You can't use it.");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid,i, 0);
}
PlayerInfo[playerid][pMaskuse] = 1;
SendClientMessage(playerid, COLOR_WHITE, " You have put your mask on [/maskoff to put it away].");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s puts a mask on.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
if(PlayerInfo[playerid][pMaskuse] == 1)
ShowPlayerNameTagForPlayer(forplayerid, playerid, 1);
else
ShowPlayerNameTagForPlayer(forplayerid, playerid, 0);
}