Limit of buy item but he take ammo
I put a limit on an item so I can't abuse it but when I want to buy the same item I keep deducting from ammo packs why?
Code:
#include <amxmodx> |
Re: Limit of buy item but he take ammo
Because you don't register cvar correct.
you have to do something like this PHP Code:
You could resolve this if you easily print on server console cvar_limit. Code:
native register_cvar(const name[], const string[], flags = FCVAR_NONE, Float:fvalue = 0.0); |
Re: Limit of buy item but he take ammo
Quote:
OP: Are you gaining any health when this happens, or is it just deducting packs? |
Re: Limit of buy item but he take ammo
Do some debugging. Log or server_print() the value of g_bComprado[ id ] at each stage in this function (when increased, when value checked); do the same for the cvar value. Somehow you are getting into code that deducts ammo packs. You can figure out all issues on your own once you learn the general principle of debugging.
Code:
|
Re: Limit of buy item but he take ammo
none of these work, and I also discovered that in fact the limit is once on the map, not on the round...... What's wrong with this plugin?
|
Re: Limit of buy item but he take ammo
Are you referring to my code? If so, then the function is not even getting called that is causing your issue.
|
Re: Limit of buy item but he take ammo
To me it looks like this is your issue, as you're mentioning that u can only use it once a map.
PHP Code:
PHP Code:
|
Re: Limit of buy item but he take ammo
arrayset() would cover the entire array, I'm not sure how only resetting certain indexes would matter.
|
Re: Limit of buy item but he take ammo
I'm not sure what's your zp version, usually you have to return PLUGIN_HANDLED in order to block the user from buying, but you're returning PLUGIN_CONTINUE
Code:
#include <amxmodx> |
Re: Limit of buy item but he take ammo
Quote:
I tried the code written by you but it still drops me from ammo packs when I want to buy hp again |
| All times are GMT -4. The time now is 02:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.