natives usage (not sure about title)
hi men! i'm making menu in that i will add items from other plugins with natives (just as in ZP).
i want to add some free items and some paid. If cost = -1 then it [cost] will not be shown in menu. but when i trying to add free item like Code:
var = register_item("Free scout")Code:
var = register_item("Free AK", -1)How are natives works? What i have in my include file: Code:
native register_item(const name[], cost = -1)Code:
if(item_cost == -1) { |
Re: natives usage (not sure about title)
When you register and Item there should be always a name and price because it needs that info as shown:
PHP Code:
If you set only price, the plugin will get confused again because you left 'name' empty. |
Re: natives usage (not sure about title)
Quote:
|
Re: natives usage (not sure about title)
What you did is completely valid, there should be some other problem in your code. If you're not willing to post the source, debug the code.
|
Re: natives usage (not sure about title)
Quote:
|
Re: natives usage (not sure about title)
Quote:
or best, that whole plugin |
Re: natives usage (not sure about title)
ok here it is:
PHP Code:
|
Re: natives usage (not sure about title)
I've tested your code, it worked without the problem you described.
Code:
Code:
|
Re: natives usage (not sure about title)
cost default value should be 0 and not -1 putting it -1 doesn't make alot of sense since 0 is for free :3
|
Re: natives usage (not sure about title)
Quote:
Code:
1. olala [$2345]Quote:
if -1 then it is free as you wrote but cost will be hidden (e.g. item is added and can be used but is blocked from buying by cvar (maybe i'll add this, i'm not sure)) if 0 or more it will be shown as [$0] or more |
| All times are GMT -4. The time now is 02:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.