18.09.2012, 13:27
(With ZCMD)
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.
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;
}
Needless to say you need to know the player id of the NPC, denoted as 'npcid' in the example above.