[Plugin] RNPC - Recordfree NPCs | Control NPCs without recording | DEV

I use this script for testing because i want load zombies on my server. I trying a lot of days, but for me nothing works...

Code:
// ------------- NPC zombie test and example script
// RNPC 0.4 (26.6.2014) - Mauzen

// Use ConnectZombieBots(playerid, amount)
// to create <amount> zombie bots that keep following <playerid>
// They wont attack but can be killed for tests and stuff
// Either initialize MapAndreas properly, or go to line 78
// and change the last 1 in MoveRNPC to a 0
#define FILTERSCRIPT

#include <a_samp>
#include <rnpc>//Credits: Mauzen

new rnpcZombie[MAX_PLAYERS];
new rnpcZTimer[MAX_PLAYERS];

stock ConnectZombieBots(playerid, amount)
{
    new name[24];
    new id;
    // spawn the given amount of NPCs
    while(amount-- > 0)
	{
        format(name, 24, "Zombie_%d", 500-amount);
        id = ConnectRNPC(name);
        // Store their target player
        rnpcZombie[id] = playerid;
    }
}

public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
    {
		if (rnpcZombie[playerid] > 0)
		{
	        // Enable RNPC damage management
	        RNPC_SetShootable(playerid, 1);
	        RNPC_ToggleVehicleCollisionCheck(playerid, 1);

	        // Random skin for datz fun
	        SetPlayerSkin(playerid, random(299));

	        // Change name to avoid name collisions
	        new name[24];
	        format(name, 24, "Zombie_%d", playerid);
	        SetPlayerName(playerid, name);

	        // Spawn zombie somewhere in area around player
	        new Float:x, Float:y, Float:z;
	        GetPlayerPos(rnpcZombie[playerid], x, y, z);
	        x = x - 30.0 + random(60);
	        y = y - 30.0 + random(60);
	        // Set to position on ground
	        MapAndreas_FindZ_For2DCoord(x, y, z);
	        SetPlayerPos(playerid, x, y, z+0.7);

	        // If it was a respawn, kill the old timer
	        if (rnpcZTimer[playerid] > 0) KillTimer(rnpcZTimer[playerid]);
	        // Make him follow the player
	        rnpcZTimer[playerid] = SetTimerEx("RFollowPlayer", 5000, 1, "i", playerid);
	    }
    }
    #if defined RNPC_OnPlayerSpawn
            return RNPC_OnPlayerSpawn(playerid);
    #else
            return 1;
    #endif
}
#if defined _ALS_OnPlayerSpawn
        #undef OnPlayerSpawn
#else
        #define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn RNPCZ_OnPlayerSpawn
forward RNPCZ_OnPlayerSpawn(playerid);

forward RFollowPlayer(npcid);
public RFollowPlayer(npcid)
{
    if (IsPlayerConnected(rnpcZombie[npcid]))
	{
        new Float:x, Float:y, Float:z;
        GetPlayerPos(rnpcZombie[npcid], x, y, z);
        // Move RNPC to random point in area around target player
        MoveRNPC(npcid, x - 3.0 + random(600) / 100.0, y - 3.0 + random(600) / 100.0, z, RNPC_SPEED_RUN, 1);
    }
}
Anyone can help me with this please?

Plugin Loaded:
Quote:

[10:28:40] Loaded.
[10:28:40] Loading plugin: RNPC.so
[10:28:40] RNPC V0.4.1 by Mauzen (03.12.2014)

But then this:

Code:
[10:30:56] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[10:30:56] [debug]  Stack pointer (STK) is 0xB758, heap pointer (HEA) is 0xB71C
[10:30:56] [debug] AMX backtrace:
[10:30:56] [debug] #0 00002ccc in public RNPC_OnPlayerSpawn (0) from zombie.amx
I have 200 NPCs und 300maxplayers in server.cfg

After i searching about:
Code:
Run time error 3: "Stack/heap collision (insufficient stack size)
i remove this from script:

Code:
    #if defined RNPC_OnPlayerSpawn
            return RNPC_OnPlayerSpawn(playerid);
    #else
            return 1;
    #endif
}
#if defined _ALS_OnPlayerSpawn
        #undef OnPlayerSpawn
#else
        #define _ALS_OnPlayerSpawn
#endif

#define OnPlayerSpawn RNPCZ_OnPlayerSpawn
forward RNPCZ_OnPlayerSpawn(playerid);
and put in:
Code:
public OnPlayerSpawn(playerid)
this:

Code:
public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
    {
but now npcs doesnt join??
Reply

When im trying to upload my zombies to windows sever they connected successfully but when im trying to upload the zombies on linux server, they wont go up.

http://pastebin.com/Zhpgzd4u
Reply

Uhh using MapAndreas and RNPC didn't worked out like I hoped for :/
Reply

someone can give download link? please
Reply

Fixed my link shortener, download should work again now
Reply

Hello Mauzen, I am using an external fs to connect zombie bots with your plugin, all normal loading does not even throw any type of error, but the bots simply do not connect, it already checks all the lines many times and it seems everything is correct, I do not know that may be causing interference, help me?



Reply

Common problems are maxnpcs not being set in server.cfg, or the rnpc npcmode script not being compiled and in the npcmodes directory. Maybe its one of that?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)