04.03.2017, 12:44
Public for text
public OnPlayerText(playerid, text[])
{
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new string[128];
format(string,sizeof(string),"%s Berkata : %s",getPlayerName(playerid),text);
new chat_warna;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, CHAT_RADIUS, x, y, z)) continue;
new Float:distance = GetPlayerDistanceFromPoint(i, x,y,z);
if(distance < CHAT_RADIUS / CHAT_TEXTS)
{
chat_warna = WARNA_CHAT;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 2)
{
chat_warna = WARNA_TEXT1;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 3)
{
chat_warna = WARNA_TEXT2;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 4)
{
chat_warna = WARNA_TEXT3;
}
else if(distance <= CHAT_RADIUS / CHAT_TEXTS * 5)
{
chat_warna = WARNA_TEXT4;
}
SendClientMessage(i, chat_warna, string);
}
return 1;
}
This My Problem
public OnPlayerText(playerid, text[])
{
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new string[128];
format(string,sizeof(string),"%s Berkata : %s",getPlayerName(playerid),text);
new chat_warna;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, CHAT_RADIUS, x, y, z)) continue;
new Float:distance = GetPlayerDistanceFromPoint(i, x,y,z);
if(distance < CHAT_RADIUS / CHAT_TEXTS)
{
chat_warna = WARNA_CHAT;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 2)
{
chat_warna = WARNA_TEXT1;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 3)
{
chat_warna = WARNA_TEXT2;
}
else if(distance < CHAT_RADIUS / CHAT_TEXTS * 4)
{
chat_warna = WARNA_TEXT3;
}
else if(distance <= CHAT_RADIUS / CHAT_TEXTS * 5)
{
chat_warna = WARNA_TEXT4;
}
SendClientMessage(i, chat_warna, string);
}
return 1;
}
This My Problem