SA-MP Forums Archive
OnFilterScriptInit not initializing properly - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnFilterScriptInit not initializing properly (/showthread.php?tid=658058)



OnFilterScriptInit not initializing properly - GRiMMREAPER - 21.08.2018

I've created a filterscript that's loading properly. However, I want a message to print upon the initialization of said filterscript:

pawn Код:
public OnFilterScriptInit() {
    cursor = mysql_connect(HOST, USER, PASSWORD, DATABASE);
   
    print("Initializing samp-streets.");

    if(mysql_errno(cursor) != 0) {
        printf("samp-streets: Couldn't establish connection to \'%s\'.\nReason: %d | Reference: https://*******/2nU9uiB", DATABASE, mysql_errno(cursor));
        return SendRconCommand("unloadfs samp-streets");
    } else {
        printf("samp-streets: Connection to \'%s\' was established.", DATABASE);
    }

    return 1;
}
The filterscript loads fine:

Код:
Filterscripts
---------------
  Loading filterscript 'street-maker.amx'...
  Loaded 1 filterscripts.
But it does not print the first message in the first print statement. This is the entire code, for reference: hastebin link.

I did check this thread from Marcel: https://sampforum.blast.hk/showthread.php?tid=602193 — no helpful answer was given.


Re: OnFilterScriptInit not initializing properly - Dignity - 21.08.2018

Print something before that mysql line and see if it works then.


Re: OnFilterScriptInit not initializing properly - GRiMMREAPER - 21.08.2018

Quote:
Originally Posted by Dignity
Посмотреть сообщение
Print something before that mysql line and see if it works then.
Printing before or after that MySQL line shouldn't make a difference. Regardless, I did go and double check and no, it does print anything.


Re: OnFilterScriptInit not initializing properly - UFF - 22.08.2018

I have tested the script. and it works fine for me.

Код:
[10:48:02]   Loading filterscript 'test.amx'...
[10:48:03] Initializing samp-streets.
[10:48:03] samp-streets: Couldn't establish connection to 'streets'.
Reason: 1045 | Reference: https://*******/2nU9uiB
[10:48:03]   Filterscript 'samp-streets.amx' unload failed.



Re: OnFilterScriptInit not initializing properly - GRiMMREAPER - 22.08.2018

That's weird. I dos talk to Southclaws about the possibility of this being a sampctl issue but I scrapped that idea since the filterscript was being loaded.