31.05.2016, 23:11
Hi there,
I'm having some issues with including some of my own files here. For some reason, after the first file is included (OnGameModeInit), the other files aren't included. I've tried deleting the OnGameModeInit include, and then the rest load fine. However, placing OnGameModeInit include back in, the error happens again. The code for calling in my includes are here:
The code inside the OnGameModeInit include is as follows:
This is my first time I've tried coding in PAWN making use of splitting my code up into includes, so I suspect I'm doing something stupidly wrong here. Any suggestions would be welcome.
Many thanks.
I'm having some issues with including some of my own files here. For some reason, after the first file is included (OnGameModeInit), the other files aren't included. I've tried deleting the OnGameModeInit include, and then the rest load fine. However, placing OnGameModeInit include back in, the error happens again. The code for calling in my includes are here:
Код:
#include "../include/callbacks/OnGameModeInit.pwn" // OnGameModeInit #include "../include/callbacks/OnGameModeExit.pwn" // OnGameModeExit #include "../include/callbacks/OnPlayerRequestClass.pwn" // OnPlayerRequestClass #include "../include/callbacks/OnPlayerConnect.pwn" // OnPlayerConnect #include "../include/callbacks/OnPlayerDisconnect.pwn" // OnPlayerDisconnect #include "../include/callbacks/OnPlayerSpawn.pwn" // OnPlayerSpawn #include "../include/callbacks/OnPlayerDeath.pwn" // OnPlayerDeath #include "../include/callbacks/OnVehicleSpawn.pwn" // OnVehicleSpawn #include "../include/callbacks/OnVehicleDeath.pwn" // OnVehicleDeath #include "../include/callbacks/OnPlayerText.pwn" // OnPlayerText #include "../include/callbacks/OnPlayerCommandText.pwn" // OnPlayerCommandText #include "../include/callbacks/OnPlayerEnterVehicle.pwn" // OnPlayerEnterVehicle #include "../include/callbacks/OnPlayerExitVehicle.pwn" // OnPlayerExitVehicle #include "../include/callbacks/OnPlayerStateChange.pwn" // OnPlayerStateChange #include "../include/callbacks/OnPlayerEnterCheckpoint.pwn" // OnPlayerEnterCheckpoint #include "../include/callbacks/OnPlayerLeaveCheckpoint.pwn" // OnPlayerLeaveCheckpoint #include "../include/callbacks/OnPlayerEnterRaceCheckpoint.pwn" // OnPlayerEnterRaceCheckpoint #include "../include/callbacks/OnPlayerEnterLeaveCheckpoint.pwn" // OnPlayerEnterLeaveCheckpoint #include "../include/callbacks/OnRconCommand.pwn" // OnRconCommand #include "../include/callbacks/OnPlayerRequestSpawn.pwn" // OnPlayerRequestSpawn #include "../include/callbacks/OnObjectMoved.pwn" // OnObjectMoved #include "../include/callbacks/OnPlayerObjectMoved.pwn" // OnPlayerObjectMoved #include "../include/callbacks/OnPlayerPickUpPickup.pwn" // OnPlayerPickUpPickup #include "../include/callbacks/OnVehicleMod.pwn" // OnVehicleMod #include "../include/callbacks/OnVehicleRespray.pwn" // OnVehicleRespray #include "../include/callbacks/OnVehiclePaintjob.pwn" // OnVehiclePaintjob #include "../include/callbacks/OnPlayerSelectedMenuRow.pwn" // OnPlayerSelectedMenuRow #include "../include/callbacks/OnPlayerExitedMenu.pwn" // OnPlayerExitedMenu #include "../include/callbacks/OnPlayerInteriorChange.pwn" // OnPlayerInteriorChange #include "../include/callbacks/OnPlayerKeyStateChange.pwn" // OnPlayerKeyStateChange #include "../include/callbacks/OnRconLoginAttempt.pwn" // OnRconLoginAttempt #include "../include/callbacks/OnPlayerUpdate.pwn" // OnPlayerUpdate #include "../include/callbacks/OnPlayerStreamIn.pwn" // OnPlayerStreamIn #include "../include/callbacks/OnPlayerStreamOut.pwn" // OnPlayerStreamOut #include "../include/callbacks/OnVehicleStreamIn.pwn" // OnVehicleStreamIn #include "../include/callbacks/OnVehicleStreamOut.pwn" // OnVehicleStreamOut #include "../include/callbacks/OnDialogResponse.pwn" // OnDialogResponse #include "../include/callbacks/OnPlayerClickPlayer.pwn" // OnPlayerClickPlayer
Код:
new MySQL:connection; public OnGameModeInit(){ SetGameModeText(GAMEMODE); //Connect to MySQL Database connection = mysql_connect(DB_HOST, DB_USER, DB_NAME, DB_PASS); if(mysql_errno(connection) == 0){ print("Successfully connected to MySQL Database!"); }else{ print("Failed connection to MySQL Database!"); } return 1; }
Many thanks.