SA-MP Forums Archive
NPC Help - 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: NPC Help (/showthread.php?tid=378567)



Delete - Crica - 18.09.2012

Delete


Re: NPC Help - blank. - 18.09.2012

(With ZCMD)
pawn Код:
CMD:test(playerid,params[])
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(npcid,X,Y,Z);
    if(IsPlayerInRangeOfPoint(playerid,5.0,X,Y,Z))
        {
        // The player is near the specified NPC, do your stuff here.
        }
    return 1;
    }
Of course range can be whatever you want it to be, I just set it to 5.0 here for the example.
Needless to say you need to know the player id of the NPC, denoted as 'npcid' in the example above.