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

How to save in nvault?


Post New Thread Reply   
 
Thread Tools Display Modes
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-26-2016 , 18:20   Re: How to save in nvault?
Reply With Quote #31

Quote:
Today , 06:16 PM Re: How to save in nvault?
So, bugsy .. we have the same timing! )
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Gasior
Member
Join Date: Mar 2012
Old 11-26-2016 , 18:34   Re: How to save in nvault?
Reply With Quote #32

Code:
L 11/27/2016 - 00:32:36: [modelemenu.amxx] SETTING MODEL INDEX=0 TEAM INDEX=1
L 11/27/2016 - 00:32:38: [modelemenu.amxx] SETTING MODEL INDEX=3 TEAM INDEX=1
L 11/27/2016 - 00:32:40: [modelemenu.amxx] SETTING MODEL INDEX=3 TEAM INDEX=1
L 11/27/2016 - 00:32:41: [modelemenu.amxx] SETTING MODEL INDEX=2 TEAM INDEX=1
L 11/27/2016 - 00:32:43: [modelemenu.amxx] SETTING MODEL INDEX=1 TEAM INDEX=1
L 11/27/2016 - 00:32:45: [modelemenu.amxx] SETTING MODEL INDEX=0 TEAM INDEX=1
L 11/27/2016 - 00:32:51: [modelemenu.amxx] SETTING MODEL INDEX=0 TEAM INDEX=0
L 11/27/2016 - 00:32:56: [modelemenu.amxx] SETTING MODEL INDEX=0 TEAM INDEX=0
L 11/27/2016 - 00:33:00: [modelemenu.amxx] SETTING MODEL INDEX=3 TEAM INDEX=0
L 11/27/2016 - 00:33:03: [modelemenu.amxx] SETTING MODEL INDEX=0 TEAM INDEX=0
L 11/27/2016 - 00:33:04: [modelemenu.amxx] SETTING MODEL INDEX=1 TEAM INDEX=0
L 11/27/2016 - 00:33:06: [modelemenu.amxx] SETTING MODEL INDEX=2 TEAM INDEX=0
I deleted the vault data and errors stop coming. You are right, index doesn't go further than 3. Great!
Gasior is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2016 , 18:38   Re: How to save in nvault?
Reply With Quote #33

Good news. Delete that log_amx() line since it no longer serves a purpose and so it won't clog up your log. You should also use the LoadData() function from the original code here
__________________

Last edited by Bugsy; 11-26-2016 at 18:39.
Bugsy is offline
Gasior
Member
Join Date: Mar 2012
Old 11-26-2016 , 18:46   Re: How to save in nvault?
Reply With Quote #34

However! I have noticed something so:

I picked a model, it stays there cool.

I reconnect it is still there straight away. I reconnect one more time, model is gone. It loads in after 10-15 secs. I don't mind it, but is that's just how frequently it reloads data or why does it happen like this?
Gasior is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2016 , 18:47   Re: How to save in nvault?
Reply With Quote #35

Quote:
Originally Posted by Gasior View Post
However! I have noticed something so:

I picked a model, it stays there cool.

I reconnect it is still there straight away. I reconnect one more time, model is gone. It loads in after 10-15 secs. I don't mind it, but is that's just how frequently it reloads data or why does it happen like this?
The data is stored in vault under the users steam id which is typically retrieved upon a user connecting, but I suppose there could be a delay.
__________________
Bugsy is offline
Gasior
Member
Join Date: Mar 2012
Old 11-26-2016 , 18:57   Re: How to save in nvault?
Reply With Quote #36

Cool! Thank you once again!
Gasior is offline
Gasior
Member
Join Date: Mar 2012
Old 11-27-2016 , 21:48   Re: How to save in nvault?
Reply With Quote #37

It's me, it's me your G A S I O R.

So I have two plugins one the one you helped me with and second one is a knife menu, which is pretty much the same just knife menu has 4 skins for all players and 2 premium. Regardless, data from those two plugins mixes up. I set up for instance /noze and skin 6 then I go on and set up /modele skin 3. When I reconnect both /modele and /noze have skin 3 as a choice.

Now the vaults should be entirely different but when I go to data/vault I have just g_Model.vault .

I couldn't get that figured so I copied the whole vault code from /modele and changed only particular bits to adress the /noze but it still mixes up data. How do I go about it?

SMA of /noze
Spoiler


Does it actually saves data? And why does it read from /modele? Also here's sma for /modele if you need it
Spoiler
Gasior is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-27-2016 , 23:28   Re: How to save in nvault?
Reply With Quote #38

Quote:
Originally Posted by Gasior View Post
It's me, it's me your G A S I O R.

So I have two plugins one the one you helped me with and second one is a knife menu, which is pretty much the same just knife menu has 4 skins for all players and 2 premium. Regardless, data from those two plugins mixes up. I set up for instance /noze and skin 6 then I go on and set up /modele skin 3. When I reconnect both /modele and /noze have skin 3 as a choice.

Now the vaults should be entirely different but when I go to data/vault I have just g_Model.vault .

I couldn't get that figured so I copied the whole vault code from /modele and changed only particular bits to adress the /noze but it still mixes up data. How do I go about it?

SMA of /noze

Does it actually saves data? And why does it read from /modele? Also here's sma for /modele if you need it
In one of my previous posts I mentioned that I was assuming no other data was being saved within the same vault under the steam id. Since this actually is the case, you have to make the key unique for each data item being saved. For knives, I added a _knife suffix to the key. I also fixed/redid some of your code.

Untested
Spoiler
__________________
Bugsy is offline
Gasior
Member
Join Date: Mar 2012
Old 12-28-2016 , 12:26   Re: How to save in nvault?
Reply With Quote #39

Hi again!

Everything is working almost just fine, well except this

Quote:
L 12/28/2016 - 15:42:16: Info (map "de_nuke") (file "addons/amxmodx/logs/error_20161228.log")
L 12/28/2016 - 15:42:16: [CSTRIKE] Invalid player 13
L 12/28/2016 - 15:42:16: [AMXX] Displaying debug trace (plugin "modelemenu.amxx")
L 12/28/2016 - 15:42:16: [AMXX] Run time error 10: native error (native "cs_reset_user_model")
L 12/28/2016 - 15:42:16: [AMXX] [0] modelemenu.sma::resetModel (line 152)
L 12/28/2016 - 17:287: Start of error session.
L 12/28/2016 - 17:287: Info (map "de_train") (file "addons/amxmodx/logs/error_20161228.log")
L 12/28/2016 - 17:287: [CSTRIKE] Invalid player 1
L 12/28/2016 - 17:287: [AMXX] Displaying debug trace (plugin "modelemenu.amxx")
L 12/28/2016 - 17:287: [AMXX] Run time error 10: native error (native "cs_reset_user_model")
L 12/28/2016 - 17:287: [AMXX] [0] modelemenu.sma::resetModel (line 152)
Also, I have a random VIP plugin, which means that a person will randomly get VIP and be able to choose model and knife VIP but on next map he will only be a player. Unfortunately, what happens is that sometimes randomly players will have VIP models on both plugins.

Is there a way we could prevent that?

Also I was trying to add option 6. Show Models displaying modele.txt from cstrike folder.

I was trying myself to fix that but when I play with menu more error displays or doesn't work at all.

How do I go about it?


/modele - Selection of models for VIP only
Spoiler


/noze - Knife selection + options 5&6 for VIP.

Spoiler
Gasior is offline
Gasior
Member
Join Date: Mar 2012
Old 12-30-2016 , 02:28   Re: How to save in nvault?
Reply With Quote #40

Okay, I handled it .

What I did I changed this:
Code:
public client_authorized( id ) 
{
    get_user_authid( id , g_szAuthID[ id ] , charsmax( g_szAuthID[] ) );
    
    g_Model[ id ] = NoModelSet;
    
    LoadData( id );
}
to this:
Code:
public client_authorized( id ) 
{
    if ( ! ( get_user_flags( id ) & ADMIN_LEVEL_H ) )
    {
	g_Model[id] = NoModelSet;
	return PLUGIN_HANDLED;
    }

    else
    {
    get_user_authid( id , g_szAuthID[ id ] , charsmax( g_szAuthID[] ) );
    
    g_Model[ id ] = NoModelSet;
    
    LoadData( id );
    }
    return PLUGIN_CONTINUE;
}
It works perfectly fine because on my server on one map you will have VIP on the next one you won't.

Now I also have a plugin, which is only for a player with a SID, I keep changing it every month depending who is the leader of the rank. The plugin gives special model per team as well as tag [LIDER] in the chat. It works fine on its own but when this plugin and /modele is on, of course it isn't working. I try to merge them both and it is taking so much time of mine and frustration anyone has any idea what's the simplest way to do it? Here's lider.amxx
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
        register_plugin("Model Lidera", "1.0", "Gasior")
        register_event("ResetHUD", "resetModel", "b")
        register_message(get_user_msgid("SayText"),"handleSayText");
        return PLUGIN_CONTINUE
}

public plugin_precache() {
        precache_model("models/player/nowyc/nowyc.mdl")
        precache_model("models/player/nowyt/nowyt.mdl")

        return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
	new szAuthID[33];
	get_user_authid(id,szAuthID,32);
            
	if(equali(szAuthID,"STEAM_X;X")){
		if (cs_get_user_team(id) == CS_TEAM_T) {
                        cs_set_user_model(id, "nowyt")
                }
		else if(cs_get_user_team(id) == CS_TEAM_CT) {
                        cs_set_user_model(id, "nowyc")
                }
        }
	return PLUGIN_CONTINUE
}

public handleSayText(msgId, msgDest, msgEnt){
	new id = get_msg_arg_int(1);
	new szAuthID[33];
	get_user_authid(id,szAuthID,32);
         
	if(equali(szAuthID,"STEAM_X:X")){
		new szTmp[256],
			szTmp2[256];
			
		get_msg_arg_string(2, szTmp, charsmax(szTmp));
		
		new szPrefix[64] = "^x04[LIDER]";
		
		if(!equal(szTmp, "#Cstrike_Chat_All")){
			add(szTmp2, charsmax(szTmp2), szPrefix);
			add(szTmp2, charsmax(szTmp2), " ");
			add(szTmp2, charsmax(szTmp2), szTmp);
		}
		else{
			add(szTmp2, charsmax(szTmp2), szPrefix);
			add(szTmp2, charsmax(szTmp2), "^x03 %s1^x01 :  %s2");
		}
		set_msg_arg_string(2, szTmp2);
	}
	return PLUGIN_CONTINUE;
}
Gasior 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 04:25.


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