ARNPC set 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: ARNPC set pos (
/showthread.php?tid=516216)
ARNPC set pos -
n00el - 30.05.2014
hy. why dont set this a pos? the skin and the agle is loaded, and set to the npc. but the pos not.. i create a debug, and 'printf' when npc spawn, the npc-s NpcInfo[npcid][npcX]-value.. and its ok, but setpos dosent work. why?
load:
PHP код:
mysql_fetch_field_row(data, "x"); NpcInfo[npcid][npcX] = floatstr(data);
mysql_fetch_field_row(data, "y"); NpcInfo[npcid][npcY] = floatstr(data);
mysql_fetch_field_row(data, "z"); NpcInfo[npcid][npcZ] = floatstr(data);
mysql_fetch_field_row(data, "a"); NpcInfo[npcid][npcA] = floatstr(data);
On Player Connect:
PHP код:
if(IsPlayerNPC(playerid))
{
SpawnPlayer(playerid);
new npcid = NpcInfo[playerid][npcID];
SetRNPCFacingAngle(npcid, NpcInfo[npcid][npcA]);
SetRNPCSkin(npcid, NpcInfo[npcid][npcSkin]);
SetRNPCPos(npcid, NpcInfo[npcid][npcX], NpcInfo[npcid][npcY], NpcInfo[npcid][npcZ]);
}
On palyer spawn:
PHP код:
if(IsPlayerNPC(playerid))
{
new npcid = NpcInfo[playerid][npcID];
SetRNPCFacingAngle(npcid, NpcInfo[npcid][npcA]);
SetRNPCSkin(npcid, NpcInfo[npcid][npcSkin]);
SetRNPCPos(npcid, NpcInfo[npcid][npcX], NpcInfo[npcid][npcY], NpcInfo[npcid][npcZ]);
new Float:x, Float:y, Float:z;
GetRNPCPos(npcid, x , y, z);
return 1;
}
Re: ARNPC set pos -
n00el - 30.05.2014
anyone?