AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [INC] SQLVault (https://forums.alliedmods.net/showthread.php?t=146849)

Exolent[jNr] 07-24-2012 10:53

Re: [INC] SQLVault
 
Here's an example top for SQLVault: Extended.
It is necessary to use extended because you need to save the players' names and whatever you are sorting them by (here will be frags).

Basic plugin structure to use vault:
Spoiler


Now, let's add the top to it:
Spoiler


All together:
Spoiler

EpicMonkey 07-24-2012 13:44

Re: [INC] SQLVault
 
Player names dont show , It only shows when a player changes his name.
PHP Code:

new eTopDataMAX_TOP ][ SQLVaultEntryEx ]; 

^Gives stack error

Quote:

Originally Posted by Exolent[jNr] (Post 1741282)
That is a very large variable. If you see the enum in the include file, the struct for vault entries contains large arrays.

To fix this, make the variable static so it isn't created and destroyed each time, thus always staying in the stack and not causing errors when out of memory.


Exolent[jNr] 07-24-2012 16:26

Re: [INC] SQLVault
 
Quote:

Originally Posted by EpicMonkey (Post 1757325)
Player names dont show , It only shows when a player changes his name.
PHP Code:

new eTopDataMAX_TOP ][ SQLVaultEntryEx ]; 

^Gives stack error

Quote:

Originally Posted by Exolent[jNr] (Post 1741282)
That is a very large variable. If you see the enum in the include file, the struct for vault entries contains large arrays.

To fix this, make the variable static so it isn't created and destroyed each time, thus always staying in the stack and not causing errors when out of memory.


Yeah, I just forgot.

EpicMonkey 07-26-2012 12:32

Re: [INC] SQLVault
 
I tried the top15 above , if i get 11 kills and another player has 2 kills , my rank comes below his.
If i have 15 kills and another player has 2 kills , his rank still comes above mine , its like only 1 is getting counted out of 1 5

Exolent[jNr] 07-26-2012 13:21

Re: [INC] SQLVault
 
Quote:

Originally Posted by EpicMonkey (Post 1758644)
I tried the top15 above , if i get 11 kills and another player has 2 kills , my rank comes below his.
If i have 15 kills and another player has 2 kills , his rank still comes above mine , its like only 1 is getting counted out of 1 5

Ah, yes. Someone else had this problem as well:
https://forums.alliedmods.net/showth...47#post1742147

My solution is in the post after.

EpicMonkey 07-26-2012 14:18

Re: [INC] SQLVault
 
My bad , read that and forgot about it :3

nikhilgupta345 09-22-2012 19:00

Re: [INC] SQLVault
 
For some reason, when using non-local databases, this creates a local database instead using SQLite. I give it all the information for an external database, but it seems to ignore that and make a local one instead.

The part where it's initialized:
PHP Code:

    public SQL_Init()
    {
        
g_hVault sqlv_openg_szHostnameg_szUsernameg_szPasswordg_szDatabaseg_szVaultNamefalse );    
        
sqlv_init_exg_hVault );
    }
    
    public 
plugin_end()
    {
        
sqlv_closeg_hVault );
    } 

EDIT: Nevermind, the database wasn't giving the correct permissions to allow external connections.

nikolov 03-23-2013 18:05

Re: [INC] SQLVault
 
I have tried some examples from this topic..

How can I transfer nvault to sql. Example:
PHP Code:

#include <amxmodx>
#include <nvault>
#include <time>

#define MAX_PLAYERS 32

new g_iVault

new g_szName[MAX_PLAYERS+1][32]
new 
g_iLastPlayedTime[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin("Time""0.1""ConnorMcLeod")
    
register_dictionary("time.txt")

    
g_iVault nvault_open("played_time")
}

public 
plugin_end() nvault_closeg_iVault )
 

public 
client_authorizedid )
{
    new 
szTime[32]
    
get_user_name(idg_szName[id], charsmax(g_szName[]))
    
nvault_get(g_iVaultg_szName[id], szTimecharsmax(szTime))
    
g_iLastPlayedTime[id] = str_to_num(szTime)
}

get_user_total_playtimeid )
{
    return 
g_iLastPlayedTime[id] + get_user_time(id)
}

public 
client_disconnectid )
{
    new 
szTime[32]
    
formatex(szTimecharsmax(szTime), "%d"get_user_total_playtimeid ))
    
nvault_set(g_iVaultg_szName[id], szTime)


I want to get data from played_time.vault in valut folder and this data needs to transfer to site, but how ? I don't want to change save method. I just want to save by nvault, but this data show in site.

Zerko 12-08-2013 08:38

Re: [INC] SQLVault
 
I cant compile any plugin that use sqlvault!
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

D:\kompiler\include\sqlvault.inc(81) : error 017: undefined symbol "TrieCreate"
D:\kompiler\include\sqlvault.inc(81) : warning 213: tag mismatch
D:\kompiler\include\sqlvault.inc(83) : error 017: undefined symbol "TrieSetCell"
D:\kompiler\include\sqlvault.inc(84) : error 017: undefined symbol "TrieSetString"
D:\kompiler\include\sqlvault.inc(92) : error 017: undefined symbol "TrieDestroy"
D:\kompiler\include\sqlvault.inc(207) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault.inc(211) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault.inc(216) : error 017: undefined symbol "TrieDestroy"
D:\kompiler\include\sqlvault.inc(331) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault.inc(340) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault.inc(355) : error 017: undefined symbol "TrieGetString"
D:\kompiler\include\sqlvault.inc(355) : error 088: number of arguments does not match definition
D:\kompiler\include\sqlvault_ex.inc(47) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault_ex.inc(56) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault_ex.inc(71) : error 017: undefined symbol "TrieGetString"
D:\kompiler\include\sqlvault_ex.inc(71) : error 088: number of arguments does not match definition
D:\kompiler\include\sqlvault_ex.inc(128) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault_ex.inc(137) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault_ex.inc(152) : error 017: undefined symbol "TrieGetString"
D:\kompiler\include\sqlvault_ex.inc(152) : error 088: number of arguments does not match definition
D:\kompiler\include\sqlvault_ex.inc(279) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault_ex.inc(288) : error 017: undefined symbol "TrieGetCell"
D:\kompiler\include\sqlvault_ex.inc(303) : error 017: undefined symbol "TrieGetString"
D:\kompiler\include\sqlvault_ex.inc(303) : error 088: number of arguments does not match definition

23 Errors.



Please help!


All times are GMT -4. The time now is 17:11.

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