14.08.2014, 00:18
hola como hago para que la conversacion no la vean todo solo los que estбn cerca
desde ya mucas gracias
desde ya mucas gracias
NearMsg(playerid, color, string[], Float: Distance)
{
new Float: nbCoords[3];
GetPlayerPos(playerid, nbCoords[0], nbCoords[1], nbCoords[2]);
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, Distance, nbCoords[0], nbCoords[1], nbCoords[2]) && (GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))) {SendClientMessage(i, color, string);}
}
return 1;
}
stock ProxDetector2(Float:radi, playerid, string[],color1,color2,color3,color4,color5)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, radi / 16, x, y, z))
{
SendClientMessage(i, color1, string);
}
else if(IsPlayerInRangeOfPoint(i, radi / 8, x, y, z))
{
SendClientMessage(i, color2, string);
}
else if(IsPlayerInRangeOfPoint(i, radi / 4, x, y, z))
{
SendClientMessage(i, color3, string);
}
else if(IsPlayerInRangeOfPoint(i, radi / 2, x, y, z))
{
SendClientMessage(i, color4, string);
}
else if(IsPlayerInRangeOfPoint(i, radi, x, y, z))
{
SendClientMessage(i, color5, string);
}
}
return 1;
}
public OnPlayerText(playerid, text[])
{
new message[128];
format(message, sizeof(message), "%s dice: %s", GetName(playerid), text);
ProxDetector2(30, playerid, message,0xFFFFFFAA,0xE6E6E6AA,0xCCCCCCAA,0xB3B3B3AA,0x999999AA);
return 0;
}
Asi es como lo tengo en mi servidor, en caso de que quieras cambiar los colores ve a una pagina como [URL="http://www.colorpicker.com/"]esta[/URL] para escoger color ;)
Espero que te sirva