pawn Код:
CMD:mask(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] == 0)
if(isStranged[playerid] == 0)
{
new randomID = random(200);
new string[35];
isStranged[playerid] = true;
GetPlayerName(playerid, string, sizeof(string));
strmid(OldUsername[playerid], string, 0, strlen(string), 64);
format(string,sizeof(string), "Stranger", randomID);
SetPlayerName(playerid, string);
SetPlayerAttachedObject(playerid, 1, 19036, 2, 0.107, 0.020, 0.0, 90, 90, 0);//You can change this however you want, use sa-mp wiki for more info, right now is HockeyMask1
SendClientMessage(playerid, COLOR_WHITE, "You have put on a mask! (/mask to romove it)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
else
{
SetPlayerName(playerid, OldUsername[playerid]);
isStranged[playerid] = false;
SendClientMessage(playerid, COLOR_WHITE, "You have removed your mask!");
RemovePlayerAttachedObject(playerid, 1)//If you change the index for the mask make sure you change here too
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
return 1;
}