Raised This Month: $ Target: $400
 0% 

[HELP] Better way for Unlimited Clip?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-21-2015 , 09:34   [HELP] Better way for Unlimited Clip?
Reply With Quote #1

Is there any better way to make weapons have unlimited clip other than curWeapon?
For example Ham Primary Attack or set_task? or anything better?

Last edited by Depresie; 11-21-2015 at 09:42.
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-21-2015 , 12:20   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #2

What is wrong with CurWeapon?
__________________
Bugsy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-21-2015 , 12:35   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #3

i just dont want to call it every often
for example i have 10 extra weapons in game using curweapon both for unlimited clip and for setting model
i managed to set model using ham deploy, but for unlimited clip i dont know maybe primary attack and set_task would work better?

Or maybe by creating an API for it would be better? so cur weapon would be called only once instead of 10?

Last edited by Depresie; 11-21-2015 at 12:39.
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-21-2015 , 12:38   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #4

If you hook primary attack, it will repeatedly fire the callback even if you arent actually firing. Just use CurWeapon.
__________________
Bugsy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-21-2015 , 12:41   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #5

what about an api? so curweapon function will be called once not 10 times?
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-21-2015 , 12:49   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #6

What is your concern? Wouldn't you have the same issue if you changed from CurWeapon to something else? Either way, something is getting called a lot.
__________________

Last edited by Bugsy; 11-21-2015 at 13:01.
Bugsy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-21-2015 , 14:21   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #7

okay, so i will keep curweapon for unlimited clip then thx
Depresie is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-22-2015 , 01:06   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #8

Yokomo's idea:

PHP Code:
new wpn give_item(player"weapon_ak47")
            if(
wpn != -1)
            {
                    
cs_set_weapon_ammo(wpn32767//32767 is enough, speedhacker also can't spam too much.
                    
cs_set_user_bpammo(playerCSW_AK470//prevent reload.
            

Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-22-2015 , 07:23   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #9

How often are you firing your CurWeapon callback? You can set it to only fire when the clip is empty like this:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init() 
{
    
register_event"CurWeapon" "EvCurWeapon" "be" "1=1" "3=0" );
}

public 
EvCurWeaponid )
{
    static const 
m_pActiveItem 373;
    
    
cs_set_weapon_ammoget_pdata_cbaseid m_pActiveItem ) , 10 );

__________________

Last edited by Bugsy; 11-22-2015 at 07:25.
Bugsy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-25-2015 , 09:35   Re: [HELP] Better way for Unlimited Clip?
Reply With Quote #10

Bugsy. could you please create an api for it? like set_user_uclip(id, true/false) ?
__________________
Depresie 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 18:16.


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