Grenade ammo *SOLVED*
When the user touches a nade it gives him TWO nades instead of one. Reason being is because CS gives him the spawned nade and what not and then my plugin gives him a nade when it specifically checks if his bpammo is > 0 (already has grenade). I tried these 2 methods:
Method 1: Code:
Method 2: Code:
A few functions that are used in there: Code:
Also, it permanently removes the spawned nades from the map. Help would be greatly appreciated :| |
try returning PLUGIN_HANDLED after setting your task.
if you don't want it to permanently remove it, instead of removing it try setting it so that it doesn't render (set_entity_visibility), set some flag to 1 (ie: EV_INT_iuser1 or anything else that isn't used). whenever a touch comes up, if that flag is 1, then return PLUGIN_HANDLED right away. when the round starts go through all armoury_entity's and set their flags to 0. |
Ahem? :?
|
this is using your example 1:
Code:
you would then have to hook when a round ends (or starts), cycle through all armoury_entity's and set their visibility to 1 as well as their EV_INT_iuser1 to 0. |
Oh, I see now.
I'll report back later with the results ;] |
It worked as far as spawning the nades again. It still gives the first nade though. I think this is because of cs_set_user_bpammo. Any suggestions?
|
echo out the values of ammo and max_ammo right before your "Checking the ammo" if statement.
|
Code:
Quote:
|
EDIT: FIXED!
|
Yes! This means Dwarfs on your server should be fixed :D
|
| All times are GMT -4. The time now is 20:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.