Posts: 91
Threads: 48
Joined: Feb 2013
So i have this issue that a random time when playing on my GM, it suddenly shuts down the server with no errors what so ever. The Console just pops down and i need to restart it :S Please do anyone know how to fix this issue?
EDIT #1
This is a code i saw that i get when the server shuts down?
Код:
[20:40:20] [debug] Server crashed while executing NRG.amx
[20:40:20] [debug] AMX backtrace:
[20:40:20] [debug] #0 native fread () [004057a0] from samp-server.exe
[20:40:20] [debug] #1 001ea2b0 in ?? () from NRG.amx
[20:40:20] [debug] #2 004972d0 in public ServerHeartbeat () from NRG.amx
[20:40:20] [debug] System backtrace:
[20:40:21] [debug] #0 00492860 in ?? () from C:\Users\Kevin\Desktop\NRG\samp-server.exe
[20:40:21] [debug] #1 00492e90 in ?? () from C:\Users\Kevin\Desktop\NRG\samp-server.exe
[20:40:21] [debug] #2 00404f44 in ?? () from C:\Users\Kevin\Desktop\NRG\samp-server.exe
Posts: 65
Threads: 3
Joined: Jun 2011
Reputation:
0
It must be something in your script, try narrowing it down.
What did you do when it crashed? Is it after a certain amount of time? Is it after it loads vehicles?
Ask yourself these questions, unless you narrow it down it'll be hard to help
Posts: 91
Threads: 48
Joined: Feb 2013
Quote:
Originally Posted by DrDoom151
It must be something in your script, try narrowing it down.
What did you do when it crashed? Is it after a certain amount of time? Is it after it loads vehicles?
Ask yourself these questions, unless you narrow it down it'll be hard to help
|
Its after nearly One hour of playing on the gamemode :/
Posts: 65
Threads: 3
Joined: Jun 2011
Reputation:
0
What does the ServerHeartbeat function do? That seems to be crashing it.
Posts: 91
Threads: 48
Joined: Feb 2013
Quote:
Originally Posted by DrDoom151
What does the ServerHeartbeat function do? That seems to be crashing it.
|
Honestly i have no idea as my friend got this script from someone and he sended it to me :/
Posts: 65
Threads: 3
Joined: Jun 2011
Reputation:
0
Try thoroughly reading it to understand what it does exactly, because that's probably where your problem's located
Posts: 91
Threads: 48
Joined: Feb 2013
I think it must be this coding as it crashes when reciving the paycheck...
Код:
if(playerTabbed[i] == 0) {
switch(PlayerInfo[i][pLevel]) {
case 0 .. 2: PlayerInfo[i][pPayCheck] += 1;
case 3 .. 4: PlayerInfo[i][pPayCheck] += 2;
case 5 .. 6: PlayerInfo[i][pPayCheck] += 3;
case 7 .. 8: PlayerInfo[i][pPayCheck] += 4;
case 9 .. 10: PlayerInfo[i][pPayCheck] += 5;
case 11 .. 12: PlayerInfo[i][pPayCheck] += 6;
case 13 .. 14: PlayerInfo[i][pPayCheck] += 7;
case 15 .. 16: PlayerInfo[i][pPayCheck] += 8;
case 17 .. 18: PlayerInfo[i][pPayCheck] += 9;
case 19 .. 20: PlayerInfo[i][pPayCheck] += 10;
default: PlayerInfo[i][pPayCheck] += 11;
}
if(++PlayerInfo[i][pConnectSeconds] >= 3600) {
PayDay(i);
}
}
Posts: 91
Threads: 48
Joined: Feb 2013
Now i got some errors after adding the prints
Код:
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100607) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100607) : warning 215: expression has no effect
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100608) : error 014: invalid statement; not in switch
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100608) : warning 215: expression has no effect
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100608) : error 001: expected token: ";", but found ".."
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100608) : error 029: invalid expression, assumed zero
C:\Users\Kevin\Desktop\NRG\gamemodes\NRG.pwn(100608) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Posts: 65
Threads: 3
Joined: Jun 2011
Reputation:
0
I take it 100607 and 100608 are print 3? Just remove the ones it won't allow.