[Include] PAWN Colour Manipulation
#6

I present to you, a non-clusterfuck version of ProxDetector using this library:

pawn Код:
stock SendFadingMessage(playerid, Float:range, start_colour, end_colour, const message[]) {
    if (!IsPlayerConnected(playerid) || range < 0.0) {
        return 0;
    }

    new Float:ratio, Float:x, Float:y, Float:z, vw = GetPlayerVirtualWorld(playerid);
    GetPlayerPos(playerid, x, y, z);

    foreach (new i : Player) {
        if (GetPlayerVirtualWorld(i) != vw || (ratio = (GetPlayerDistanceFromPoint(i, x, y, z) / range)) > 1.0) {
            continue;
        }

        SendClientMessage(i, InterpolateColours(start_colour, end_colour, ratio), message);
    }

    return 1;
}
Reply


Messages In This Thread
PAWN Colour Manipulation - by kristo - 30.09.2018, 15:27
Re: PAWN Colour Manipulation - by SyS - 30.09.2018, 15:31
Re: PAWN Colour Manipulation - by kristo - 30.09.2018, 16:21
Re: PAWN Colour Manipulation - by Zeth - 01.10.2018, 06:11
Re: PAWN Colour Manipulation - by BigETI - 01.10.2018, 15:39
Re: PAWN Colour Manipulation - by kristo - 29.01.2019, 17:39

Forum Jump:


Users browsing this thread: 2 Guest(s)