MySQL connecting twice
#1

Have an issue with MySQL Connecting twice, this means it loads two sets of each vehicles up, etc

pawn Код:
ManualVehicleEngineAndLights();
    ShowPlayerMarkers(0);
    EnableStuntBonusForAll(0);
    DisableInteriorEnterExits();
    SetGameModeText(SCRIPT_VERSION);
    new string[128];
    format(string, sizeof(string), "hostname %s", Hostname);
    SendRconCommand(string);
    mysql_log(LOG_ALL);
    mysql = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
    if(mysql_errno() != 0)
    {
        printf("[MySQL] The connection has failed.");
    }
    else
    {
        printf("[MySQL] The connection was successful.");
    }
    mysql_tquery(mysql, "SELECT * FROM `vehicles` ORDER BY ID ASC", "LoadVehicles");
    return true;
Reply
#2

Still need help,
Shows the successful message twice and spawns two lots of vehicles from a table.
Reply
#3

Quote:
Originally Posted by theonethatownz
Посмотреть сообщение
Still need help,
Shows the successful message twice and spawns two lots of vehicles from a table.
Do you have this in your script?

Код:
main(){}
Somehow the main function cannot be packed into one line, that makes OnGameModeInit call 2 times.
Put the brackets in a new line and a space between them, if that is the case.
Else I don't know what it could be, eventually a bad hook.
Reply
#4

Yes, its one line. Ill do it like
pawn Код:
main()
{
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)