AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Simple Vault Bank - Save your money automatically! (https://forums.alliedmods.net/showthread.php?t=214526)

Kia 04-28-2013 05:01

Simple Vault Bank - Save your money automatically!
 
2 Attachment(s)
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.


Smatify 04-28-2013 05:19

Re: Simple Vault Bank - Save your money automatically!
 
Nice Work! :)

Kia 04-28-2013 05:25

Re: Simple Vault Bank - Save your money automatically!
 
Thanks.

ConnorMcLeod 04-28-2013 05:44

Re: Simple Vault Bank - Save your money automatically!
 
You detection method seems really poor.
You should rather use or reproduce this : client_startmoney and client_roundstartmoney forwards

Kia 04-28-2013 05:54

Re: Simple Vault Bank - Save your money automatically!
 
I don't understand what you want me exactly to edit now. :confused:

guipatinador 04-28-2013 06:27

Re: Simple Vault Bank - Save your money automatically!
 
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.

Kia 04-28-2013 06:38

AW: Simple Vault Bank - Save your money automatically!
 
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]



Jhob94 04-28-2013 07:57

Re: Simple Vault Bank - Save your money automatically!
 
Quote:

Originally Posted by Kia (Post 1941439)
.: Recommended Plugins :.

So it is the same as amx bank but much more poor?

Smatify 04-28-2013 08:00

Re: Simple Vault Bank - Save your money automatically!
 
Quote:

Originally Posted by Jhob94 (Post 1941524)
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

Kia 04-28-2013 08:03

AW: Simple Vault Bank - Save your money automatically!
 
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")


All times are GMT -4. The time now is 20:43.

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