[POMOC] Anti Swear/Anti psovke


Započeo R0x0r, Maj 12, 2012, 21:59:55 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: 0
Detaljan opis problema: Ovako..Zelio bih napraviti kada neko napise npr: "Jebi se" da umjesto toga prikaze "**** **"
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
City Dragons Rol3Play(Hamachi server)

Join in the Hamachi room:

_____________________________________

Network name: CD.RP
Password: 123
               
                        ili

Network name: CD.RP2
Password: 123
_____________________________________
IP: 5.93.44.30:7777

Evo ovo sam pre negde nasao pa ubacio u svoj neki mod:

na vrhu
Kod: c
#define MAX_DUZINA_RECI 18
#define MAX_WORDS 122
#define MAX_PSOVKI 5 // ovdje stavite broj koliko puta smije igrac napisati na chat uvredu da bi ga kickalo.(ovo vam nije potrebno mada sam ja stavio jer cu raditi da kicka kad bude 5


Odmah mozes ispod toga
Kod: C
new swearCount[MAX_PLAYERS];
new swear[][MAX_DUZINA_RECI] =
{
	{"stoko"},
	{"Popusis"},
	{"Kurac"},
	{"pusi"},
	{"Picko"},
	{"[cenzura]"},
	{"cit"},
	{"citer"},
	{"sobeit"},
	{"cheat"},
	{"cheater"},
	{"[cenzura]"},
	{"Ustaso"},
	{"Ustasu"},
	{"Ustase"},
	{"Balije"},
	{"kosovo"},
	{"Siptar"},
	{"Siptaru"},
	{"Balija"},
	{"Baliju"},
	{"Balijo"},
	{"Cetnici"},
	{"Cetnika"},
	{"cetnike"},
	{"mamu"},
	{"familiju"},
	{"sestru"},
	{"jebem"},
	{"jebemti"},
	{"majku"},
	{"seku"},
	{"Jebi"},
	{"jebu"},
	{"popusi"},
	{"kreten"},
	{"kretena"},
	{"bot"},
	{"bote"},
	{"botu"},
	{"konj"},
	{"[cenzura]e"},
	{"konju"},
	{"pica"},
	{"picko"},
	{"picke"},
	{"[cenzura]"},
	{"jebemti"},
	{"jeboti"},
	{"majku"},
	{"sisa"},
	{"karam"},
	{"karacu"},
	{"pizdo"},
	{"mater"},
	{"sestru"},
	{"cigane"},
	{"ciganju"},
	{"lud"},
	{"[cenzura]"},
	{"nob"},
	{"noob"},
	{"nobe"},
	{"noobe"},
	{"kretenu"},
	{"ludaku"},
	{"budalo"},
	{"zivotinjo"},
	{"hajvanu"},
	{"cetnik"},
	{"ustasa"},
	{"[cenzura]"},
	{"jebacu"},
	{"Govedo"},
	{"Sisadzijo"},
	{"pizda"},
	{"pizdo"},
	{"pizdu"},
	{"picka"},
	{"picku"},
	{"picko"},
	{"zvalje"},
	{"botarde"},
	{"sisa"},
	{"kurvo"},
	{"kurva"},
	{"kurvu"},
	{"kurvi"},
	{"[cenzura]"},
	{"[cenzura]u"},
	{"[cenzura]i"},
	{"cetnicku"},
	{"ustasku"},
	{"balisku"},
	{"ludu"},
	{"[cenzura]u"},
	{"sisa"},
	{"jebem ti"},
	{"jebo"},
	{"majku"},
	{"majkine"}

};


pod on playerdisconect dodaj:
swearCount[playerid] = 0;

da resetuje psovke na 0 kada igrac izadje

I pod onplayertext dodaj
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname, '_', ' ');

    format(str, sizeof(str), "%s kaze: %s", pname, text);
    ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    	if((strlen(text) < 3) || (text[0] == '/') || (text[0] == '#') || (text[0] == '!')) return 1;

	new offset;
	new len;
 	for(new i=0; i<MAX_WORDS; i++)
	{
		offset = strfind(text, swear[i], true);
		if(offset > -1)
		{
			len = strlen(swear[i]);
			if(len < 3) break;
			for(new y=0; y<len; y++)
			{
				text[offset+y] = '*';
			}
			swearCount[playerid]++;
			new string[64];
			format(string, sizeof(string), "Vrijedanje i psovanje nije dozvoljeno. Upozorenja: %d/%d", swearCount[playerid], MAX_PSOVKI);
			SendClientMessage(playerid, 0xE60000FF, string);
   			if(swearCount[playerid] >= MAX_PSOVKI)
			{
			    new name[24];
			    GetPlayerName(playerid, name, sizeof(name));
			    format(string, sizeof(string), "{FF0000}[InFo]:{F0E91A} %s {FFFFFF} je kickovan zbog vrijedanja ili psovanja", name);
			    SendClientMessageToAll(0xE60000FF, string);
			    Kick(playerid);
			    break;
			}
			break;
		}
	}
	return 1;

 
}

C:\Users\N\Desktop\0\gamemodes\CDM.pwn(352) : error 017: undefined symbol "strreplace"
C:\Users\N\Desktop\0\gamemodes\CDM.pwn(355) : error 017: undefined symbol "ProxDetector"
C:\Users\N\Desktop\0\gamemodes\CDM.pwn(356) : warning 217: loose indentation
C:\Users\N\Desktop\0\gamemodes\CDM.pwn(358) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


izbaci to    :-*
City Dragons Rol3Play(Hamachi server)

Join in the Hamachi room:

_____________________________________

Network name: CD.RP
Password: 123
               
                        ili

Network name: CD.RP2
Password: 123
_____________________________________
IP: 5.93.44.30:7777



Ispod publica
ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid)) {
        new Float:posx, Float:posy, Float:posz;
            new Float:oldposx, Float:oldposy, Float:oldposz;
            new Float:tempposx, Float:tempposy, Float:tempposz;
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++) {
            if(IsPlayerConnected(i)) {
                GetPlayerPos(i, posx, posy, posz);
                    tempposx = (oldposx -posx);
                    tempposy = (oldposy -posy);
                    tempposz = (oldposz -posz);
                if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) {
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) {
                        SendClientMessage(i, col5, string);
                    }
                }
            }
        }
    }
    return 1;
}


//-------------------------------------STOCKS-------------------------------
stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++) {
        if(string[i] == find) {
            string[i] = replace;
        }
    }
}
Poslednja Izmena: Maj 12, 2012, 22:26:28 POSLE PODNE od [BR] Ricky

-----------------------RIJESENO-------------------------------------

HVALA
 Ricky
City Dragons Rol3Play(Hamachi server)

Join in the Hamachi room:

_____________________________________

Network name: CD.RP
Password: 123
               
                        ili

Network name: CD.RP2
Password: 123
_____________________________________
IP: 5.93.44.30:7777