[RNPC] Need help, for this.
#1

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.
Reply
#2

Quote:

if(IsPlayerNPC(playerid))return 1;

if i not wrong
Reply
#3

Quote:
Originally Posted by VinPure
Посмотреть сообщение
if i not wrong
doesn't works. з_з
Reply
#4

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
Reply
#5

Quote:
Originally Posted by doreto
Посмотреть сообщение
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
Thanks for your, help.
Reply
#6

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)