AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Natives help (https://forums.alliedmods.net/showthread.php?t=328196)

PredatorBlock 10-30-2020 14:03

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

loiraolhosazul 10-30-2020 16:34

Re: Natives help
 
Check this: https://forums.alliedmods.net/showthread.php?t=41251

PredatorBlock 10-31-2020 11:26

Re: Natives help
 
Quote:

Originally Posted by loiraolhosazul (Post 2723163)

Fixed, thank you.

JocAnis 10-31-2020 11:35

Re: Natives help
 
who's mysql data you want to get ? ;o

PredatorBlock 10-31-2020 19:57

Re: Natives help
 
Code:
new const menu3_adm_langs[][] = { "MENU_ADMIN31", "MENU_ADMIN32", "MENU_ADMIN33", "MENU_ADMIN34", "MENU_ADMIN35",  "MENU_ADMIN36", "MENU_ADMIN37" , "MENU_ADMIN37" , "MENU_ADMIN37" , "MENU_ADMIN37" , "MENU_ADMIN37" , "MENU_ADMIN37" }

How i can retrieve a total of number from a constant?

eg: Total = 12

Thanks.

CrazY. 11-01-2020 07:03

Re: Natives help
 
sizeof menu3_adm_langs

PredatorBlock 11-01-2020 07:20

Re: Natives help
 
Quote:

Originally Posted by CrazY. (Post 2723303)
sizeof menu3_adm_langs

Thank you, i appreciate.


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

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