Question about 'npc' - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question about 'npc' (
/showthread.php?tid=465371)
Question about 'npc' -
seoseokbin - 22.09.2013
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