24.07.2015, 14:11
pawn Код:
CMD:mask(playerid, params[])
{
new name[MAX_PLAYER_NAME];
new string[128];
if (PlayerInfo[playerid][pMaskOwner] == 1)
{
if(PlayerInfo[playerid][pMask] == 0)
{
new rand = 1000 + random(8999);
MaskID[playerid] = rand;
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
PlayerInfo[playerid][pMask] = 1;
format(string, sizeof(string), "\n\nStranger_%d", MaskID[playerid]);
MaskLabel[playerid] = CreateDynamic3DTextLabel(string, WHITE, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, MaskLabel[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.30);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s has put a mask on.", name);
ProxDetector(15.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(PlayerInfo[playerid][pMask] == 1)
{
DestroyDynamic3DTextLabel(MaskLabel[playerid]);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true);
MaskID[playerid] = 0;
PlayerInfo[playerid][pMask] = 0;
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s has put their mask away.", name);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "You haven't bought a mask.");
}
return 1;
}