OnGameModeInit is runing multiple times
#1

Hey guys. I'm using Linux CentOS 5.6 and when 4/5 players join my server, my OnGameModeInit runs multiple times. Any ides what might cause this?
Reply
#2

Are you calling OnGameModeInit at any point?

For example:

pawn Код:
public OnPlayerConnect(playerid) { OnGameModeInit(); }
Reply
#3

No, I don't.
Reply
#4

My dedicated server runs on CentOS and I don't have any problems with strange things being called. Could you show your OnGameModeInit code? (I have an idea but it's a really really long shot)
Reply
#5

Can you tell me your idea? Cause my OnGameModeInit callback is pretty long.
Reply
#6

After further investigation of my "idea" - It turns out that wouldn't actually be an issue.

As a temporary fix though, do something like this:

pawn Код:
new bool:OGM=false;

public OnGameModeInit()
{
     if(OGM == true) return; //if it equals true, it has already been called and should not continue past this line
     OGM = true; //If the above if statement was false, this and the code below it will be executed - making "OGM" true, will cause the if statement above to become true, and thus, the OnGameModeInit callback will not be called again.
}
Reply
#7

I already did that. And I really can't figure out what's happening, dude.
Reply
#8

Does it seem to be getting called at a regular interval? Every 10 seconds, for example. Or, is generally random?
Reply
#9

Nope. When 4/5 players enter the server, OnGameModeInit just gets called multiple times.
Reply
#10

This may be a long shot, but try re-uploading samp03svr (The server executable file)

It could be slightly corrupt(?)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)