Outdated "ProxDetector"
#1

I've heard that the "ProxDetector" i think it's called, from the old GF gamemode is pretty outdated, and that's what i use mine after.
So what would be the best way to send a nearby message within a given radius, and then tint it after how close the other player is.

pawn Код:
stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    new Float:ix, Float:iy, Float:iz;
    new Float:cx, Float:cy, Float:cz;
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i))
        {
            if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GetPlayerPos(i, ix, iy, iz);
                cx = (x - ix);
                cy = (y - iy);
                cz = (z - iz);
    if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
                {
                    SendClientMessage(i, col1, string);
                }
                else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
                {
                    SendClientMessage(i, col2, string);
                }
                else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
                {
                    SendClientMessage(i, col3, string);
                }
                else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
                {
                    SendClientMessage(i, col4, string);
                }
                else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
                {
                    SendClientMessage(i, col5, string);
                }
            }
        }
    }
    return 1;
}
Currently this is my "stock".
Reply


Messages In This Thread
Outdated "ProxDetector" - by CalvinC - 31.12.2014, 19:45
Re: Outdated "ProxDetector" - by Schneider - 31.12.2014, 20:05
Re: Outdated "ProxDetector" - by CalvinC - 31.12.2014, 20:07
Re: Outdated "ProxDetector" - by Schneider - 31.12.2014, 20:13
Re: Outdated "ProxDetector" - by CalvinC - 31.12.2014, 20:16
Re: Outdated "ProxDetector" - by Schneider - 31.12.2014, 20:32
Re: Outdated "ProxDetector" - by Vince - 31.12.2014, 21:41
Re: Outdated "ProxDetector" - by CalvinC - 31.12.2014, 22:03
Re: Outdated "ProxDetector" - by jackx3rx - 31.12.2014, 22:09
Re: Outdated "ProxDetector" - by CalvinC - 31.12.2014, 22:13

Forum Jump:


Users browsing this thread: 1 Guest(s)