31.08.2013, 06:33
Hey guys. I made a mask system that also hides your name when you type but the problem is that it sets the same mask id to everyone.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(masked[playerid])
{
new string[128];// This is string what we use.
format(string, sizeof(string), "Strain_%d: %s", maskid, text); //This is when you masked and you start to speake
ProxDetector(30.0, playerid, string, -1,-1,-1,-1,-1);
return 0;
}
return 1;
}
pawn Код:
YCMD:masca(playerid, params[], help)
{
if (help) return SendClientMessage(playerid, 0x808080FF, "/setfaction este folosita pentru a seta factiunea unui player");
if(!PlayerInfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_GREY, "Nu ai nici o masca.");
if(masked[playerid] == 0)
{
new string[128];
masked[playerid] = 1;
maskid[playerid] = random(200);
format(string, sizeof(string), "%s isi pune masca.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject(playerid,9,19036,2,0.093999,0.026000,-0.004999,93.800018,82.199951,-3.300001,1.098000,1.139999,1.173000);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
}
else
{
masked[playerid] = 0;
new string[128];
format(string, sizeof(string), "Strainul_%d si-a dat masca jos.", maskid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid, 9);
for(new a = 0; a < MAX_PLAYERS; a++) ShowPlayerNameTagForPlayer(a, playerid, true);
}
return true;
}