Question about 'npc'
#1

i used original npc function(SA:MP function) not fcnpc,rnpc,xnpc..etc

problem is npc perceive wall
but, not perceive ceiling when using 'MapAndreas' Function.
however, wall have been still perceive.

Please tell me

solve this problem.

Код:
stock GetClosestPlayerE(playerid, bool:ignorance=false)
{
    new closestplayer = -1;
    new Float:closestdist = 999999;
    new Float:x, Float:y, Float:z, Float:zMap,Float:xMap,Float:yMap;
    for(new p=0; p<MAX_PLAYERS; p++)
    {
        if(p != playerid && IsPlayerConnected(p) && !IsPlayerZombie(p))
        {
            if(ignorance == false)
            {
	            GetPlayerPos(p, x,y,z);
	            MapAndreas_FindZ_For2DCoord(x,y,zMap);
				if(zMap > z || IsSafeZone(p) || CampingPlayers(p)) continue;
			}
			new Float:dist = GetDistanceBetweenPlayersE(playerid,p);
        	if(dist < closestdist)
            {
                closestdist = dist;
                closestplayer = p;
            }
        }
    }
    return closestplayer;
}
The red clolor is mapandreas
Reply


Forum Jump:


Users browsing this thread: