Register system bugg?
#10

Stop repeatably posting..

Quote:
Originally Posted by Silox
omg, i don't know what you mean
Err, ok. Let me explain while using examples..

Код:
print("Test");
fopen("file.txt", io_read);
print("Test");
That will crash your server, but you don't know why it's not ( lets just pretend ). So you view the code command or whatever when it's crashing and comment the lines and see if the server still crashes.

So, lets test this:
Код:
//print("Test");
fopen("file.txt", io_read);
print("Test");
You commented the first print, this will disable the function from running, but oh no, you server still crashes, so go back to the code and uncomment the function we did comment so it will be back to this:

Код:
print("Test");
fopen("file.txt", io_read);
print("Test");
Now lets comment fopen, it should look like this:

Код:
print("Test");
//fopen("file.txt", io_read);
print("Test");
It solved the server crashing problem! So you now know: fopen("file.txt", io_read); was crashing your server and most likely you will debug that code and break it down or remove it.

Another way of testing it is that you can make print lines before every function.
Like this for an example:

Код:
public OnPlayerConnect(playerid)
{

	GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
    fopen("file.txt", io_read);
	return 1;
}
You can debug it by doing using this as a example:

Код:
public OnPlayerConnect(playerid)
{
    print("This works");
	GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
    fopen("file.txt", io_read);
	return 1;
}
If your server crashes after that, then put it after the next function which is GameTextForPlayer.

Код:
public OnPlayerConnect(playerid)
{

	GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
    print("This works");
    fopen("file.txt", io_read);
	return 1;
}
It's still crashing and the print shows, so then try the next function and so on until you find the crashing functions.

This is the best I can explain the "debug code" method.
Reply


Messages In This Thread
Register system bugg? - by sjvt - 10.03.2010, 20:00
Re: Register system bugg? - by sjvt - 10.03.2010, 20:25
Re: Register system bugg? - by Carlton - 10.03.2010, 20:27
Re: Register system bugg? - by sjvt - 10.03.2010, 20:51
Re: Register system bugg? - by sjvt - 10.03.2010, 20:51
Re: Register system bugg? - by Carlton - 10.03.2010, 20:55
Re: Register system bugg? - by sjvt - 10.03.2010, 20:56
Re: Register system bugg? - by sjvt - 10.03.2010, 20:58
Re: Register system bugg? - by sjvt - 10.03.2010, 21:06
Re: Register system bugg? - by Carlton - 10.03.2010, 21:07

Forum Jump:


Users browsing this thread: 1 Guest(s)