Changing the action
#1

How can i change it to kick people and NOT ban people?
Код:
public OnFilterScriptInit()
{

}
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    return name;
}
new l[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
        new is1=0;
        new r=0;
        l[playerid] = 1;
        if(strfind(text, "sa-mp.com", true) != -1 || strfind(text, "00.000.00.00:0000", true) != -1 || strfind(text, "******.com", true) != -1 || strfind(text, "*******.com", true) != -1) return 1;
		while(strlen(text[is1]))
        {
        if('0'<=text[is1]<='9')
        {
        new is2=is1+1;
        new p=0;
        while(p==0)
        {
        if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
        else
        {
        strmid(strR[r],text,is1,is2,255);
        if(strval(strR[r])<255) r++;
    	is1=is2;
		p=1;
   		 }
   		 }
   		 }
    	is1++;
        }
        if(r>=4)
        {
        new strMy[255];
        new STRname[255];
        GetPlayerName(playerid,STRname,255);
        format(strMy, sizeof(strMy), " Suspicion advertising %s(%d): %s",STRname,playerid,text);
        for(new j1=0; j1 < MAX_PLAYERS;j1++)
        if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, strMy);
        for(new z=0;z<r;z++)
        {
        new pr2;
        while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
      	if(l[playerid] == 1)
		{
			new tstr[256];
	 		format(tstr, 256, "~ %s has been kicked from the server for 'Advertising'", PlayerName(playerid));
	 		SendClientMessageToAll(COLOR_RED, tstr);
			l[playerid] = 0;
		}
        return Ban(playerid), false;
        }
		}
		//Domains Names
		if(strfind(text, "join the server", true) != -1  || strfind(text, "xxx", true) != -1 || strfind(text, "come to xxx", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, "Join my server", true) != -1 || strfind(text, ".me", true) != -1 ||
    strfind(text, "xxx", true) != -1 || strfind(text, ".xxx", true) != -1 || strfind(text, "xxx gaming website", true) != -1 || strfind(text, ".com.uk", true) != -1 || strfind(text, "8000", true) != -1 || strfind(text, "21444441126", true) != -1 ||
    strfind(text, "xxx", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, ".x", true) != -1 || strfind(text, "7777", true) != -1 || strfind(text, "7800", true) != -1 ||
    strfind(text, "4412", true) != -1 || strfind(text, "5555", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, "xxx", true) != -1)
 	{
			new sendername[MAX_PLAYER_NAME];
			new string[256];
			GetPlayerName(playerid, sendername, 24);
			format(string, sizeof(string), "~ %s has been banned from the server for 'Advertising.'", sendername);
			SendClientMessageToAll(COLOR_RED, string);
			TogglePlayerControllable(playerid, 0);
		 	return Ban(playerid), false;
		}
		return 1;
}
I will REP the helper
Reply
#2

Quote:
Originally Posted by darkhunter332
Посмотреть сообщение
How can i change it to kick people and NOT ban people?
Код:
public OnFilterScriptInit()
{

}
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    return name;
}
new l[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
        new is1=0;
        new r=0;
        l[playerid] = 1;
        if(strfind(text, "sa-mp.com", true) != -1 || strfind(text, "00.000.00.00:0000", true) != -1 || strfind(text, "******.com", true) != -1 || strfind(text, "*******.com", true) != -1) return 1;
		while(strlen(text[is1]))
        {
        if('0'<=text[is1]<='9')
        {
        new is2=is1+1;
        new p=0;
        while(p==0)
        {
        if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
        else
        {
        strmid(strR[r],text,is1,is2,255);
        if(strval(strR[r])<255) r++;
    	is1=is2;
		p=1;
   		 }
   		 }
   		 }
    	is1++;
        }
        if(r>=4)
        {
        new strMy[255];
        new STRname[255];
        GetPlayerName(playerid,STRname,255);
        format(strMy, sizeof(strMy), " Suspicion advertising %s(%d): %s",STRname,playerid,text);
        for(new j1=0; j1 < MAX_PLAYERS;j1++)
        if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, strMy);
        for(new z=0;z<r;z++)
        {
        new pr2;
        while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
      	if(l[playerid] == 1)
		{
			new tstr[256];
	 		format(tstr, 256, "~ %s has been kicked from the server for 'Advertising'", PlayerName(playerid));
	 		SendClientMessageToAll(COLOR_RED, tstr);
			l[playerid] = 0;
		}
        return Ban(playerid), false;
        }
		}
		//Domains Names
		if(strfind(text, "join the server", true) != -1  || strfind(text, "xxx", true) != -1 || strfind(text, "come to xxx", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, "Join my server", true) != -1 || strfind(text, ".me", true) != -1 ||
    strfind(text, "xxx", true) != -1 || strfind(text, ".xxx", true) != -1 || strfind(text, "xxx gaming website", true) != -1 || strfind(text, ".com.uk", true) != -1 || strfind(text, "8000", true) != -1 || strfind(text, "21444441126", true) != -1 ||
    strfind(text, "xxx", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, ".x", true) != -1 || strfind(text, "7777", true) != -1 || strfind(text, "7800", true) != -1 ||
    strfind(text, "4412", true) != -1 || strfind(text, "5555", true) != -1 || strfind(text, "xxx", true) != -1 || strfind(text, "xxx", true) != -1)
 	{
			new sendername[MAX_PLAYER_NAME];
			new string[256];
			GetPlayerName(playerid, sendername, 24);
			format(string, sizeof(string), "~ %s has been Kicked/Banned from the server for 'Advertising.'", sendername);
			SendClientMessageToAll(COLOR_RED, string);
			TogglePlayerControllable(playerid, 0);
		 	return Kick(playerid), false;
		}
		return 1;
}
I will REP the helper
This way?
Reply
#3

Thanks buddy!
You made my day
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)