Max Player Armor
Hello, i wanted to ask for help, i dont know how to do that player cant go bigger than 200 armor , and in one round cant buy more than 600... I have the last thing i mentioned in my script but the first one i dont know how to do it without making that ItemCount trigger...
PHP Code:
|
Re: Max Player Armor
You can use zp_extra_item_selected() to hook the purchase. Make your checks, for example:
if ( get_user_armor(id) + g_armor_amount > g_armor_limit ) // If you want to block buying at 101-200 armor. if ( get_user_armor(id) >= g_armor_limit ) // If you want to enable buying at 101-200. returning ZP_PLUGIN_HANDLED will cancel the purchase and return the money. If you choose the second, don't forget to use clamp() on the buy forward later to prevent it from going over 200. clamp(get_user_armor(id)+g_armor_amount, 0, g_armor_limit); For the 600 limit, add upp the g_armor_amount for every player in a global variable that you clear each round start/end. |
Re: Max Player Armor
Quote:
PHP Code:
|
Re: Max Player Armor
Not sure how you implemented it, this is what I intended:
Code:
I see that you already have min() instead of clamp() and g_ItemCount[], so you should be all covered. |
All times are GMT -4. The time now is 06:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.