Help with /Mute cmd
#5

here you go
Quote:

public OnPlayerText(playerid, text[])
{
if(AntiAdv(playerid, text)) return 0;
if (!IsPlayerConnected2(playerid)) return 0;

new string[256], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);

if(Advertise(playerid, text))
{
return 0;
}
new count = GetTickCount2();
if (count-cflood[playerid][1] < 1000) {
cflood[playerid][0] ++;
if (cflood[playerid][0] == 5) {
if (cdata[playerid][2] == 0 || text[0] == '!') {
printf("[chat] [%s]: %s", playername, text);
}
else {
GetPlayerName(cdata[playerid][0], string, MAX_PLAYER_NAME);
printf("[phonecall] [%s - %s]: %s", playername, string, text);
new cstring[256];
format(cstring, 256, "[phonecall] [%s - %s]: %s", playername, string, text);
for(new i; i<PLAYERS; i++)
{
if((adlvl[i] >= 1 && Listen(i) >= 1) && (Listen(playerid) != 2) && (adlvl[playerid] <= adlvl[i]) && (i != playerid)) SendClientMessage(i, -1, cstring);
}
}
cflood[playerid][0] = 0;
SendClientMessage2(playerid, COLOR_WHITE, "~ You have been kicked for flooding.");
pkicktimer[playerid] = SetTimerEx("KickBanTimer", 50, 0, "dd", playerid, 1);
format(string, 128, "~ %s has been kicked from the server (Flooding).", playername);
SendClientMessageToAll2(COLOR_WHITE, string);
printf("[kicked] %s has been kicked from the server (Flooding).", playername);
return 0;
}
}
else {
cflood[playerid][0] = 1;
}
cflood[playerid][1] = count;

if (Logged[playerid] == 0) {
printf("[chat] [%s]: %s", playername, text);
if (dini_Exists(AddDirFile(dir_userfiles, playername))) {
SendClientMessage2(playerid, COLOR_WHITE, "You must login to play! Type /login to continue.");
}
else {
SendClientMessage2(playerid, COLOR_WHITE, "You must register to play! Type /register to continue.");
}
return 0;
}

//IdleTime[playerid] = 90;

if (mtimer[playerid] != 0) {
if (cdata[playerid][2] == 0 || text[0] == '!') {
printf("[chat] [%s]: %s", playername, text);
}
else {
GetPlayerName(cdata[playerid][0], string, MAX_PLAYER_NAME);
printf("[phonecall] [%s - %s]: %s", playername, string, text);
}
SendClientMessage2(playerid, COLOR_RED, "Error: You are muted smart ass!");
return 0;
}


GetServerVarAsString("rcon_password", string, 64);
if (strfind(text, string, true) != -1) {
if (cdata[playerid][2] == 0 || text[0] == '!') {
printf("[chat] [%s]: %s", playername, text);
}
else {
GetPlayerName(cdata[playerid][0], string, MAX_PLAYER_NAME);
printf("[phonecall] [%s - %s]: %s", playername, string, text);
}
return 0;
}

new t = 0;
while (t < strlen(text)-1) {
if (text[t] == ' ' && text[t+1] == ' ') {
strdel(text, t+1, t+2);
}
else t ++;
}
if (cdata[playerid][2] == 1) {
if (text[0] == '!') {
printf("[chat] [%s]: %s", playername, text);
strmid(string, text, 1, strlen(text));
for (new i = 0; i < PLAYERS; i++) {
if (IsPlayerConnected2(i)) {
if (PlayerIgnored[i][playerid] == 0) SendPlayerMessageToPlayer(i, playerid, string);
}
}
}
else {
GetPlayerName(cdata[playerid][0], string, MAX_PLAYER_NAME);
printf("[phonecall] [%s - %s]: %s", playername, string, text);
format(string, sizeof(string), "[phonecall] %s", text);
SendClientMessage2(cdata[playerid][0], COLOR_SILVER, string);
format(string, sizeof(string), "[phonecall] %s", text);
SendClientMessage2(playerid, COLOR_LBLUE, string);
}
}
else {
printf("[chat] [%s]: %s", playername, text);
for (new i = 0; i < PLAYERS; i++) {
if (IsPlayerConnected2(i)) {
if (PlayerIgnored[i][playerid] == 0) SendPlayerMessageToPlayer(i, playerid, text);
}
}
}
return 0;
}

Reply


Messages In This Thread
Help with /Mute cmd - by Exhibit - 25.03.2016, 14:57
Re: Help with /Mute cmd - by SyS - 25.03.2016, 15:26
Re: Help with /Mute cmd - by Exhibit - 26.03.2016, 06:52
Re: Help with /Mute cmd - by SyS - 26.03.2016, 06:54
Re: Help with /Mute cmd - by Exhibit - 26.03.2016, 10:57
Re: Help with /Mute cmd - by SyS - 26.03.2016, 14:51

Forum Jump:


Users browsing this thread: 2 Guest(s)