OnGameModeInit error
#1

Hello people.

I wanted to move my server to a Windows Root Server and somehow the script is not working anymore.

I moved everything onto the server, like I would do it from one pc to the other one aswell. But the script stops loading when it has to load the textdraws.

pawn Код:
TeleportTD2 = TextDrawCreate(8.000000,310.000000, "_");
    TextDrawAlignment(TeleportTD2, 1);
    TextDrawLetterSize(TeleportTD2, 0.199999,1.000000);
    TextDrawSetShadow(TeleportTD2, 0);
    TextDrawSetProportional(TeleportTD2, 1);
    TextDrawFont(TeleportTD2, 1);
    TextDrawShowForAll(TeleportTD2); //here it cancels to load
    TextDrawSetShadow(TeleportTD2, 1);
    TextDrawSetOutline(TeleportTD2,1);
    TextDrawBackgroundColor(TeleportTD2,0x000000ff);
I set prints between every line and found out that the server stops loading at the commented line. It stops on every textdraw at TextDrawShowForAll. I didn't change anything in the script, I just moved the server folder to the root server and tried to start. I also tried to replace the plugin files and had no success.

I also loaded the crashdetect.dll and got this:

Quote:

[12:10:39] [debug] Run time error 4: "Array index out of bounds"
[12:10:39] [debug] Attempted to read/write array element at index 50 in array of size 50
[12:10:39] [debug] AMX backtrace:
[12:10:39] [debug] #0 0001a4a4 in ?? (0) from Eagles10.amx
[12:10:39] [debug] #1 0013c8ac in ?? () from Eagles10.amx
[12:10:39] [debug] #2 0000bddc in public Itter_OnGameModeInit () from Eagles10.amx
[12:10:39] [debug] #3 native CallLocalFunction () from samp-server.exe
[12:10:39] [debug] #4 00006d68 in public ScriptInit_OnGameModeInit () from Eagles10.amx
[12:10:39] [debug] #5 00005cec in public zcmd_OnGameModeInit () from Eagles10.amx
[12:10:39] [debug] #6 native CallLocalFunction () from samp-server.exe
[12:10:39] [debug] #7 00004d94 in public OnGameModeInit () from Eagles10.amx

And as I already said it happens on TextDrawShowForAll at every textdraw. It just quits loading what means, that everything above that line has been loaded, but everything else that would come after that in OnGameModeInit like loading bots, objects and so on doesn't get loaded and the server isn't playable.

Does anyone have an idea?
Reply
#2

Remove the line and see what happens.
After all, during OnGameModeInit, nobody is connected to your server anyway (the server is still starting up and nobody is even able to connect at this time), so why show it to all players in the first place?

Use this under OnPlayerconnect:

PHP код:
TextDrawShowForPlayer(playeridTeleportTD2); 
And this under OnPlayerDisconnect:
PHP код:
TextDrawHideForPlayer(playeridTeleportTD2); 
Also, you already had a problem if it worked anyways, because
PHP код:
TextDrawSetShadow(TeleportTD21);
TextDrawSetOutline(TeleportTD2,1);
TextDrawBackgroundColor(TeleportTD2,0x000000ff); 
Should be above the TextDrawShowForAll, because adjusting the outline and shadow requires you to show it again to make the changes visible (see the comments in the wiki):
https://sampwiki.blast.hk/wiki/TextDrawSetShadow
https://sampwiki.blast.hk/wiki/TextDrawSetOutline

Besides these issues, you have an array-out-of-bounds error in your log, and no array is being accessed here, so the problem must be somewhere else.
Reply
#3

Ok, to use TextDrawShowForPlayer instead of ForAll worked. No idea how I got the idea to do it this way, but anyway it worked in the past

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)