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 0xFFFFFFAAnew tekst1 = strlen(text),string;
new ime;
GetPlayerName(playerid, ime, sizeof(ime));
for(new i = 0; 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 0xC2A2DAAAYCMD:me(playerid, params[], help)
{
#pragma unused help
new result;
if(sscanf(params, "s", result)) return SCM(playerid, BELA, "Koristite: /me ");
new tekst1 = strlen(result);
for(new i = 0; i new string;
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 > '9' || string < '0') return 0;
}
return 1;
}stock GetName(playerid)
{
new name;
GetPlayerName(playerid, name, sizeof(name));
return name;
}ProxDetector(radius, playerid, string, BOJA1,BOJA2,BOJA3,BOJA4,BOJA5);