[HELP] Mute Dialog... Bugged =/ - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Mute Dialog... Bugged =/ (
/showthread.php?tid=209806)
[HELP] Mute Dialog... Bugged =/ - Larsey123IsMe - 11.01.2011
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
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;
}
Re: [HELP] Mute Dialog... Bugged =/ -
randomkid88 - 11.01.2011
Under your first if statement for the Mute Player Dialog, you have
when it should be
pawn Код:
if(Muted[ClickedPlayer[playerid]]
because the first way, you are checking to see if the player that is trying to mute someone is muted. Same thing goes for the un-mute player section. That should be why its not working because if you try to un-mute someone, it checks to see if the admin is muted, which they aren't, so it says they aren't muted.
Re: [HELP] Mute Dialog... Bugged =/ - Larsey123IsMe - 11.01.2011
Thank You
Problem Solved