NPC Pos - 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 Pos (
/showthread.php?tid=379564)
NPC Pos -
Black Wolf - 22.09.2012
Hello
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 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.
Re: NPC Pos -
Red_Dragon. - 22.09.2012
Do you mean you want to know how to activate the NPC ?
Re: NPC Pos -
Black Wolf - 22.09.2012
Not to activate the NPC i want that when player is in range of npc and say browse the weapon dialog wil pop up bt i am not able to find the code for detecting npc pos
Re: NPC Pos -
Red_Dragon. - 22.09.2012
See this:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
IF i helped "+REP" me and thanks
i can make it you by the way if you don't understand it
Re: NPC Pos -
Black Wolf - 22.09.2012
I know that but how to get npc location and put it for range
Re: NPC Pos -
Red_Dragon. - 22.09.2012
Get the location's FLOAT:X, FLOAT:Y and FLOAT:Z
Re: NPC Pos -
Black Wolf - 22.09.2012
Yeah but how to get location for NPC
Re: NPC Pos -
XtremeR - 22.09.2012
pawn Код:
if(GetNPCPos(playerid, x, y, z ))
{
if(IsPlayerInRangeOfPoint(playerid, 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;
}
Re: NPC Pos -
Black Wolf - 22.09.2012
Not working anyone please help fast
Re: NPC Pos -
Red_Dragon. - 22.09.2012
Why ? where are the errors if it is not working ?