SA-MP Forums Archive
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(npcidNpcInfo[npcid][npcA]);
        
SetRNPCSkin(npcidNpcInfo[npcid][npcSkin]);
        
SetRNPCPos(npcidNpcInfo[npcid][npcX], NpcInfo[npcid][npcY], NpcInfo[npcid][npcZ]);
    } 
On palyer spawn:
PHP код:
    if(IsPlayerNPC(playerid))
    {
        new 
npcid NpcInfo[playerid][npcID];
        
SetRNPCFacingAngle(npcidNpcInfo[npcid][npcA]);
        
SetRNPCSkin(npcidNpcInfo[npcid][npcSkin]);
        
SetRNPCPos(npcidNpcInfo[npcid][npcX], NpcInfo[npcid][npcY], NpcInfo[npcid][npcZ]);
        new 
Float:xFloat:yFloat:z;
        
GetRNPCPos(npcidyz);
         return 
1;
    } 



Re: ARNPC set pos - n00el - 30.05.2014

anyone?