samp-incognito / samp-streamer-plugin

Streamer Plugin for SA-MP (San Andreas Multiplayer)
Apache License 2.0
235 stars 93 forks source link

Does IsAnyPlayerInDynamicArea() detect NPCs as well? #397

Open Jedrzej94 opened 3 years ago

Jedrzej94 commented 3 years ago

Does it? Because I don't want it to detect NPCs. We should have additional optional param to specify that as a flag.

from my debugging seems like they are detected with that function too.

NPCs are some-what players server-side so probably why the iterator contains them too. May I request that optional parameter please to all "IsAny/IsPlayerIn" etc? Thanks

https://github.com/samp-incognito/samp-streamer-plugin/blob/49f9f165ebb017405d5e3dfdcd07d6f3c21bf172/src/natives/areas.cpp#L302

Jedrzej94 commented 3 years ago

Awful temporary solution till this get added/done:

bool:FCNPC_IsAnyPlayerInStatisArea(npcid)
{
    //return IsAnyPlayerInDynamicArea(FCNPC_GetStatisAreaId(npcid));

    foreach(new playerid : Player)
    {
        if(IsPlayerInDynamicArea(playerid, FCNPC_GetStatisAreaId(npcid)))
        {
            return true;
        }
    }
    return false;
}