AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ H3LP ] Multiple items register? (https://forums.alliedmods.net/showthread.php?t=295781)

CrazY. 04-04-2017 12:45

[ H3LP ] Multiple items register?
 
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..

edon1337 04-04-2017 14:04

Re: [ H3LP ] Multiple items register?
 
erm

CrazY. 04-04-2017 18:33

Re: [ ZP : H3LP ] Multiple items register?
 
1 Attachment(s)
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.

Natsheh 04-04-2017 20:00

Re: [ H3LP ] Multiple items register?
 
You dont need a loop inside
fw_Item_Deploy_Post forward

Depresie 04-04-2017 20:04

Re: [ H3LP ] Multiple items register?
 
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..

CrazY. 04-04-2017 20:34

Re: [ H3LP ] Multiple items register?
 
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?


All times are GMT -4. The time now is 17:55.

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