04.08.2015, 21:56
Como posso fazer para um npc mirar em um player?
Uso o plugin FCNPC e a parte do npc spawnar, andar etc. jб existe!
Se alguйm puder me dar algumas dicas eu agradeзo!
Uso o plugin FCNPC e a parte do npc spawnar, andar etc. jб existe!
Se alguйm puder me dar algumas dicas eu agradeзo!
PHP код:
public MoverNPC(npcid)
{
new Float:p[3];
foreach(new i : Player)
{
GetPlayerPos(i,p[0],p[1],p[2]);
if(IsPlayerInRangeOfPoint(npcid,50,p[0],p[1],p[2]))
{
FCNPC_GoTo(npcid,p[0],p[1],p[2],MOVE_TYPE_RUN,10,1);
if(IsPlayerInRangeOfPoint(npcid,1,p[0],p[1],p[2]))
{
FCNPC_Punch(npcid,p[0],p[1],p[2],125);
}
}
}
return 1;
}
PHP код:
stock FCNPC_Punch(npcid, Float:x, Float:y, Float:z, PunchResetDelay = 125)
{
FCNPC_AimAt(npcid, x, y, z, 0);
FCNPC_StopAim(npcid);
FCNPC_SetKeys(npcid, 0x80 + 4);
SetTimerEx("ResetNPCKeys", PunchResetDelay, false, "i", npcid);
}