28.08.2013, 17:25
Mask system, should put the letter behind "STRANGER_[Some Letter]", but when someone use the /mask too same time as someone else, then it gives you someone else name, like Mart_Arvik or sth.
If you use the /mask and no one else use it at same time, then it work fine...
Maybe someone knows the problem and sorry for bad english though.
If you use the /mask and no one else use it at same time, then it work fine...
Maybe someone knows the problem and sorry for bad english though.
pawn Код:
new OldUsername[MAX_PLAYER_NAME][MAX_PLAYERS];
new Masked[MAX_PLAYERS] = 0;
CMD:mask(playerid, params[])
{
if(Masked[playerid] == 0)
{
new randomID = random(200);
new string[35];
Masked[playerid] = 1;
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, 19037, 2, 10, 4.7, 0.0, 90, 90, 0);
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]);
Masked[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have removed your mask!");
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
return 1;
}