24.08.2012, 16:44
Hello,
I have a npc in my server and i am using this code.when player comes near npc and will say browse it will open the weap box.
But that NPC is standing at a fixed position.
But now i maded a walking npc and i want it to detect npc loc and make a range i hope you are getting my point.
Npc will be walking and his range will be keep changing can someone make its code.when player comes near him he gets stopped at the point and when player will say browse (if player in range of npc) will open the dialog box.
I have a npc in my server and i am using this code.when player comes near npc and will say browse it will open the weap box.
Код:
if(IsPlayerInRangeOfPoint(playerid,2.0,2159.9353,2126.9072,10.8125)) { if (strfind(text, "browse") != -1) { ShowPlayerDialog(playerid, CmdsMenu, DIALOG_STYLE_LIST, "Weapons:","1): UZI, nAK-47, Spray Paint\n2): Tec9, M4, Fire Extinguer\n3): Sniper Rifle, Knife, Silenced Pistol\n4): Deagle, MP5, Sawnoff Shotgun\n5): Parachute", "OK", "ESC"); } return 1; }
But now i maded a walking npc and i want it to detect npc loc and make a range i hope you are getting my point.
Npc will be walking and his range will be keep changing can someone make its code.when player comes near him he gets stopped at the point and when player will say browse (if player in range of npc) will open the dialog box.