Raised This Month: $32 Target: $400
 8% 

Is there a way to change SQL based plugin to nVault?


Post New Thread Reply   
 
Thread Tools Display Modes
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-02-2022 , 22:06   Re: Is there a way to change SQL based plugin to nVault?
Reply With Quote #11

Quote:
Originally Posted by Alahmoh View Post
i dont want an external database nor webhosting to store my files so i would rather store data on nvault.
but since i know nothing about sql,sqlite i dont know how to change them to nvault.
Can you test this,
Code:
#include <amxmodx> #include <sqlx> #define MYSQL_HOST "" #define MYSQL_USER "" #define MYSQL_PASSWORD "" #define MYSQL_DATABASE "" #define MYSQL_TABLE "" new Handle:MYSQL_CONNECTION /* Id int SteamID var unique Nick var PlayedTime int LastSeen int */ new Id,     SteamID[32],     Nick[32],     PlayedTime,     LastSeen public plugin_init()     register_srvcmd("swap", "swap") public plugin_cfg()     MYSQL_Init() public MYSQL_Init(){     MYSQL_CONNECTION = SQL_MakeDbTuple(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE) } public swap(){     new query[64]     formatex(query, charsmax(query), "SELECT * FROM `%s`", MYSQL_TABLE)     SQL_ThreadQuery(MYSQL_CONNECTION, "DataOutput", query) } public DataOutput(failState, Handle:query, error[], errNum){     if(SQL_NumResults(query)){         while(SQL_MoreResults(query)) {             Id = SQL_ReadResult(query, 0)             SQL_ReadResult(query, 1, SteamID, charsmax(SteamID))             SQL_ReadResult(query, 2, Nick, charsmax(Nick))             PlayedTime = SQL_ReadResult(query, 3)             LastSeen = SQL_ReadResult(query, 4)             server_print("Id!%d SteamID!%s Nick!%s PlayedTime!%d LastSeen!%d", Id, SteamID, Nick, PlayedTime, LastSeen)             SQL_NextRow(query)         }     } }

Last edited by bigdaddy424; 03-02-2022 at 22:08. Reason: d
bigdaddy424 is offline
Reply


Thread Tools
Display Modes

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 11:14.


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