Raised This Month: $32 Target: $400
 8% 

[Suggestion] Amxmodx: New functions for cstrike module.


Post New Thread Reply   
 
Thread Tools Display Modes
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-08-2015 , 15:25   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #11

i don't understand exactly how that works, what i meant was, find_entity_in_sphere , not by creating a spheric zone, but a rectangular one
Depresie is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-09-2015 , 04:11   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #12

Quote:
Originally Posted by Arkshine View Post
cs_strip_user_weapon: I think it has been requested, is it useful to remove silently a weapon? You are supposed to control what weapons you give to a player. Do you have an example of situation?
I requested it some time ago (although for "fun" module, not cstrike). Its useful for zombie mods to get rid of some specific items (like grenades from zombies on round end, instead of using strp_user_weapons + give knife).
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2015 , 09:42   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #13

In your example, this is a context where you need to remove anything except knife, this current way would be safer since it resets all as it should. It makes sense here to start from nothing to avoid any HUD or internal glitches. Ultimately you could create yourself one time the player_weaponstrip entity and just calling Use when you need it. It makes me think that since now we have gamedata files, we could call directly RemoveAllItems() in strip_user_weapons instead of creating/deleting each time, it might be a welcomed improvement if you need to do that at spawn.
I'm still not really convinced about removing silently a specific weapon, it sounds like a hint of badly designed plugin. Depending mod, item you may need to do more stuffs, like for C4/Defuser. It kinds of encourage to use an unsafe way. Try to give me another example?
__________________

Last edited by Arkshine; 10-09-2015 at 09:56.
Arkshine is offline
Old 10-09-2015, 09:43
Arkshine
This message has been deleted by Arkshine. Reason: lag
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-09-2015 , 11:05   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #14

Quote:
Originally Posted by NiHiLaNTh View Post
I requested it some time ago (although for "fun" module, not cstrike). Its useful for zombie mods to get rid of some specific items (like grenades from zombies on round end, instead of using strp_user_weapons + give knife).
Yea something like that. But in my case it difference..

Ok let say we are creating a custom buy weapons plugin.

1. I spawn with defaut weapon (knife and usp).
2. I want to buy a new secondary weapon, but i dont want multiple pistols in slot 2. I dont want to drop it.. I want to completely remove the usp. This will prevent player from spamming and dropping pistols. Also can reduce entity count in map.

Trust me many people need this feature.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 10-09-2015 , 11:07   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #15

Quote:
Originally Posted by NiHiLaNTh View Post
I requested it some time ago (although for "fun" module, not cstrike). Its useful for zombie mods to get rid of some specific items (like grenades from zombies on round end, instead of using strp_user_weapons + give knife).
Why dont you add the stock yourself.

there is perfectly good ones out there. but i guess it would be more "efficent" to do it directly from the module, but i really dont think it matters.

Quote:
Originally Posted by yokomo View Post
Yea something like that. But in my case it difference..

Ok let say we are creating a custom buy weapons plugin.

1. I spawn with defaut weapon (knife and usp).
2. I want to buy a new secondary weapon, but i dont want multiple pistols in slot 2. I dont want to drop it.. I want to completely remove the usp. This will prevent player from spamming and dropping pistols. Also can reduce entity count in map.

Trust me many people need this feature.

You can strip_user_weapons, then remove the weapon entity with hooking FM_SetModel.

would be easier with that way though, just 1 line > done
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 10-09-2015 at 11:15. Reason: accidently posted twice
SkumTomteN is offline
Old 10-09-2015, 11:13
SkumTomteN
This message has been deleted by SkumTomteN. Reason: accidently posted twice:D
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-09-2015 , 11:26   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #16

Quote:
Originally Posted by SkumTomteN View Post
Why dont you add the stock yourself.

there is perfectly good ones out there. but i guess it would be more "efficent" to do it directly from the module, but i really dont think it matters.




You can strip_user_weapons, then remove the weapon entity with hooking FM_SetModel.

would be easier with that way though, just 1 line > done
Do you clearly understand what strip_user_weapons do?
It remove all weapons in player slots.

What if i have 1 rifle 1 pistol 1 grenade 1 shield?
All my current weapons will be remove right.

I want to avoid it.

Also hooking FM_SetModel is no a good way. It calls too often.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 10-09-2015 at 11:29.
yokomo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2015 , 11:52   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #17

Quote:
Originally Posted by yokomo View Post
Yea something like that. But in my case it difference..

Ok let say we are creating a custom buy weapons plugin.

1. I spawn with defaut weapon (knife and usp).
2. I want to buy a new secondary weapon, but i dont want multiple pistols in slot 2. I dont want to drop it.. I want to completely remove the usp. This will prevent player from spamming and dropping pistols. Also can reduce entity count in map.

Trust me many people need this feature.
This sounds like more you need a forward or something called when default items are about to be given or a native which does block internally. Acting after weapons have been created and given doesn't seem the right way.
__________________

Last edited by Arkshine; 10-09-2015 at 11:55.
Arkshine is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-09-2015 , 11:59   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #18

Quote:
Originally Posted by Arkshine View Post
This sounds like more you need a forward or something called when default items are about to be given or a native which does block internally. Acting after weapons have been created and given doesn't seem the right way.
Nope i dont need a forward.. Read the comment i replied to skutumen.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2015 , 12:20   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #19

Removing weapon on drop is fine. Hooking SetModel is fine as well. Anything which is not called per frame is not called often. There is no performance issue. But I understand that if you can avoid to create x entities at once at spawn, can be welcomed, but at this point, maybe you should remove the default weapons and let people choose what they want, this would make more sense.
__________________

Last edited by Arkshine; 10-09-2015 at 12:22.
Arkshine is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 10-09-2015 , 13:08   Re: [Suggestion] Amxmodx: New functions for cstrike module.
Reply With Quote #20

You can drop each weapon, primary / secondary.

i guess you can configure it the way you want it to be. removing entity, adding nade/shield support.

Also, your server wont die by hooking FM_SetModel, ive done it too many times and never had a single problem with it.

PHP Code:
stock drop_weapons(iddropwhat)
{
    
// Get user weapons
    
static weapons[32], numiweaponid
    num 
// reset passed weapons count (bugfix)
    
get_user_weapons(idweaponsnum)
    
    
// Loop through them and drop primaries or secondaries
    
for (0numi++)
    {
        
// Prevent re-indexing the array
        
weaponid weapons[i]
        
        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            
// Get weapon entity
            
static wname[32]; get_weaponname(weaponidwnamecharsmax(wname))
            
engclient_cmd(id"drop"wname)
        }
    }

__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 10-09-2015 at 13:08.
SkumTomteN 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 05:17.


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