Get weaponbox name?
PHP Code:
|
Re: Get weaponbox name?
If you want to block "drop" command then hook it and do your checks. Your way is just removing the box when it is spawned, while you could block it from being created.
Also, don't set FL_KILLME flags on a weaponbox, just make it to think. Now, about your code: The classname of an weaponbox entity is, guess what, "weaponbox". pev_classname will always give this in this case. To know if a weaponbox contain a specific weapon you could redo the CWeaponBox::HasWeapon function (https://github.com/Arkshine/CSSDK/bl...pons.cpp#L1641). Or use this stock made by Connor(which is more or less the same thing): PHP Code:
PHP Code:
|
Re: Get weaponbox name?
When a player dies the weapon will be dropped on the ground, so blocking the "drop" command won't help. I'll try the stock tomorrow.
|
Re: Get weaponbox name?
Would you rather prevent the user from attempting a drop, or do you just want to not have weapons on the ground?
This will destroy the weaponbox once dropped, except for C4. PHP Code:
|
Re: Get weaponbox name?
I'm going to block weapon drop + ground weapons. The first one because I don't want the players to drop their weapons accidentally and therefore play without a weapon until the next round, and the second one because I'm using custom models for the weapons and I don't have w_ models for all of them, so I don't want the default ones to lie on the ground.
The code sorta works. Only the C4 is able to be on the ground, but I'm unable to pick it up - http://i.imgur.com/0z67R0p.jpg |
Re: Get weaponbox name?
See if this does what you want. Edit: see below
|
Re: Get weaponbox name?
No, this is worse. Now it drops the weapon on death + I'm still unable to pick up the C4 after dropping it.
|
Re: Get weaponbox name?
Quote:
|
Re: Get weaponbox name?
Try this:
Edited to kill weaponbox when it hits the ground instead of when it leaves the players hands. PHP Code:
|
Re: Get weaponbox name?
Now they all drop upon death and dissapear when a player touches them. The C4 still can't be picked up. Here's a video of what's happening - https://youtu.be/6NU1paRlOgQ
|
| All times are GMT -4. The time now is 22:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.