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

How to load data from nvault on every spawn?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 09-27-2017 , 01:26   How to load data from nvault on every spawn?
Reply With Quote #1

As the heading suggests i want to load nvault data on player spawn
but there is a catch i want to save it only if a player selects it on the menu where there are three options, and those are -
1. New Weapons
2. Previous Weapons
3. Save and Don't ask again

For previous menu i made a public load_user_weapons(id).
But need help on how to make it for 3rd option.
and i want it to be compatible with multiple players spawns in a single round,so data needs to be loaded on every spawn.

Here is the code:-

Spoiler
__________________
And I Am Back.

Last edited by TheSpaniard; 09-27-2017 at 01:28. Reason: Typo's
TheSpaniard is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 09-27-2017 , 06:25   Re: How to load data from nvault on every spawn?
Reply With Quote #2

As I said in your another thread you don't need to save this in nVault. Later I will give you code.

Here is the code: (Read the comments)
Spoiler

Test and tell me if everything is okay.

Last edited by KiLLeR.; 10-01-2017 at 08:38.
KiLLeR. is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 09-29-2017 , 11:03   Re: How to load data from nvault on every spawn?
Reply With Quote #3

Quote:
Originally Posted by KiLLeR. View Post
As I said in your another thread you don't need to save this in nVault. Later I will give you code.

//set_pdata_int(id, m_fHasPrimary, 0); // I'm not sure why did you use this?! Do you even know what it does?!

Test and tell me if everything is okay.
You did it i didnt do it.

Previous weapons option works but save options doesn't work, i think you forgot to add option to enable guns menu again after saving.
__________________
And I Am Back.

Last edited by TheSpaniard; 09-29-2017 at 11:15.
TheSpaniard is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 09-30-2017 , 12:37   Re: How to load data from nvault on every spawn?
Reply With Quote #4

Quote:
Originally Posted by TheSpaniard View Post
You did it i didnt do it.
What do you mean!?

Quote:
Originally Posted by TheSpaniard View Post
Previous weapons option works but save options doesn't work, i think you forgot to add option to enable guns menu again after saving.
What do you mean by save options doesn't work?! Because when you press that options you will recieve last selected equipment on every spawn and the menu won't show up anymore. (Or at least that's what I understand by saving your equipiment, and also that's how work in CSDM).

Last edited by KiLLeR.; 09-30-2017 at 12:40.
KiLLeR. is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-01-2017 , 00:32   Re: How to load data from nvault on every spawn?
Reply With Quote #5

Quote:
Originally Posted by KiLLeR. View Post
What do you mean!?
I mean the line you commented out is added by you, and you were right i don't even know whatever that means.


Quote:
Originally Posted by KiLLeR. View Post
What do you mean by save options doesn't work?! Because when you press that options you will receive last selected equipment on every spawn and the menu won't show up anymore. (Or at least that's what I understand by saving your equipment, and also that's how work in CSDM).
The save option doesn't work when first selected after second spawn however it starts to work and after further use i spotted that the previous weapons option gives primary weapons but it doesn't give secondary weapon everything else is working fine thanks to you.
__________________
And I Am Back.
TheSpaniard is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 10-01-2017 , 08:17   Re: How to load data from nvault on every spawn?
Reply With Quote #6

Quote:
Originally Posted by TheSpaniard View Post
I mean the line you commented out is added by you, and you were right i don't even know whatever that means.
It was added by you, look at the code that you have given in first post... I only added constant with proper name instead of just some number because that's correct.

Quote:
Originally Posted by TheSpaniard View Post
The save option doesn't work when first selected after second spawn however it starts to work and after further use i spotted that the previous weapons option gives primary weapons but it doesn't give secondary weapon everything else is working fine thanks to you.
I will test it. Hold on...
Here is the fixed version:
Spoiler

Last edited by KiLLeR.; 10-01-2017 at 08:38.
KiLLeR. is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-01-2017 , 08:20   Re: How to load data from nvault on every spawn?
Reply With Quote #7

Quote:
Originally Posted by KiLLeR. View Post
It was added by you, look at the code that you have given in first post... I only added constant with proper name instead of just some number because that's correct.
First code is also given by you look in the other thread where i asked the same question.
and you forgot the command to reenable the menu after selecting the save option.
like
say /guns to display the menu again
__________________
And I Am Back.

Last edited by TheSpaniard; 10-01-2017 at 08:27.
TheSpaniard is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 10-01-2017 , 08:42   Re: How to load data from nvault on every spawn?
Reply With Quote #8

Quote:
Originally Posted by TheSpaniard View Post
First code is also given by you look in the other thread where i asked the same question.
and you forgot the command to reenable the menu after selecting the save option.
like
say /guns to display the menu again
Look the above post, I have fixed the problem and added command to re-enable the menu.
Also look at this: https://imgur.com/a/x2xLe, this is your first code before my posts in the another thread. So it wasn't added by me.... Anyway I have removed it from the fixed version (above).

Last edited by KiLLeR.; 10-01-2017 at 08:44.
KiLLeR. 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 00:06.


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