Uklanjanje obicnog chata?


Započeo Teodor, Maj 05, 2020, 21:36:46 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

ajde posalji citav OnPlayerText ovdje

My Bike KTM 450 SXF 2008

Citat: Vuzimir poslato Maj 06, 2020, 22:42:43 POSLE PODNE
ajde posalji citav OnPlayerText ovdje
public OnPlayerText(playerid, text[])
{
	new string[128];
	if(PlayerInfo[playerid][pMute] == 1)
	{
	    format(string, 128, "Ne mozes pisati jer si mutiran jos %d minuta", PlayerInfo[playerid][pMute]);
		SCM(playerid,RED, string);
		return 0;
	}
	if(InPubg[playerid] == 1)
	{
	    format(string, 128, "[PUBG]%s: %s",GetName(playerid), text);
		SendMessageToPubg(string);
		return 0;
	}
	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]++;
			format(string, sizeof(string), "Vrijedanje i psovanje nije dozvoljeno. Upozorenja: %d/15", swearCount[playerid], MAX_SWEARCOUNT);
			SendClientMessage(playerid, 0xE60000FF, string);
   			if(swearCount[playerid] >= MAX_SWEARCOUNT)
			{
			    new name[24];
			    new string2[128];
			    GetPlayerName(playerid, name, sizeof(name));
			    format(string, sizeof(string), "*** %s je kickovan sa servera zbog vrijedanja/psovanja", name);
			    SendMessageToAdmins(string);
			    format(string2, sizeof(string2), "Kikovani ste sa servera zato sto ste Vredjali/Psovali u chatu", name);
			    SCM(playerid,-1,string2);
			    Kick(playerid);
			    break;
			}
			break;
		}
	}
	new id = playerid;
 	format(string, sizeof(string), "[ID: %d] %s: %s ",id, GetName(playerid), text);
	ProxDetector(10.0, playerid, string, -1);
	return ( false ); // Return false!
}

Izgleda u skripti toj ok sve, moze samo biti jos da nesto nije ok sa Prox Decectorom, probaj zamjenuti taj svoj sa ovim:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public 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;
}

My Bike KTM 450 SXF 2008

Citat: Vuzimir poslato Maj 07, 2020, 06:52:34 PRE PODNE
Izgleda u skripti toj ok sve, moze samo biti jos da nesto nije ok sa Prox Decectorom, probaj zamjenuti taj svoj sa ovim:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public 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;
}

Opet Isto :(

Moraces mi uslikati ili snimiti sta ti je problem.... ne mogu ni ja vise shvatiti sta se desava

My Bike KTM 450 SXF 2008