Raised This Month: $ Target: $400
 0% 

nvault problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 10-16-2015 , 01:09   Re: nvault problems
Reply With Quote #1

Quote:
Originally Posted by Bugsy View Post
Is this along the lines of what you're trying to do?
Code:
key="STEAM_0:0:12345"  data="STEAM_0:0:98765 bugsy"
key="STEAM_0:0:98765"  data="STEAM_0:0:12345 bugsys wife"
Yes
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-16-2015 , 18:55   Re: nvault problems
Reply With Quote #2

Quote:
Originally Posted by ironskillz1 View Post
Yes
You should cache the players steamid in a global variable @ client_authorized(). I would also organize the data using an enum, something like the below, for example.
PHP Code:
enum MarriedData
{
    
szSteamID34 ],
    
szSpouseSteamID34 ],
    
szSpouseName33 ]
}
new 
g_mdDataMAX_PLAYERS ][ MarriedData 
I didn't look through your entire plugin, but I can tell that your loading/saving was wrong. Hopefully this solves it.

Untested:
PHP Code:
public UpdateNameid )
{
    new 
szName33 ] , szAuthID34 ] , szBuffer66 ];
    
    
get_user_nameid szName charsmaxszName ) );
    
get_user_authidid szAuthID charsmaxszAuthID ) );
    
    
formatexszBuffer charsmaxszBuffer ) , "%s ^"%s^"" szAuthID szName );
    
nvault_setg_Vault g_iMarriedSteamIDid ] , szBuffer ); 
}

public 
SaveDataid1 id2 )
{
    
//ID1 : KEY=[ID1_STEAMID] DATA=[ID2_STEAMID "ID2_NAME"]
    //ID2 : KEY=[ID2_STEAMID] DATA=[ID1_STEAMID "ID1_NAME"]
    
    
new szName][ 32 ] , szAuthID][ 34 ] , szBuffer66 ];
    
    
get_user_nameid1 szName] , charsmaxszName[] ) );
    
get_user_nameid2 szName] , charsmaxszName[] ) );
    
    
get_user_authidid1 szAuthID] , charsmaxszAuthID[] ) );
    
get_user_authidid2 szAuthID] , charsmaxszAuthID[] ) );
    
    
formatexszBuffer charsmaxszBuffer ) , "%s ^"%s^"" szAuthID] , szName] );
    
nvault_setg_Vault szAuthID] , szBuffer );

    
formatexszBuffer charsmaxszBuffer ) , "%s ^"%s^"" szAuthID] , szName] );
    
nvault_setg_Vault szAuthID] , szBuffer );
}

public 
LoadDataid )
{
    new 
szAuthID34 ] , szBuffer66 ] , iTS;
    
    
get_user_authidid szAuthID charsmaxszAuthID ) );
    
    if ( 
nvault_lookupg_Vault szAuthID szBuffer charsmaxszBuffer ) , iTS ) )
    {
        
parseszBuffer g_iMarriedSteamIDid ] , charsmaxg_iMarriedSteamID[] ) , g_iMarriedNameid ] , charsmaxg_iMarriedName[] ) );
    }
    

__________________

Last edited by Bugsy; 10-17-2015 at 12:23.
Bugsy is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 10-17-2015 , 09:26   Re: nvault problems
Reply With Quote #3

Thanks a lot man. I really appreciate that you have spent time fixing this for me. I will return with the results if it worked or not
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Reply



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 18:10.


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