Raised This Month: $12 Target: $400
 3% 

[INC] SQLVault


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-24-2012 , 10:53   Re: [INC] SQLVault
Reply With Quote #111

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
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 07-24-2012 , 13:44   Re: [INC] SQLVault
Reply With Quote #112

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] View Post
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.
EpicMonkey is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-24-2012 , 16:26   Re: [INC] SQLVault
Reply With Quote #113

Quote:
Originally Posted by EpicMonkey View Post
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] View Post
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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 07-26-2012 , 12:32   Re: [INC] SQLVault
Reply With Quote #114

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
EpicMonkey is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-26-2012 , 13:21   Re: [INC] SQLVault
Reply With Quote #115

Quote:
Originally Posted by EpicMonkey View Post
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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 07-26-2012 , 14:18   Re: [INC] SQLVault
Reply With Quote #116

My bad , read that and forgot about it
EpicMonkey is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-22-2012 , 19:00   Re: [INC] SQLVault
Reply With Quote #117

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.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 09-22-2012 at 19:48.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
nikolov
Senior Member
Join Date: Feb 2011
Old 03-23-2013 , 18:05   Re: [INC] SQLVault
Reply With Quote #118

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.
nikolov is offline
Zerko
New Member
Join Date: Jul 2013
Old 12-08-2013 , 08:38   Re: [INC] SQLVault
Reply With Quote #119

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(12 : 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(28 : 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!
Zerko 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 16:56.


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