Connect RNPC
#1

Hello there,

I want to make one npc in my roleplay script, but when I try to connect it nothing is happening.
I put in onplayerconnect, onplayerspawn, and in onplayerrequestspawn if(IsPlayerNPC(playerid)) return true;
But the NPC doesn't shows up.
Here is code how do I connect it

pawn Код:
CMD:npcc(playerid, params[]){
    new Float:pos[3];
    Npc = ConnectRNPC("TestNpc");
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerPos(Npc, pos[0], pos[1], pos[2]);
    return true;
}

CMD:gethere(playerid, params[]){
    new Float:Speed, Float:pos[3];
    sscanf(params, "f", Speed);
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    MoveRNPC(Npc, pos[0], pos[1], pos[2], Speed);
    return true;
}
Reply
#2

same problem
Reply
#3

Is the NPC connected but not spawning? Or is it not connecting at all?
Reply
#4

In your server.cfg do you have
maxnpc number
?
If not add this up
maxnpc 2
and edit the number for more npcs than 2
Reply
#5

Try putting the ConnectRNPC line under the OnGameModeInIt..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)