Вы не правы. Я указал длину выводимого в чат сообщения. Вы же говорите о длине вводимого игроком сообщения.
wiki Limits
Фух, ну и срач) Проблему решил.
Не откажусь от помощи в оптимизации данной функции)PHP код:
stock ProxDetectorChat(playerid, Float:max_range, color, text[], Float:max_ratio = 1.6)
{
new
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:range,
Float:range_ratio,
Float:range_with_ratio,
clr_r, clr_g, clr_b,
Float:color_r, Float:color_g, Float:color_b,
colored, string[128], playercolor;
if (!GetPlayerPos(playerid, pos_x, pos_y, pos_z)) return 0;
color_r = float(color >> 24 & 0xFF);
color_g = float(color >> 16 & 0xFF);
color_b = float(color >> 8 & 0xFF);
range_with_ratio = max_range * max_ratio;
playercolor = GetPlayerColor(playerid);
foreach (new i : Player) {
if (GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(i)) continue;
if (!playerlogged{i}) continue;
range = GetPlayerDistanceFromPoint(i, pos_x, pos_y, pos_z);
if (range > max_range) continue;
range_ratio = (range_with_ratio - range) / range_with_ratio;
clr_r = floatround(range_ratio * color_r);
clr_g = floatround(range_ratio * color_g);
clr_b = floatround(range_ratio * color_b);
colored = (color & 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24);
switch(PlayerInfo[i][pChatSet])
{
case 1:
{
switch(PlayerInfo[i][pIdChatSet])
{
case 1: format(string, sizeof(string), "%s(%d): {%06x}%s", PlayerInfo[playerid][pName], playerid, colored >>> 8, text);
case 2: format(string, sizeof(string), "%s: {%06x}%s", PlayerInfo[playerid][pName], colored >>> 8, text);
}
SCM(i, playercolor, string);
}
case 2:
{
switch(PlayerInfo[i][pIdChatSet])
{
case 1: format(string, sizeof(string), " - %s {%06x}(%s)[%d]", text, playercolor >>> 8, PlayerInfo[playerid][pName], playerid);
case 2: format(string, sizeof(string), " - %s {%06x}(%s)", text, playercolor >>> 8, PlayerInfo[playerid][pName]);
}
SCM(i, colored, string);
}
}
}
return 1;
}
Перед циклом вытащи GetPlayerVirtualWorld(playerid) в переменную, и вроде всё...PHP код:
foreach (new i : Player) {
if (GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(i)) continue;
[Anticheat]___Invisible Fly Hack
[Anticheat]____Weapon/Ammo Hack
[Function]______ResetPlayerWeaponSlot
[Function]_______FIX_SetPlayerAmmo
[ServerMod]______TDM | Zombie Apokalypse
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)