[resolved] Vault and Events
I want to make this plugin record the player's score and deaths in the vault and load them up whenever the player connects. So, the player's score and deaths are never set back to 0.
Here's the not-working code, it doesn't even show any of the client_print's when I tested it. And it didn't want to show up in amx_plugins until I added the register_concmd(). I never learned to use the vault, this is just ripped from the "XP based plugin" thread. And I don't know what the difference between register_message() and register_event() is... Code:
|
Re: Vault and Events
Try using client_authorized or client_putinserver instead of client_connect.
|
Re: Vault and Events
Doesn't change a thing. :?
|
Re: Vault and Events
Try using nVault.
|
Re: Vault and Events
you have to use client_authorized... client_connect wont work...
|
Re: Vault and Events
I don't know how to use nVault, or any kind of vault for that matter. There is also a problem with my ScoreInfo event, because NONE of the client_print's get executed, and at least the ScoreInfo one should.
I tried client_putinserver, and it may no change. client_authorized should not be any different. EDIT: I got the client_print for the ScoreInfo function to show up, but the other two on LoadXP and SaveXP do not show. Here's the code I used: Code:
|
Re: Vault and Events
This deserves a new post! I fixed all the kinks and here is the working code, though there may be some performance issues. I think the server lags a little with this plugin running...
Code:
|
Re: [resolved, optimization?] Vault and Events
Optimization: Don't use server frame like that to save every so often.
nVault is faster than vault. You should check if the player aleast connected when saving it for all the server. |
Re: [resolved, optimization?] Vault and Events
Could you give me some tips on nvault, before I look it up myself? Or some links you find to be useful?
Also, the reason I use server_frame is because my server crashes sometimes, with 24-25 bots running around and other plugins running, so I want to ensure the data gets saved without the player having to disconnect. Good point about checking if connected before saving. :D Thanks +k EDIT: I'll mess around with nvault when I have more time, but for now I got rid of engine, so I call the SaveXP function on the ScoreInfo event. That way, no score will ever be lost :up:. And, no need that way to check if client is connected :up: :up:. This plugin is pretty well optimized IMO. |
| All times are GMT -4. The time now is 04:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.