Raised This Month: $ Target: $400
 0% 

Block the stwich weapon of players.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lolzin123
Member
Join Date: Apr 2009
Old 06-23-2009 , 16:45   Block the stwich weapon of players.
Reply With Quote #1

I need the code for block the players of stwich weapons for 10s.
lolzin123 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-24-2009 , 09:24   Re: Block the stwich weapon of players.
Reply With Quote #2

Not possible, afaik. You might try hooking it in Ham and blocking it using this:

PHP Code:
    /**
     * Description:        Deploys the entity (usually a weapon).
     * Forward params:    function(this);
     * Return type:        Integer (boolean).
     * Execute params:    ExecuteHam(Ham_Item_Deploy, this);
     */
    
Ham_Item_Deploy 
I suspect, however, that this will just crash the server as opposed to preventing weapon switching.

What you can do, though, is simply switch the player's weapon back to their old weapon or drop the new one.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
lolzin123
Member
Join Date: Apr 2009
Old 06-24-2009 , 12:04   Re: Block the stwich weapon of players.
Reply With Quote #3

I'm Trying to use this code:
PHP Code:
if( get_gametime() - gSlowedTime[plr] < 3.0
            
&& gEntSlowed[plr] == ent )
            {
                
set_pev(plrpev_maxspeed75.0);
            }
            
            if( !
task_exists(TASK_ID_MAXSPEED plr0) )
            {
                new 
szEntId[5];
                
num_to_str(entszEntId4);
                
                
set_task(3.0"tskMaxSpeed"TASK_ID_MAXSPEED plrszEntId4""0);
            } 
but when the plr stwitch the weapons, the slowtime disappears

Any idea?
lolzin123 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-24-2009 , 14:28   Re: Block the stwich weapon of players.
Reply With Quote #4

add to plugin init:
PHP Code:
register_event("CurWeapon""event_CurWeapon""be""1=1"
event_CurWeapon will be called every time player switch weapons, so you just need to check if player should be slowed and set his maxspeed there...
If you want to see some example of using this event to set maxspeed then check this:
http://forums.alliedmods.net/showpos...73&postcount=7
__________________
Impossible is Nothing
Sylwester is offline
lolzin123
Member
Join Date: Apr 2009
Old 06-25-2009 , 13:24   Re: Block the stwich weapon of players.
Reply With Quote #5

show me how i add this code to make the plr slow , because when he switch the weapon the slowtime is finish. THX
lolzin123 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-25-2009 , 13:45   Re: Block the stwich weapon of players.
Reply With Quote #6

Just block all weapon ("weapon_m4a1", etc), slot ("slot1", etc), inventory ("inv_next", etc) cmds.
__________________
hleV is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-25-2009 , 14:27   Re: Block the stwich weapon of players.
Reply With Quote #7

Don't try to block weapons, just learn how to use CurWeapon event to make player maxspeed constant. I already gave you link with an example in my previous post. There are also a lot of other examples, just use Search...

If you are not able to understand how to use CurWeapon then post your plugin and someone will edit it.
__________________
Impossible is Nothing
Sylwester is offline
lolzin123
Member
Join Date: Apr 2009
Old 06-25-2009 , 15:03   Re: Block the stwich weapon of players.
Reply With Quote #8

It's a BCM 4 of HNS if i strip the weapons, the game is over...
I need a mod to strip the weapons and give the same weapons with the same bullets.Or block the switching of weapons, understand?
lolzin123 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 15:35.


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