11.01.2011, 15:16
Umm yeah =/ i dont know how to explin the bug... i can try =/
If i mute someone... then i try to unmute, that dont work =/
I need to mute all players, Then i can unmute =/
PS: If you can test this you need two players or more, Then try to:
1. Mute a player
2. Unmute a player
-----AND------------
1. Mute all players
2. Unmue all players
If i mute someone... then i try to unmute, that dont work =/
I need to mute all players, Then i can unmute =/
PS: If you can test this you need two players or more, Then try to:
1. Mute a player
2. Unmute a player
-----AND------------
1. Mute all players
2. Unmue all players
pawn Код:
#include <a_samp>
//Colors
#define COLOR_ERROR 0xFF303EAA
#define COLOR_ADMIN 0xFF0000AA
#define COLOR_MUTED 0x00008CFF
new Muted[MAX_PLAYERS];
new ClickedPlayer[20];
new tmp[128];
public OnPlayerText(playerid, text[])
{
if(Muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_MUTED, "You is muted, you cannot talk");
return 0;
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Cmds", "Mute Player \nUnmute Player", "Select", "Cancel");
new id = strval(tmp);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
ClickedPlayer[playerid] = clickedplayerid;
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256];
new pName[MAX_PLAYER_NAME];
new tName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(ClickedPlayer[playerid],tName,sizeof(tName));
if(dialogid == 1)
{
if(!response)return SendClientMessage(playerid, COLOR_ERROR,"Error: You have cancelled.");
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Mute Player", "Type in the mute reason", "Mute", "Cancel");
else if(listitem == 1) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Unmute Player", "Type in the unmute reason", "Unmute", "Cancel");
}
}
//Mute Player-------------------------------------------------------------------
else if(dialogid == 2)
{
if(!response)return SendClientMessage(playerid, COLOR_ERROR,"Error: You have cancelled.");
{
if(Muted[playerid] == 1)
{
format(string, sizeof(string), "(%d) Is already Muted", ClickedPlayer[playerid]);
SendClientMessage(playerid, COLOR_ADMIN, string);
}
else
{
format(string, sizeof(string), "Mute: %s(%d) %s", tName, ClickedPlayer[playerid], inputtext);
SendClientMessageToAll(COLOR_ADMIN, string);
Muted[ClickedPlayer[playerid]] = 1;
ClickedPlayer[playerid] = INVALID_PLAYER_ID;
return 1;
}
}
}
//Unmute Player-------------------------------------------------------------------
else if(dialogid == 3)
{
if(!response)return SendClientMessage(playerid, COLOR_ERROR,"Error: You have cancelled.");
{
if(Muted[playerid] == 0)
{
format(string, sizeof(string), "(%d) Is not Muted", ClickedPlayer[playerid]);
SendClientMessage(playerid, COLOR_ADMIN, string);
}
else
{
format(string, sizeof(string), "Unmute: %s(%d) %s", tName, ClickedPlayer[playerid], inputtext);
SendClientMessageToAll(COLOR_ADMIN, string);
Muted[ClickedPlayer[playerid]] = 0;
ClickedPlayer[playerid] = INVALID_PLAYER_ID;
return 1;
}
}
}
return 1;
}