SA-MP Forums Archive
NPC Facing Angle. - 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 Facing Angle. (/showthread.php?tid=532121)



NPC Facing Angle. - tuuler - 16.08.2014

Hello, I have a problem... I don't know why my NPC wont face the angle what I am telling him to face at, when I check NPC angle ingame, it says it's correct, but he doesnt face at the correct angle...

Code:
pawn Код:
// Under ongamemodeinit:
ConnectNPC("Pizza", "npcidle");

// Under onplayerspawn:
new NPCID = GetPlayerIDFromName("Pizza");
SetPlayerColor(NPCID,invalid);
SetSpawnInfo( NPCID, 0, 155, 375.6206, -117.2704, 1001.4922, 180, 0, 0, 0, 0, 0, 0 );
SetPlayerVirtualWorld(NPCID,0);
SetTimer("NPCinfo", 1000, false);

// Under NPCinfo:
new NPCID = GetPlayerIDFromName("Pizza");
SetPlayerSkin(NPCID,155);
SetPlayerPos(NPCID,375.6206, -117.2704, 1001.4922);
SetPlayerFacingAngle(NPCID,180);

// GetPlayerIDFromName works fine.



Re: NPC Facing Angle. - MicroD - 16.08.2014

I have an idea, try to use SetMyFacingAngle(https://sampwiki.blast.hk/wiki/NPC:SetMyFacingAngle) under https://sampwiki.blast.hk/wiki/NPC:OnNPCSpawn in "npcidle" pawn.