DIR Return Create A Forum - Home
---------------------------------------------------------
Death War
HTML https://deathwar.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Server Suggestions
*****************************************************
#Post#: 1086--------------------------------------------------
Mute Commands
By: MatriX Date: September 15, 2011, 3:18 am
---------------------------------------------------------
Well, I have several time to madkiller about adding mute cmd,
but he tolds that there is no mute cmd in pawn, so i make it one
for him.
[CODE]
if(strcmp(cmd, "!mute", true) == 0) {
new tmp[256];
new pName2[MAX_PLAYER_NAME];
new player1 = strval(tmp);
if(adminlevel[playerid] < 3 ) return 0;
else
if(logged[playerid] == 0) return
SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use
commands because you are not logged in.");
else
if(adminlevel[playerid] < adminlevel[player1]) return
SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use
this command on higher level admin.");
else
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: !mute
[playerid]");
return 1;
}
if(strval(tmp) == playerid) return SendClientMessage(playerid,
COLOR_BRIGHTRED, "You cannot mute yourself");
else
if(muted[player1] == 1) return
SendClientMessage(playerid, COLOR_BRIGHTRED, "Player is already
muted.");
else
if(!IsPlayerConnected(specplayerid)) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR:Player
is not Connected.");
return 1;
}
muted[player1] = 1;
GetPlayerName(player1, pName2, sizeof(pName2));
format(string, sizeof(string), "Player %s muted.",pName2);
SendClientMessage(playerid, COLOR_YELLOW,string);
SendClientMessage(player1, COLOR_BRIGHTRED,"You have been
muted by Admin.");
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has used
/mute command", pName);
SendClientMessageToAdmins(COLOR_WHITE, string);
return 1;
}
[/CODE]
[CODE]
if(strcmp(cmd, "!unmute", true) == 0) {
new tmp[256];
new pName2[MAX_PLAYER_NAME];
new player1 = strval(tmp);
if(adminlevel[playerid] < 3 ) return 0;
else
if(logged[playerid] == 0) return
SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use
commands because you are not logged in.");
else
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: !unmute
[playerid]");
return 1;
}
if(muted[player1] == 0) return
SendClientMessage(playerid, COLOR_BRIGHTRED, "Player is already
unmuted.");
else
if(!IsPlayerConnected(specplayerid)) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR:Player
is not Connected.");
return 1;
}
muted[player1] = 0;
GetPlayerName(player1, pName2, MAX_PLAYER_NAME);
format(string, sizeof(string), "Player %s unmuted.",pName2);
SendClientMessage(playerid, COLOR_YELLOW,string);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has used
unmuted command", pName);
SendClientMessageToAdmins(COLOR_WHITE, string);
return 1;
}
[/CODE]
and on public OnPlayerText(playerid, text[])
add this cmd too
[CODE]
if (muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are
muted,You cannot chat.");
return 0;
}
[/CODE]
and at the top add
new muted[MAX_PLAYERS];
#Post#: 1087--------------------------------------------------
Re: Mute Commands
By: MaDKiLLeR Date: September 15, 2011, 3:21 am
---------------------------------------------------------
i've to edit it accourding to my script. If it works, i'll add
it. You've to wait till it's tested.
#Post#: 1088--------------------------------------------------
Re: Mute Commands
By: MaDKiLLeR Date: September 15, 2011, 3:31 am
---------------------------------------------------------
a big Fail.
I'm trying to script it my self.
#Post#: 1089--------------------------------------------------
Re: Mute Commands
By: kitt85711 Date: September 15, 2011, 3:34 am
---------------------------------------------------------
-_0 Besides if it worked it gives him errors because he might
not have the color "Brighted" defined... FAIL
#Post#: 1090--------------------------------------------------
Re: Mute Commands
By: MaDKiLLeR Date: September 15, 2011, 3:36 am
---------------------------------------------------------
[quote author=kitt85711 link=topic=231.msg1089#msg1089
date=1316075670]
-_0 Besides if it worked it gives him errors because he might
not have the color "Brighted" defined... FAIL
[/quote]
Man, i edited it alot like Replaced Brighted with BLUE and
[loggedin] =1 bla bla and Like [playeraminlevel] >=3 etc I
replced them i'm not that much dumb that i just put this cmd
like this in the script.
#Post#: 1091--------------------------------------------------
Re: Mute Commands
By: MaDKiLLeR Date: September 15, 2011, 3:38 am
---------------------------------------------------------
After editing this accourding to warchiefs, this is what i made:
[code]
else if(strcmp(cmd, "mute", true) == 0) {
new tmp[256];
new pName2[MAX_PLAYER_NAME];
new player1 = strval(tmp);
if (IsPlayerInfo(playerid,cmd)) return 0;
else {
if GetPlayerLogin(playerid) == 0) MessagePM(playerid,
GREEN, "Please first log in to your account.");
else {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
MessagePM(playerid, GREEN, "[Syntax] - The correct use /c
mute <Nick/ID>");
return 1;
else if (plr == INACTIVE_PLAYER_ID) MessagePM(playerid,
GREEN,"[Error] - Unknown player.");
}
muted[player1] = 1;
GetPlayerName(player1, pName2, sizeof(pName2));
format(string, sizeof(string), "You've muted %s.",pName2);
MessagePM(playerid, GREEN,string);
MessagePM(player1, WHITE,"You have been muted by Admin.");
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has muted
player %s.",gPlayers[playerid],gPlayers[plr] );
SendClientMessageToAll(WHITE, string);
}
return 1;
}
[/code]
#Post#: 1093--------------------------------------------------
Re: Mute Commands
By: MaDKiLLeR Date: September 15, 2011, 3:45 am
---------------------------------------------------------
I'm not a fool that i may add this in the same condition in
which it is posted :P :P :-* :-* :-* :-* :-* :-* :-*
#Post#: 1094--------------------------------------------------
Re: Mute Commands
By: icecream Date: September 15, 2011, 3:58 am
---------------------------------------------------------
exilent !!!
#Post#: 1113--------------------------------------------------
Re: Mute Commands
By: MatriX Date: September 15, 2011, 6:04 am
---------------------------------------------------------
lol madkiller, i have try to make a one, maybe it will not work,
but atleast this signifies how a true scripter tries
#Post#: 1114--------------------------------------------------
Re: Mute Commands
By: MaDKiLLeR Date: September 15, 2011, 6:23 am
---------------------------------------------------------
Nice work matrix ;D
*****************************************************
DIR Next Page