22.07.2018, 20:01
Hello!
I have a problem with y_hooks, it says that
This is how my gamemode is now, basically blank
main
connect.pwn
init.pwn
What could be causing this problem? What did I do wrong?
I have a problem with y_hooks, it says that
pawn Код:
(error) symbol already defined: "@yH_OnGameModeInit@003"
main
pawn Код:
#include "a_samp.inc"
#include "YSI_Coding\y_hooks.inc"
#include "a_mysql.inc"
#include "YSI_Coding\y_timers.inc"
#include "modules/core/connect.pwn"
#include "modules/core/init.pwn"
main()
{
}
public OnGameModeInit()
{
return true;
}
pawn Код:
#include "YSI_Coding\y_hooks.inc"
#define SQL_HOST "localhost"
#define SQL_USERNAME "root"
#define SQL_PASSWORD ""
#define SQL_DATABASE "test"
new MySQL:handle;
hook OnGameModeInit()
{
mysql_log(ALL);
handle = mysql_connect(SQL_HOST, SQL_USERNAME, SQL_PASSWORD, SQL_DATABASE); // connect and check for cnnectiviti ->
if(mysql_errno(handle) != 0 || handle == MYSQL_INVALID_HANDLE) // shutdown server if conn not established ->
{
print("[CONNECTION] Mysql connection not established; Shuting down the server!");
SendRconCommand("exit");
return true;
}
return true;
}
pawn Код:
#include "YSI_Coding\y_hooks.inc"
hook OnGameModeInit()
{
SetGameModeText("Test");
return true;
}