OnFilterScriptInit not initializing properly
#1

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.
Reply
#2

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

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.
Reply
#4

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)