[RNPC] Need help, for this. - 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: [RNPC] Need help, for this. (
/showthread.php?tid=510488)
[RNPC] Need help, for this. -
Galletziz - 01.05.2014
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <rnpc>
#if defined FILTERSCRIPT
new rnpcid;
public OnFilterScriptInit()
{
rnpcid = ConnectRNPC("zombie");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
I try to connect a NPC but when i start my server, nothing happen:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(rnpcid))return 1;
return 1;
}
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(rnpcid))return 1;
return 1;
}
Forced NPC to join cuz i have a registration system.
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(rnpcid))
{
SetPlayerPos(rnpcid,2530.7561,-1678.0607,19.9302);
}
return 1;
}
and here try to spawn the npc, on this coords, but nothing.
Someone can help me?!
Thanks anyway.
Re: [RNPC] Need help, for this. -
VinPure - 01.05.2014
Quote:
if(IsPlayerNPC(playerid))return 1;
|
if i not wrong
Re: [RNPC] Need help, for this. -
Galletziz - 01.05.2014
Quote:
Originally Posted by VinPure
if i not wrong 
|
doesn't works. з_з
Re: [RNPC] Need help, for this. -
doreto - 01.05.2014
It doesn't work because their aren't function such as connectRNPC.You should use FCNPC_Create and FCNPC_Spawn to spawn it.For more info read THREAD INFORMATION -
https://sampforum.blast.hk/showthread.php?tid=428066
Re: [RNPC] Need help, for this. -
Galletziz - 01.05.2014
Quote:
Originally Posted by doreto
|
Thanks for your, help.
Re: [RNPC] Need help, for this. -
Galletziz - 01.05.2014
I have tryed with FCNPC and npc spawn correctly but when i want that if the player is on his range he must walk towards the player, nothing happens, this is my script:
pawn Код:
forward npcwalk(playerid);
public npcwalk(playerid)
{
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid,px,py,pz);
FCNPC_GoTo(npcID,px,py,pz,MOVE_TYPE_WALK,-1,-1);
}
public OnPlayerSpawn(playerid)
{
new Float:nx, Float:ny, Float:nz;
FCNPC_GetPosition(npcID,nx,ny,nz);
if(IsPlayerInRangeOfPoint(playerid,10.0,nx,ny,nz))
{
SetTimer("npcwalk",3000,false);
}
}
Someone know why?