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

Simple Vault Bank - Save your money automatically!


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Admin Commands       
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2013 , 05:01   Simple Vault Bank - Save your money automatically!
Reply With Quote #1

Simple Vault Bank

.: Description :.

This plugin automatically saves your Money to a Vault file and loads it when you rejoin to the server.
I know there are some other plugins which do almost the same, but I had some problems with them so I decided to make a new one.
Servers running this plugin.

.: CVars :.

None.

.: Modules :.
  • amxmodx
  • cstrike
  • hamsandwich
  • nvault

.: Requirements :.
  • AmxModx Vers. 1.8.2 or higher
  • A STEAM Server.

.: Credits :.
  • flyeni6 - For his NVault Tutorial
  • ConnorMcLeod - For his "Server using this Plugin"-Code

.: Recommended Plugins :.
.: Changelog :.
Quote:
Version 1.1
  • Changed "format(vaultdata,255,"%i#",g_iMoney[id])" to "format(vaultdata,255,"%i",g_iMoney[id])"
  • Changed "client_putinserver" to "client_authorized"
  • Changed "if(money == 800.." to "if(money == g_iStartmoney" (g_iStartmoney = get_cvar_pointer("mp_startmoney")
Version 1.0
  • First release.
Attached Files
File Type: sma Get Plugin or Get Source (simplevaultbank.sma - 924 views - 1.9 KB)
File Type: sma Get Plugin or Get Source (simplevaultbank_1_1.sma - 972 views - 1.9 KB)
__________________

Last edited by Kia; 04-28-2013 at 08:30.
Kia is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 04-28-2013 , 05:19   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #2

Nice Work!
Smatify is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2013 , 05:25   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #3

Thanks.
__________________
Kia is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-28-2013 , 05:44   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #4

You detection method seems really poor.
You should rather use or reproduce this : client_startmoney and client_roundstartmoney forwards
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2013 , 05:54   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #5

I don't understand what you want me exactly to edit now. :confused:
__________________

Last edited by Kia; 04-28-2013 at 05:54.
Kia is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 04-28-2013 , 06:27   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #6

PHP Code:
format(vaultdata,255,"%i#",g_iMoney[id]) 
Why not,

PHP Code:
format(vaultdata,255,"%i",g_iMoney[id]) 
or,

PHP Code:
num_to_str(g_iMoney[id], vaultdata255 
Is the '#' required?

Also, you don't need that line in public load_user_money(id).

I recommend you register Ham_Spawn as post, and check if user is alive.
Also recommend to load money in client_authorized.

PHP Code:
if(money == 800 || !g_bHasLoaded[id]) 
Why 800 ? Is the value of mp_startmoney? Obviously, it can change.

Last edited by guipatinador; 04-28-2013 at 06:37.
guipatinador is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2013 , 06:38   AW: Simple Vault Bank - Save your money automatically!
Reply With Quote #7

Oops, looks I forgot to change that, I'll edit as soon as I am at my PC.

I tried using your forwards Connor, but I always get $0 using this code :

PHP Code:
public client_startmoneyidmoney 

    return 
g_iMoney[id]
}

public 
client_roundstartmoney(idmoney)
{
    
g_iMoney[id] = cs_get_user_money(id)
    return 
g_iMoney[id]

__________________

Last edited by Kia; 04-28-2013 at 07:12.
Kia is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 04-28-2013 , 07:57   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #8

Quote:
Originally Posted by Kia View Post
.: Recommended Plugins :.
So it is the same as amx bank but much more poor?
__________________
Jhob94 is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 04-28-2013 , 08:00   Re: Simple Vault Bank - Save your money automatically!
Reply With Quote #9

Quote:
Originally Posted by Jhob94 View Post
So it is the same as amx bank but much more poor?
I think not, this plugin saves the money automatically and gives it back when you reconnects. I have tested it for 1 week and it works almost perfect.

OMG my english is so bad :S
Smatify is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2013 , 08:03   AW: Simple Vault Bank - Save your money automatically!
Reply With Quote #10

Title says already, it's a very simple plugin to save / load money.

Updated to Vers. 1.1

Version 1.1
  • Changed "format(vaultdata,255,"%i#",g_iMoney[id])" to "format(vaultdata,255,"%i",g_iMoney[id])"
  • Changed "client_putinserver" to "client_authorized"
  • Changed "if(money == 800.." to "if(money == g_iStartmoney" (g_iStartmoney = get_cvar_pointer("mp_startmoney")
__________________

Last edited by Kia; 04-28-2013 at 08:27.
Kia 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 02:20.


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