26.08.2012, 04:12
pawn Код:
GetNPCID(npcName[MAX_PLAYER_NAME], bool: ignorecase = false)
{
new npcid = INVALID_PLAYER_ID, npcNameEx[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerNPC(i))
{
GetPlayerName(i, npcNameEx, MAX_PLAYER_NAME);
if(!strcmp(npcName, npcNameEx, ignorecase))
{
npcid = i;
break;
}
}
}
return npcid;
}
new Float: npcPos[3];
GetPlayerPos(GetNPCID("YOUR NPC NAME", true), npcPos[0], npcPos[1], npcPos[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, npcPos[0], npcPos[1], npcPos[2]))
{
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;
}