06.12.2016, 08:46
(
Last edited by PrettyDiamond; 06/12/2016 at 09:17 AM.
)
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...
Anyone can help me with this please?
Plugin Loaded:
But then this:
I have 200 NPCs und 300maxplayers in server.cfg
After i searching about:
i remove this from script:
and put in:
this:
but now npcs doesnt join??
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);
}
}
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) |
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
After i searching about:
Code:
Run time error 3: "Stack/heap collision (insufficient stack size)
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);
Code:
public OnPlayerSpawn(playerid)
Code:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{

