13.12.2010, 17:21
i made something but i failed... so i hope someone can fix it for me xD
pawn Код:
#include <a_samp>
new adminPlayer[20];
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu?", "Mute\nUnmute\nWho Is Muted", "ok", "Cancel");
adminPlayer[playerid] = clickedplayerid;
}
return 0;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0: ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Admin Menu", "Enter the mute ban reason", "Mute", "Cancel");
case 1: ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Admin Menu", "Enter the mute unban reason", "Unmute", "Cancel");
}
}
//Mute
case 2:
{
new muteplayer[MAX_PLAYER_NAME], string[44];
GetPlayerName(adminPlayer[playerid], muteplayer, sizeof(muteplayer));
format(string, sizeof(string), "(MUTE) %d %d",muteplayer, inputtext);
SendClientMessageToAll(0xFFFF00AA, string);
if(mute[playerid] == 0) return 1; //undefined symbol "mute"
adminPlayer[playerid] = 0;
}
//Unmute
case 3:
{
new muteplayer[MAX_PLAYER_NAME], string[44];
GetPlayerName(adminPlayer[playerid], unmuteplayer, sizeof(unmuteplayer));
format(string, sizeof(string), "(UNMUTE) %d %d",unmuteplayer, inputtext);
SendClientMessageToAll(0xFFFF00AA, string);
if(mute[playerid] == 1) return 0; //undefined symbol "mute"
adminPlayer[playerid] = 0;
}
//Who is muted
case 4:
{
//What to do?
}
}
}
return 1;
}