CMD:mask(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(Masked[playerid] == false)
{
new pname[24];
new Maskid = random(200);
new string[35];
GetPlayerName(playerid, pname, sizeof(pname));
Masked[playerid] = true;
strmid(OldName[playerid], pname, 0, strlen(pname), 64);
format(string,sizeof(string), "Masked[%d]", Maskid);
SetPlayerName(playerid, string);
SendClientMessage(playerid, COLOR_LIGHTRED, "* You have put on your mask.");
format(string, sizeof(string), "%s is now masked ID %d",pname, Maskid);
SendAdminMessage(COLOR_DARKRED, 1, string);
for(new i=0;i<MAX_PLAYERS;i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
else
{
SetPlayerName(playerid, OldName[playerid]);
Masked[playerid] = false;
SendClientMessage(playerid, COLOR_LIGHTRED, "* You have removed your mask.");
for(new i=0;i<MAX_PLAYERS;i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
}
return 1;
}
//onplayerconnect
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
oldname[playerid] = pname;
pawn Код:
|
new MASKNAME[MAX_PLAYERS][24];
stock PlayerName(playerid)
{
if(Masked[playerid]==true)
{
return MASKNAME[playerid];
}
else
{
new Name[24];
GetPlayerName(playerid, Name, 24);
return Name;
}
}
CMD:mask(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(Masked[playerid] == false)
{
new pname[24];
new Maskid = random(200);
new string[35];
GetPlayerName(playerid, pname, sizeof(pname));
Masked[playerid] = true;
strmid(OldName[playerid], pname, 0, strlen(pname), 64);
format(string,sizeof(string), "Masked[%d]", Maskid);
MASKNAME[playerid]=string
SendClientMessage(playerid, COLOR_LIGHTRED, "* You have put on your mask.");
format(string, sizeof(string), "%s is now masked ID %d",pname, Maskid);
SendAdminMessage(COLOR_DARKRED, 1, string);
for(new i=0;i<MAX_PLAYERS;i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
else
{
SetPlayerName(playerid, OldName[playerid]);
Masked[playerid] = false;
SendClientMessage(playerid, COLOR_LIGHTRED, "* You have removed your mask.");
for(new i=0;i<MAX_PLAYERS;i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
}
return 1;
}