30.05.2014, 04:44
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:
On Player Connect:
On palyer spawn:
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);
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]);
}
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;
}