[SOLVED]C4 Pickup and touch vs WeapPickup
I have 2 things to ask :)
I have a problem when player is holding C4 and on ground is another C4 - it seems that player picked it up however, it doesn't show up in inventory as 2 C4's, so I assume there isn't a check like if player already has C4 like it is with other weapons - when you have primary weapon you can't pickup another primary weapon. So how to fix this - by adding check if user_has_weapon(id, CSW_C4) or making my own pickup code with conditions? Second thing is register_touch versus WeapPickup event. I need to check if that weapon which is on ground has specific model, if yes give player true on having that item. So, which is better touch weaponbox with conditions or WeapPickup event? |
Re: C4 Pickup and touch vs WeapPickup
1. I don't understand
2. You can find specific model. with register_touch: PHP Code:
|
Re: C4 Pickup and touch vs WeapPickup
1. If you have C4 in your hands, and other C4 is dropped and you decide to pick it up - it disappears. It should stay there.
2. I know that already, thats why I asked which one to use, which is more effiecient. EDIT: :O 23333 thread :O |
Re: C4 Pickup and touch vs WeapPickup
Ah, you want to make you have 2 C4?
|
Re: C4 Pickup and touch vs WeapPickup
WeaponPickup is for sure better than hooking touch, but you come after the war, so if you want to block pickup you need to hook touch.
You can anyway hook touch to block that c4 bug (check if weaponbox contain c4 with pdata, not with model), and hook WeaponPickup for other stuff. |
Re: C4 Pickup and touch vs WeapPickup
Quote:
Quote:
|
Re: C4 Pickup and touch vs WeapPickup
return PLUGIN_HANDLED
|
Re: C4 Pickup and touch vs WeapPickup
Can't seem to determine if ent is C4 from weaponbox. Found m_rgpPlayerItems_CWeaponBox[] but I don't know which is for C4. Also, I will use touch because why call one more event?
EDIT: Figured out the upper part. |
| All times are GMT -4. The time now is 10:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.