ProxDetector more efficient?
#2

a snippet I made two days ago. Not sure about efficiency, but at least there is no need to enter multiple colors.
radi - The radius of which the message will be sent.
x,y,z - coordinates of point from where the message will be sent.
color - the color of the message to be sent. The further it goes, the darker the color gets.
text - the text to be sent.

pawn Код:
SendChatMessage(Float:radi, Float:x,Float:y,Float:z, color, text[])
{
    new red,green,blue,
        bool:received[MAX_PLAYERS];
   
    red = (color >> 24) & 0xFF;
    green = (color >> 16) & 0xFF;
    blue = (color >> 8) & 0xFF;

    for(new i = 0; i < 5; i++)
    {
        foreach(Player, j)
        {
            if(IsPlayerInRangeOfPoint(j, Float:radi / 8 * (i * 2), Float:x, Float:y, Float:z) && received[j] == false)
            {
                SendClientMessage(j, ((red * 0x1000000) + (green * 0x10000) + (blue * 0x100) + 0xFF), text);           
                received[j] = true;
            }
        }
        if(red >= 25) red = red - 25;
        else red = 0;
        if(green >= 25) green = green - 25;
        else green = 0;
        if(blue >= 25) blue = blue - 25;
        else blue = 0;
    }
}
Reply


Messages In This Thread
ProxDetector more efficient? - by ||123|| - 11.07.2011, 13:03
Re: ProxDetector more efficient? - by Macluawn - 11.07.2011, 13:32
Re: ProxDetector more efficient? - by Shadoww5 - 11.07.2011, 13:50
Re: ProxDetector more efficient? - by Macluawn - 11.07.2011, 14:04
Re: ProxDetector more efficient? - by ||123|| - 11.07.2011, 15:54
Re: ProxDetector more efficient? - by Shadoww5 - 11.07.2011, 18:17
Re: ProxDetector more efficient? - by ||123|| - 11.07.2011, 19:10
Re: ProxDetector more efficient? - by ||123|| - 11.07.2011, 19:40
Re: ProxDetector more efficient? - by Shadoww5 - 11.07.2011, 21:11

Forum Jump:


Users browsing this thread: 1 Guest(s)