Mhm...
#1

Hello, i need some help with this script

Quote:

COMMAND:mute(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] >= LEVEL_mute)
{
new player, time, reason[128];
if(sscanf(params, "rds[128]", player, time, reason))
{
SendClientMessage(playerid,RED,"Usage: /mute <playerid/part of nick> <seconds> <reason>");
return 1;
}
if(PlayerInfo[player][Muted] == true)
{
SendClientMessage(playerid,RED,"This player is already muted");
return 1;
}
if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid && PlayerInfo[player][AdminLevel] != MAX_ADMIN_LEVEL)
{
new string[128];
PlayerInfo[player][Muted] = true;
format(string,sizeof(string)," "white"Ops, You has been mute by '%s' for %d seconds [Reason: %s] ",GetName(player), GetName(playerid), time, reason);
ShowPlayerDialog(playerid, MUTE_DIALOG, DIALOG_STYLE_MSGBOX, "Xtreme Server - Mute", string, "Close", "");
PlayerInfo[player][MuteTimer] = SetTimerEx("unmute",time*1000, false, "d", player);
}
else
{
SendClientMessage(playerid, RED, "Player is not connected or is yourself or is the highest level admin");
}
}
else
{
SendClientMessage(playerid, RED, NO_PERM);
}
return 1;
}

When i mute someone the Dialog show for all lol and there is something wronge like /mute 0 [Sec 30 ] Spam

The sec show every time 74
Reply
#2

change it to "[pawn]"
i hate reading it like this

Also show the callback unmute
Reply
#3

Lol how to change it to Pawn?

The Unmute

Quote:

COMMAND:unmute(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] >= LEVEL_unmute)
{
new player;
if(sscanf(params, "r", player))
{
SendClientMessage(playerid,RED,"Usage: /unmute <playerid/part of nick>");
return 1;
}

if(PlayerInfo[player][Muted] == false)
{
SendClientMessage(playerid,RED,"This player is not muted");
return 1;
}
if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
{
PlayerInfo[player][Muted] = false;
KillTimer(PlayerInfo[player][MuteTimer]);
ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, DIALOG_STYLE_MSGBOX, "You have been Unmuted", "You have been unmuted, Please don't do the same thing you do to get Mute.", "Close", "");
SendClientMessage(playerid, RED, "Player has been unmuted.");
}
else
{
SendClientMessage(playerid, RED, "Player isnґt connected or invalid!");
}
}
else
{
SendClientMessage(playerid, RED, NO_PERM);
}
return 1;
}

Also the dialog show for all players
Reply
#4

by the code u provided there is not loop except the timer SetTimerEx("unmute"...
which i asked you show its public and you showed me the cmd!

What do you mean for every player ?
like 1 player uses the cmd and the Dialog show on all players connected screen ?
Reply
#5

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
by the code u provided there is not loop except the timer SetTimerEx("unmute"...
which i asked you show its public and you showed me the cmd!

What do you mean for every player ?
like 1 player uses the cmd and the Dialog show on all players connected screen ?
Yea it's show for all players

And when i kick someone the dialog show for me not for him lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)