Hello
Can someone help me with this?
Code:
L 10/30/2020 - 17:55:12: Start of error session.
L 10/30/2020 - 17:55:12: Not currently in a dynamic native
L 10/30/2020 - 17:55:12: [AMXX] Displaying debug trace (plugin "test.amxx", version "1.0")
L 10/30/2020 - 17:55:12: [AMXX] Run time error 10: native error (native "param_convert")
File: test.inc
Code:
#pragma reqlib "sql"
native sql_connect(const identify[], line)
File: native.sma
Code:
public plugin_natives() {
register_library("sql")
register_native("sql_connect", "native_sql_connect", 1)
}
public native_sql_connect(const identify[], line) {
param_convert(1) // Strings passed byref
// Check db connection
SqlConnection = SQL_Connect(g_SqlTuple, ErrorCode, g_Error, 511)
if(SqlConnection == Empty_Handle)
{ // Check errors
Log_File(identify, line, g_Error, LOG_NAME)
SQL_FreeHandle(SqlConnection)
return -1
}
return 1
}
File: test.sma
Code:
if(sql_connect("test.sma", __LINE__) == 1) {
client_print(0, print_chat, "Successfully connected!")
}