Raised This Month: $ Target: $400
 0% 

Natives help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PredatorBlock
AlliedModders Donor
Join Date: Apr 2020
Old 10-30-2020 , 14:03   Natives help
Reply With Quote #1

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!") }

Last edited by PredatorBlock; 10-30-2020 at 14:47.
PredatorBlock is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode