Raised This Month: $ Target: $400
 0% 

Solved natives usage (not sure about title)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-07-2021 , 14:53   natives usage (not sure about title)
Reply With Quote #1

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")
it shows me random number. if i adding item like this:
Code:
var = register_item("Free AK", -1)
it works perfectly.

How are natives works? What i have in my include file:
Code:
native register_item(const name[], cost = -1)
The way i hide item cost:
Code:
if(item_cost == -1) {
	formatex(szText, charsmax(szText), "%s", item_name)
} else {
	formatex(szText, charsmax(szText), "%s \r[\y$\w%i\r]", item_name, item_cost)
}

Last edited by kww; 06-08-2021 at 15:41.
kww is offline
 


Thread Tools
Display Modes

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 02:33.


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