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

[ZP43|ZP50] Auto-save Ammopacks.


Post New Thread Reply   
 
Thread Tools Display Modes
musicbg91
Member
Join Date: Jan 2011
Location: Bulgaria
Old 07-22-2011 , 05:03   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #11

it doesn't work i do anything but it doesn't work please help me somebody..
musicbg91 is offline
Send a message via Skype™ to musicbg91
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-22-2011 , 08:58   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #12

Quote:
Originally Posted by musicbg91 View Post
it doesn't work i do anything but it doesn't work please help me somebody..
Please give me a detail info, this plugin save data based on player steamid, not ip/name.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-25-2011 , 07:52   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #13

Setting a task before loading the player's bank will prevent that error so you do not need to delete/comment the code. And use plugin_end.

PHP Code:
public plugin_end()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    
    new 
iPlayer
    
for(new 0iNumi++)
    {
        
iPlayer iPlayers[i]
        
        
// Your savedata function
    
}
    
    
// Close the fVault file function here

Reason: When server changes map or restart, data doesn't saves sometimes. plugin_end calls before client_disconnect I think. So it's safer to do this o_O?
Excalibur.007 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-25-2011 , 11:45   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #14

Client join in the server = load
Client leave the server = save
OPTION:Event round start = save.
OPTIONlugin end = save.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-26-2011 , 03:40   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #15

Quote:
Originally Posted by lucas_7_94 View Post
Client join in the server = load
Client leave the server = save
OPTION:Event round start = save.
OPTIONlugin end = save.
Yes, you get my idea
Excalibur.007 is offline
DANCEATTACK
Junior Member
Join Date: Jun 2011
Location: Recife - PE - Brazil
Old 07-26-2011 , 04:01   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #16

I installed this plugin and something was strange .. all players got the same amount of ammo pack after exchanging map.

example: I was on a map with 6 ammo pack, then I changed and got 4 ammo packs? why?

configured zombieplague.cfg // zp_starting_ammo_packs 0
__________________

DANCEATTACK is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-26-2011 , 11:38   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #17

Quote:
Originally Posted by Excalibur.007 View Post
Yes, you get my idea
isn't hard to make .
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-26-2011 , 11:39   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #18

First post update -- https://forums.alliedmods.net/showpo...93&postcount=1
* Update plugin.
* Update How to configure this plugin on the main post.

This plugin saving data using steamid, so no support for nosteam server that using name/ip as saving method.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-26-2011 , 11:47   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #19

zp needs an addition of a forward which is called when a player's ammo packs are changed, zp_player_ammopacks_changed( id )
It can then be used.
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-26-2011 , 12:04   Re: [TEST] ZP AmmoBank (fvault)
Reply With Quote #20

check this . i didnt test it , but can works (i'm working more in Sourcemod , says me if you look any wrong)

Code:
#include <amxmodx> #include <fvault> #include <zombieplague> #define PLUGIN "ZP AmmoSaving(fvault)" #define VERSION "1.0.1" #define AUTHOR "yokomo & Luqqas" #define AUTOSAVE_INTERVAL 20 //Set autosave interval in second new const g_vault_name[] = "ammobank" new g_maxplayers #define is_user_valid(%1) (!is_user_hltv(%1) && !is_user_bot(%1) && is_user_connected(%1)) public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         g_maxplayers = get_maxplayers() } public client_putinserver(id) {     if( is_user_valid( id ) )     {             LoadAmmo(id)     } } public client_disconnect(id) {        if( is_user_valid( id ) )     {         SaveAmmo(id)     } } public zp_round_ended() {     for(new id = 1; id <= g_maxplayers; id++)     {         if( is_user_valid(id) ) SaveAmmo(id)     } } public plugin_end() {     for(new id = 1; id <= g_maxplayers; id++)     {         if( is_user_valid(id) ) SaveAmmo(id)     } } LoadAmmo(id) {     new authid[35]     get_user_authid(id, authid, sizeof(authid) - 1)         new data[16];     if(fvault_get_data(g_vault_name, authid, data, sizeof(data) - 1))         zp_set_user_ammo_packs(id,  str_to_num(data) ) // loaded ammopacks.     else         zp_set_user_ammo_packs(id, 5) // default start. } SaveAmmo(id) {     new authid[35]     get_user_authid(id, authid, sizeof(authid) - 1)         new data[16]     num_to_str(zp_get_user_ammo_packs(id), data, sizeof(data) - 1)         fvault_set_data(g_vault_name, authid, data) }

No cvars , simple.
PS: You can use SQLite-.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 13:15.


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