Anti Advertisement not 100 % help please -
jame20702 - 22.05.2010
this is example code
stock AdvertisementCheck(string[])
{
if(!strfind(string,"
www.",false))
{
return true;
}
return false;
}
public OnPlayerText(playerid, text[])
{
if(AdvertisementCheck(text))
{
PlayerInfo[playerid][pLocked] = 1;
Kick(playerid);
return 0;
}
when i said www. (Kicked)
when i said awww. (Not Kicked)
when i said (Space)www. (Not Kicked)
when i said aaaaawww. (not kicked)
when i said (Space)(Space) or (Space)(Space)(Space)www. (Not Kicked)
how to detect all word ?
Re: Anti Advertisement not 100 % help please -
sushihusi - 22.05.2010
Try this at OnPlayerText:
Код:
public OnPlayerText(playerid, text[])
{
for(new a = 0; a < strlen(text); a++)
{
if(AdvertisementCheck(text[a]))
{
PlayerInfo[playerid][pLocked] = 1;
Kick(playerid);
return 0;
}
}
Re: Anti Advertisement not 100 % help please -
jame20702 - 22.05.2010
i will try . thank you man !
Re: Anti Advertisement not 100 % help please -
jame20702 - 22.05.2010
now ooc
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " ¤ШіВС§дБидґйЕзНЎНФ№ !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " ГРєє OOC ¶ЩЎ»ФґвґВбНґБФ№ !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " ¤ШідБиКТБТГ¶ѕЩґдґй, аѕГТР¤Шіа»з№гєй !");
return 1;
}
if(MsgSend[playerid] == 1)
{
SendClientMessage(playerid, 0x00ffffff, " НВиТїЕСґ¤ГСє !");
MsgSend[playerid] = 1;
SetTimerEx("UnMute",2000,0,"d",playerid);
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
return 1;
}
if(AdvertisementCheck(result) && PlayerInfo[playerid][pAdmin] < 1)
{
PlayerInfo[playerid][pLocked] = 1;
Kick(playerid);
return 1;
}
format(string, sizeof(string), "[OOC] %s ѕЩґЗиТ: %s " , sendername, result);
OOCOff(COLOR_WHITE,string);
MsgSend[playerid] = 1;
SetTimerEx("UnMute",2000,0,"d",playerid);
printf("%s", string);
}
return 1;
}
i said (/o aaawww. ) is not Kicked
Re: Anti Advertisement not 100 % help please -
Jefff - 22.05.2010
to
Re: Anti Advertisement not 100 % help please -
jame20702 - 23.05.2010
Quote:
Originally Posted by Jefff
|
if i say everything Kicked .
how to detect Word,(Space),About !@#$(%^)&**(++! and Number ?