AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Better way for Unlimited Clip? (https://forums.alliedmods.net/showthread.php?t=275067)

Depresie 11-21-2015 09:34

[HELP] Better way for Unlimited Clip?
 
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?

Bugsy 11-21-2015 12:20

Re: [HELP] Better way for Unlimited Clip?
 
What is wrong with CurWeapon?

Depresie 11-21-2015 12:35

Re: [HELP] Better way for Unlimited Clip?
 
i just dont want to call it every often :P
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 :P 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?

Bugsy 11-21-2015 12:38

Re: [HELP] Better way for Unlimited Clip?
 
If you hook primary attack, it will repeatedly fire the callback even if you arent actually firing. Just use CurWeapon.

Depresie 11-21-2015 12:41

Re: [HELP] Better way for Unlimited Clip?
 
what about an api? so curweapon function will be called once not 10 times?

Bugsy 11-21-2015 12:49

Re: [HELP] Better way for Unlimited Clip?
 
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.

Depresie 11-21-2015 14:21

Re: [HELP] Better way for Unlimited Clip?
 
okay, so i will keep curweapon for unlimited clip then thx :)

Chihuahuax 11-22-2015 01:06

Re: [HELP] Better way for Unlimited Clip?
 
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.
            



Bugsy 11-22-2015 07:23

Re: [HELP] Better way for Unlimited Clip?
 
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 );



Depresie 12-25-2015 09:35

Re: [HELP] Better way for Unlimited Clip?
 
Bugsy. could you please create an api for it? :) like set_user_uclip(id, true/false) ?


All times are GMT -4. The time now is 18:16.

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