Raised This Month: $ Target: $400
 0% 

[Help] Storing name.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 11-30-2014 , 12:03   Re: [Help] Storing name.
Reply With Quote #1

Quote:
Originally Posted by Bugsy View Post
Name is not unique to a person, steamid is. Any and every player can use the same name and the plugin will not know who the actual player who registered the name is.
What I actually want to do is I want to store password in nVault. So the password will be the string.

It's a XP plugin. It will store XP, Level and Password. And the key will the name.

If any user connects and if the password is empty then he/she has to log in in order to access the Shop. If he/she is already registered then he/she has to enter password. and then it will be compared with his password. If the entered password is true then he/she can use shop. Now problem is that I'm not able to store the password.
Here is my LoadXp Cod.

PHP Code:
public LoadXp(id)
{
    new 
name[32]
    
get_user_name(id,name,31)
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-XpClasicMod",name)
    
format(vaultdata,255,"%s#%i#%i#%s",name,PlayerXP[id],PlayerLevel[id],PlayerPass[id])
    
nvault_get(g_vault,vaultkey,vaultdata,255)
    
replace_all(vaultdata255"#"" ")
    new 
pname[35] ,playerxp[33], playerlevel[33] , playerpass[512]
    
parse(vaultdatapname,34,playerxp32playerlevel32,playerpass,31)
    
PlayerXP[id] = str_to_num(playerxp)
    
PlayerLevel[id] = str_to_num(playerlevel)
    
copy(PlayerPass[id], charsmax(playerpass),playerpass)
    return 
PLUGIN_CONTINUE

Here is the SaveXp code


PHP Code:
public SaveXp(id)
{

    new 
name[32]
    
get_user_name(id,name,31)
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-XpClasicMod",name)
    
format(vaultdata,255,"%s#%i#%i#%s",name,PlayerXP[id],PlayerLevel[id],PlayerPass[id])
    
nvault_set(g_vault,vaultkey,vaultdata
    
        
    
    
    return 
PLUGIN_CONTINUE

How to do it ? Seriously I'm tired of the nVault. I stuck at this since 15 days. Please help.

Last edited by abhishek_deshkar; 11-30-2014 at 12:07.
abhishek_deshkar is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-30-2014 , 12:51   Re: [Help] Storing name.
Reply With Quote #2

In that case, if you use SteamID, it will make your plugin much simpler and will be less likely to have issues because you no longer need to do anything with passwords.
__________________

Last edited by fysiks; 11-30-2014 at 12:51.
fysiks is offline
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 11-30-2014 , 13:02   Re: [Help] Storing name.
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
In that case, if you use SteamID, it will make your plugin much simpler and will be less likely to have issues because you no longer need to do anything with passwords.
I know that but still looks good Can you please solve the errors ?
abhishek_deshkar is offline
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 11-30-2014 , 21:51   Re: [Help] Storing name.
Reply With Quote #4

Above code.

Last edited by abhishek_deshkar; 12-01-2014 at 12:25. Reason: Updated by bugy.
abhishek_deshkar is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-30-2014 , 22:14   Re: [Help] Storing name.
Reply With Quote #5

There is no good reason to not use SteamID. It will make your implementation much simpler. Use SteamID.
__________________
fysiks is offline
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 12-01-2014 , 04:43   Re: [Help] Storing name.
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
There is no good reason to not use SteamID. It will make your implementation much simpler. Use SteamID.
I know that. But can you fix the above code ?
abhishek_deshkar is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 12-01-2014 , 13:48   Re: [Help] Storing name.
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
There is no good reason to not use SteamID. It will make your implementation much simpler. Use SteamID.
Non-steamers doesn't have SteamID, thats the reason here hehe
Oh also, i made my register system because ... you know ... it is 20% cooler than steamid.
... Also the register system would be useful if you wish that player would have the name the one registered with.

Last edited by .Dare Devil.; 12-01-2014 at 13:52.
.Dare Devil. is offline
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Old 12-01-2014 , 14:19   Re: [Help] Storing name.
Reply With Quote #8

Quote:
Originally Posted by .Dare Devil. View Post
Non-steamers doesn't have SteamID, thats the reason here hehe
Oh also, i made my register system because ... you know ... it is 20% cooler than steamid.
... Also the register system would be useful if you wish that player would have the name the one registered with.
I run steam server lol. It looks cooler
abhishek_deshkar is offline
prinoybullboy
Member
Join Date: Aug 2014
Old 12-28-2014 , 03:36   Re: [Help] Storing name.
Reply With Quote #9

Quote:
Originally Posted by abhishek_deshkar View Post
I run steam server lol. It looks cooler
lol,then use it by steamID?!
prinoybullboy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-01-2014 , 19:26   Re: [Help] Storing name.
Reply With Quote #10

Quote:
Originally Posted by .Dare Devil. View Post
Non-steamers doesn't have SteamID, thats the reason here hehe
Oh also, i made my register system because ... you know ... it is 20% cooler than steamid.
... Also the register system would be useful if you wish that player would have the name the one registered with.
You must think I was born yesterday. . .

Anyways, there is no reason to not use SteamID. If you also want to force a name requirement, fine, but the primary identification method should be by SteamID. No excuses.
__________________
fysiks is offline
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 15:23.


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