PDA

View Full Version : NPC Help


Crica
18/09/2012, 01:20 PM
Delete

blank.
18/09/2012, 02:27 PM
(With ZCMD)

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.