Raised This Month: $342 Target: $400
 85%   Almost there!

nVault Tutorial


Post New Thread Reply   
 
Thread Tools Display Modes
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-09-2020 , 16:57   Re: nVault Tutorial
Reply With Quote #111

Quote:
Originally Posted by Bugsy View Post
Your savedata and loaddata look good, though you can just do: iMoney[id] = nvault_get(iVault, szAuth )
So what i want to do it this ?
PHP Code:

new szAuth[MAX_PLAYERS+1][35// Set userid in global var

public ResetBank(id)
{
    if (!
is_user_connected(id))
        return 
PLUGIN_HANDLED;

    if (
access(idFLAGS_RESET_BANK))
    {
        
iMoney[id] = nvault_get(iVaultszAuth[id] )
            
nvault_remove(iVaultszAuth[id]);
   
        
get_user_nameidszAdminNamecharsmax(szAdminName))
        
get_user_authid(idszPlayerIDcharsmax(szPlayerID));
        
        
console_print(id"[ADMIN] %s Reset Bank"szAdminName)
        
Log("[RESETMONEY] Admin: %s || SteamID: %s Reset Bank"szAdminNameszPlayerID)
        
        
ChatColor(0"^x01[ADMIN]^x04 %s^x01: Reset bank."szAdminName)
        
        return 
PLUGIN_HANDLED
        
    
}
    return 
PLUGIN_HANDLED    
    

I will try another idea

Last edited by Supremache; 09-09-2020 at 17:29.
Supremache is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-09-2020 , 19:13   Re: nVault Tutorial
Reply With Quote #112

1. The player cannot execute the command if he is not connected, remove the is_user_connected() check.
2. Ensure this player has teh flags..or remove the if(access()) check.
3. Why are you assigning the value to iMoney[] before deleting the nvault record? i thought the intend was to clear the bank which IMO should include setting the variable to 0.
4. You do not need to call get_user_authid() again, just use the value in szAuth[id] in your log to get the steamid.
5. Are you setting steam id into szAuth[id] at client_authorized()?

I'm tapping out after this. You need to put time in to learn and debug on your own.
__________________
Bugsy is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-10-2020 , 21:38   Re: nVault Tutorial
Reply With Quote #113

Quote:
Originally Posted by Bugsy View Post
1. The player cannot execute the command if he is not connected, remove the is_user_connected() check.
2. Ensure this player has teh flags..or remove the if(access()) check.
3. Why are you assigning the value to iMoney[] before deleting the nvault record? i thought the intend was to clear the bank which IMO should include setting the variable to 0.
4. You do not need to call get_user_authid() again, just use the value in szAuth[id] in your log to get the steamid.
5. Are you setting steam id into szAuth[id] at client_authorized()?

I'm tapping out after this. You need to put time in to learn and debug on your own.
Okay thanks for your time, i will learn it
Supremache is offline
Reply


Thread Tools
Display Modes

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 21:32.


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