Server crashed while executing
#1

When I run a server and a few moments later the server is dead, then I check the server logs appear error of crasdetect.

Code:
[02:34:19] [debug] Server crashed while executing GM.amx
[02:34:19] [debug] AMX backtrace:
[02:34:19] [debug] #0 00000046 in ?? (70, 70, 70, 125, 46, 0, 0, 0, 0, 0, ... <7 arguments>) from GM.amx
[02:34:19] [debug] #1 00000046 in public NewReaction () from GM.amx
NewReaction:
Code:
forward NewReaction();
public NewReaction()
{
	if(ReactionActive == 1)
	{
		return 0;
	}
 	else
  	{
   		new rtString[128];
     	for(new i = 0; i < RrandomEx(10, 12); i++)
      	{
       		strins(Reaction, Characters[random(sizeof Characters)], i);
       	}
        ReactionPrize = (random(10000) + 10000);
        format(rtString, 160, "[REACTION TEST]:{FFFFFF} The first one to type {F81414}%s{FFFFFF} wins {F81414}$%i{FFFFFF} + {F81414}1 Score & 3 EXP{FFFFFF}.", Reaction, ReactionPrize);
        SendClientMessageToAll(COLOR_LIGHTBLUE, rtString);
        ReactionTime = GetTickCount();
        ReactionActive = 1;
        SetTimer("EndReaction", 45000, 0);
	}
	return 1;
}
What is wrong with the code? Please help me to fix this problem, thanks.
Reply
#2

Try this:

Code:
public NewReaction()
{
	if(ReactionActive == 1) return 0;
   	new rtString[128];
     	for(new i = 0; i < RrandomEx(10, 12); i++)
      	{
       		strins(Reaction, Characters[random(sizeof Characters)], i);
       	}
        ReactionPrize = (random(10000) + 10000);
        format(rtString, 160, "[REACTION TEST]:{FFFFFF} The first one to type {F81414}%s{FFFFFF} wins {F81414}$%i{FFFFFF} + {F81414}1 Score & 3 EXP{FFFFFF}.", Reaction, ReactionPrize);
        SendClientMessageToAll(COLOR_LIGHTBLUE, rtString);
        ReactionTime = GetTickCount();
        ReactionActive = 1;
        SetTimer("EndReaction", 45000, 0);
	return 1;
}
Reply
#3

Quote:
Originally Posted by K0P
View Post
Try this:

Code:
public NewReaction()
{
	if(ReactionActive == 1) return 0;
   	new rtString[128];
     	for(new i = 0; i < RrandomEx(10, 12); i++)
      	{
       		strins(Reaction, Characters[random(sizeof Characters)], i);
       	}
        ReactionPrize = (random(10000) + 10000);
        format(rtString, 160, "[REACTION TEST]:{FFFFFF} The first one to type {F81414}%s{FFFFFF} wins {F81414}$%i{FFFFFF} + {F81414}1 Score & 3 EXP{FFFFFF}.", Reaction, ReactionPrize);
        SendClientMessageToAll(COLOR_LIGHTBLUE, rtString);
        ReactionTime = GetTickCount();
        ReactionActive = 1;
        SetTimer("EndReaction", 45000, 0);
	return 1;
}
Thank you for helping, but just the same, the error still appears, any solution?
Reply
#4

Code:
new rtString[128];
format(rtString, 160, "[REACTION TEST]:{FFFFFF} The first one to type {F81414}%s{FFFFFF} wins {F81414}$%i{FFFFFF} + {F81414}1 Score & 3 EXP{FFFFFF}.", Reaction, ReactionPrize);
Not wise formatting a string to a larger size. (Wouldn't be sure it's related)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)