01.02.2016, 12:45
Good FS,i will use it thanks!
Note: You may need to modify the script to create NPC's every 100 ms(using a timer) to prevent your server from thinking it is getting attacked. |
How does one make such a timer I'm pretty new to this and it would help me out alot if I can receive some help with this.
|
new name[MAX_PLAYER_NAME];
for(new npcid = 0; npcid < MAX_ZOMBIES; npcid++)
{
format(name, sizeof(name), "%s", ZOMBIE_NAME, npcid + 1);
SetTimerEx("CreateZombie", i*1000, false, "i", npcid);
count++;
}
forward CreateZombie(npcid, name[]);
public CreateZombie(npcid, name[]) return ConnectRNPC(npcid, name[]);
new Float:ZombieSpawns[2][3] =//REQUIRED: Change [2] to the amount of spawn locations.
{
{0.0, 0.0, 0.0},//REQUIRED: Add zombie spawn locations here.
{0.0, 0.0, 0.0}//REQUIRED: Add zombie spawn locations here.
};
new Float:ZombieSpawns[3][3] =//REQUIRED: Change [2] to the amount of spawn locations.
{
{1642.0972, -2332.3430, -2.6797},//REQUIRED: Add zombie spawn locations here.
{1685.3428, -2333.3137, 13.5469},//REQUIRED: Add zombie spawn locations here.
{1616.1416, -2276.0334, 13.5140}//REQUIRED: Add zombie spawn locations here.
};
The problem now is that I can't find any zombie even after adding the spawns. Here they are:
PHP код:
|
rnpc.inc(539) : error 025: function heading differs from prototype
[20:43:02] [debug] Server crashed while executing zombie2.amx [20:43:02] [debug] AMX backtrace: [20:43:02] [debug] #0 native RNPC_FinishBuild () from RNPC.so [20:43:02] [debug] #1 000005fc in ?? (0, -992755459, 1149966876, 1099739116, 985963430, 1) from zombie2.amx [20:43:02] [debug] #2 000046c4 in public OnZombieRoam () from zombie2.amx [20:43:02] [debug] Native backtrace: [20:43:02] [debug] #0 b73db9f0 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so [20:43:02] [debug] #1 b73d4a62 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so [20:43:02] [debug] #2 b73d5764 in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so [20:43:02] [debug] #3 b73d76b4 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so [20:43:02] [debug] #4 b73db31d in ?? () from plugins/crashdetect.so [20:43:02] [debug] #5 b7742d08 in __kernel_rt_sigreturn () from linux-gate.so.1 [20:43:02] [debug] #6 b7467ec7 in fwrite () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [20:43:02] [debug] #7 b6a5b07e in _ZN15OnFootRecording11writeToFileEPc () from plugins/RNPC.so [20:43:02] [debug] #8 b6a5da68 in _ZN4RNPC8EndBuildEi () from plugins/RNPC.so [20:43:02] [debug] #9 b6a5856a in ?? () from plugins/RNPC.so [20:43:02] [debug] #10 080950e4 in ?? () from ./samp03svr [20:43:02] [debug] #11 b73d64d3 in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so [20:43:02] [debug] #12 0000000e in ?? () from *Зo·HЕo·„¬|„¬|…®|„¬|рЇ|„°|Tp· |
public OnZombieRoam() { for(new npcid = 0; npcid < MAX_ZOMBIES; npcid++) { if(IsPlayerNPC(npcid)) { if(GetRNPCHealth(npcid) > 0) { new victim = GetZombieVictim(npcid), Float, Float:y, Float:z; GetPlayerPos(npcid, x, y, z); if(victim == INVALID_PLAYER_ID) { new pos = random(4); if(pos == 0) { x = x + 100.0; } else if(pos == 1) { x = x - 100.0; } else if(pos == 2) { y = y + 100.0; } else if(pos == 3) { y = y - 100.0; } GetZombieVictimID[npcid] = INVALID_PLAYER_ID; RNPC_SetKeys(0); MoveRNPC(npcid, x, y, z, RNPC_SPEED_WALK, 1); } } } } return 1; } |