[Pomoc] Poruke


Započeo Tosic ツ, Mart 13, 2016, 13:59:38 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

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);
		foreach(Player,i)
		{
			if(IsPlayerConnected(i))
			{
				if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
				{
					GetPlayerPos(i, posx, posy, posz);
					tempposx = (oldposx -posx);
					tempposy = (oldposy -posy);
					tempposz = (oldposz -posz);
					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;
}


Ako ti treba pod OnplayerText
#define BELA          			 	0xFFFFFFAA

new tekst1 = strlen(text),string[256];
		new ime[MAX_PLAYER_NAME];
		GetPlayerName(playerid, ime, sizeof(ime));
		for(new i = 0; i<tekst1; i++) { if(IsNumeric(text[i])) text[i] = '*' ; }
		format(string, sizeof(string), "%s kaze: %s", ime, text);
		SetPlayerChatBubble(playerid, text, 0x44FF00AA, 20.0, 15000);
		ProxDetector(20.0, playerid, string,BELA,BELA,BELA,BELA,BELA);


Mozes i u komandi koristit, primer

Boja ljubicasta ona
#define PROX            			0xC2A2DAAA


YCMD:me(playerid, params[], help)
{
    #pragma unused help
	new result[1024];
	if(sscanf(params, "s[80]", result)) return SCM(playerid, BELA, "Koristite: /me [tekst]");
	new tekst1 = strlen(result);
	for(new i = 0; i<tekst1; i++) { if(IsNumeric(result[i])) result[i] = '*' ; }
	new string[256];
	format(string, sizeof string, "* %s %s",GetName(playerid),result);
	ProxDetector(30.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
	return 1;
}

IsNumeric(const string[])
{
	for (new i = 0, j = strlen(string); i < j; i++)
	{
		if (string[i] > '9' || string[i] < '0') return 0;
	}
	return 1;
}

stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

ProxDetector(radius, playerid, string, BOJA1,BOJA2,BOJA3,BOJA4,BOJA5);


Poslednja Izmena: Mart 13, 2016, 18:13:38 POSLE PODNE od NewOne

Dobio si odgovor, tema ide pod lock.
You have enemies? Good. That means you've stood up for something, sometime in your life.