OnPlayerText
#8

Для отправки сообщения ближайшим игрокам предлагаю воспользоваться моей версией функции ProxDetector, которая довольно эффективно выполняет свою функцию высчитывая цвет автоматически в зависимости от расстояния.

PHP код:
stock ProxDetector(playeridFloat:max_rangecolorstring[], 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_rclr_gclr_b,
        
Float:color_rFloat:color_gFloat:color_b;
    if (!
GetPlayerPos(playeridpos_xpos_ypos_z)) {
        return 
0;
    }
    
color_r float(color >> 24 0xFF);
    
color_g float(color >> 16 0xFF);
    
color_b float(color >> 0xFF);
    
range_with_ratio max_range max_ratio;
#if defined foreach
    
foreach (new Player) {
#else
    
for (new GetPlayerPoolSize(); != -1i--) {
#endif
        
if (!IsPlayerStreamedIn(iplayerid)) {
            continue;
        }
        
range GetPlayerDistanceFromPoint(ipos_xpos_ypos_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);
        
SendClientMessage(i, (color 0xFF) | (clr_b << 8) | (clr_g << 16) | (clr_r << 24), string);
    }
    
SendClientMessage(playeridcolorstring);
    return 
1;

Reply


Messages In This Thread
OnPlayerText - by FaGo - 03.08.2016, 13:57
Re: OnPlayerText - by Diman777 - 03.08.2016, 15:12
Re: OnPlayerText - by Romz - 03.08.2016, 15:25
Re: OnPlayerText - by FaGo - 03.08.2016, 17:44
Re: OnPlayerText - by Mutha_X - 03.08.2016, 18:40
Re: OnPlayerText - by FaGo - 03.08.2016, 22:23
Re: OnPlayerText - by OKStyle - 17.08.2016, 07:15
Re: OnPlayerText - by ZiGGi - 17.08.2016, 13:33
Re: OnPlayerText - by OKStyle - 17.08.2016, 17:14
Re: OnPlayerText - by Mutha_X - 17.08.2016, 17:36
Re: OnPlayerText - by OKStyle - 17.08.2016, 17:45
Re: OnPlayerText - by Mutha_X - 17.08.2016, 17:56
Re: OnPlayerText - by ZiGGi - 17.08.2016, 19:41

Forum Jump:


Users browsing this thread: 2 Guest(s)