Raised This Month: $ Target: $400
 0% 

[ H3LP ] Multiple items register?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-04-2017 , 12:45   [ H3LP ] Multiple items register?
Reply With Quote #1

Hey! I am trying register multiple items in only one plugin, that work but I dont know how to get what item is selected and then do a function. Code in the next post..
__________________









Last edited by CrazY.; 04-04-2017 at 18:29.
CrazY. is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-04-2017 , 14:04   Re: [ H3LP ] Multiple items register?
Reply With Quote #2

erm
__________________
edon1337 is offline
Old 04-04-2017, 17:09
CrazY.
This message has been deleted by CrazY..
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-04-2017 , 18:33   Re: [ ZP : H3LP ] Multiple items register?
Reply With Quote #4

Now the problem is in Ham_Item_Deploy. I am using that to change weapon models, but when I buy the Ak47 and after buy another item (M249 or Xm1014) the V_ models of theese weapons continue with Ak47 model.
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_golden_weapons.sma - 384 views - 3.6 KB)
__________________








CrazY. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-04-2017 , 20:00   Re: [ H3LP ] Multiple items register?
Reply With Quote #5

You dont need a loop inside
fw_Item_Deploy_Post forward
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-04-2017 , 20:04   Re: [ H3LP ] Multiple items register?
Reply With Quote #6

when you register an item, you have this

g_itemID1 = register_item bla bla

That is the item's index... telling which item is which..
__________________

Last edited by Depresie; 04-04-2017 at 20:05.
Depresie is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-04-2017 , 20:34   Re: [ H3LP ] Multiple items register?
Reply With Quote #7

Code:
new g_itemid[3] ... for (new i = 0; i < sizeof (szWeapons); i++) {         g_itemid[i] = zp_register_extra_item(szWeapons[i][WeaponName], szWeapons[i][WeaponCost], ZP_TEAM_HUMAN);         RegisterHam(Ham_Item_Deploy, szWeapons[i][WeaponIndex], "fw_Item_Deploy_Post", 1); }

Code:
public fw_Item_Deploy_Post(entity) {     if (!pev_valid(entity))         return HAM_IGNORED;     new id = get_pdata_cbase(entity, 41, 4);         if (!is_user_alive(id))         return HAM_IGNORED;     for (new i = 0; i < sizeof (szWeapons); i++)     {         if (!g_has_item[id][i])             return HAM_IGNORED;         set_weapon_model(id, i);         client_print(id, print_chat, "Weapon Deploy: %s", szWeapons[i][WeaponName]);         break;     }     return HAM_IGNORED; }

I already had added.. I think you did not see that haha'. Any other idea?
__________________









Last edited by CrazY.; 04-04-2017 at 20:34.
CrazY. is offline
Reply



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 17:55.


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