Raised This Month: $ Target: $400
 0% 

[Help] Storing name.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 11-30-2014 , 00:58   [Help] Storing name.
Reply With Quote #1

Hello there,
Im storing name in nVault. So What I'm doing is storing name with the key of name. But when there are more than one players in the server and they type /reg to register at that time the name overlaps.

For eg. First player. /reg
He set his name: abc

For eg. Second player. /reg
He set his name: xyz

so when second players wants to know his password he types /showname

it shows xyz for both the users. Please help me out.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <nvault>  
#include <csx> 
#include <fakemeta>
#include <engine>
 

#define PLUGIN "Store Name"
#define VERSION "1.6"
#define AUTHOR "Abhishek"



new g_Vault
new uname[32]


public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//XP Register System 
    
register_clcmd("say /reg","cmdDoRegister")
    
register_clcmd("doRegister","cmdRegister")
    
register_clcmd"say /showname" "cmdShowName" );
    
    
}
public 
plugin_cfg()
{
    
    
g_Vault nvault_open"yourvault" );
}

public 
plugin_end()
{
    
    
nvault_closeg_Vault );
}
public 
client_connect(id)
{
    
get_user_name(id,uname,31)
}


public 
cmdDoRegister(id)
{

            
client_cmd(id,"messagemode doRegister")
}



public 
cmdShowName(id

   

    new 
szKey[40]; 
    new 
szName[255]
    
formatexszKey charsmaxszKey ) , "%s-NAME" uname ); 
    
nvault_getg_Vault szKey szName charsmax(szName) );     
    
    
client_printid print_chat "* Your pass = %s"szName); 
}

public 
cmdRegister(id)
{
        new 
szArgs[255]
        new 
szKey[40]
        
read_args(szArgs,254)
        
remove_quotes(szArgs)
        
server_print("Reg pass : %s ",szArgs)
        
formatexszKey charsmaxszKey ) , "%s-NAME" uname )
        
formatexszArgs charsmaxszArgs ) , "%s" szArgs);
        
nvault_setg_Vault szKey szArgs )
        
        return 
PLUGIN_CONTINUE
    
}


//====================================== End of register System 

Last edited by abhishek_deshkar; 11-30-2014 at 01:00.
abhishek_deshkar is offline
 



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 15:24.


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