22.09.2012, 12:10
Hello
I have a npc in my server i wanna make this code work.
I dont know how to get npc pos.
I want this text should work if player is in range of npc.
Npc name is drugdealer if you can get his id and then pos.
Please leave the code.
I have a npc in my server i wanna make this code work.
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,2.0, x, y, z ))
{
if (strfind(text, "browse") != -1)
{
ShowPlayerDialog(playerid, DIALOG_WP, DIALOG_STYLE_LIST, "Weapon Spawner", "Grenade ($1000)\nColt 45 ($1000)\nColt 45 (Silenced) ($1000)\nDesert Eagle (1000$)\nNormal Shotgun (1000$)\nSawnoff Shotgun (1000$)\nCombat Shotgun (1000$)\nMicro Uzi (Mac 10) (1000$)\nMP5 (1000$)\nAK47 (1000$)\nM4A1 (1000$)\nTec9 (1000$)\nCountry Rifle (1000$)\nSniper Rifle (1000$)\nRocket Launcher (100000$)\nHeat-Seeking Rocket Launcher (100000$)\nFlamethrower (1000$)", "Purchase", "Cancel");
}
return 1;
}
I want this text should work if player is in range of npc.
Npc name is drugdealer if you can get his id and then pos.
Please leave the code.