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

How to block PlayerUse ?


Post New Thread Reply   
 
Thread Tools Display Modes
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 04-04-2011 , 07:11   Re: How to block PlayerUse ?
Reply With Quote #11

Variable pev->oldbuttons itself is checked when jumping. Am not sure is it checked anywhere for IN_USE, but I'd rather be safe than sorry.

No, I recommend PreThink pre.
In any way both of our methods will work. Except that my is based on "better safe than sorry", and wont make glitches for various plugins.

Well, blocking emit_sound will just block emitted sound of the player.

You mean m_afButtonPressed can be checked only if oldbuttons don't contain IN_USE, and release if old do contain.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-04-2011 , 12:24   Re: How to block PlayerUse ?
Reply With Quote #12

No, i mean this following code blocks any object use, but will not block vehicle use, so for such block it is more efficient than other methods :

PHP Code:
public EmitSound(idiChannelszSample[], Float:flVolumeFloat:flAttenuationiFlagsiPitch)
{
    if( 
is_user_alive(id) && equal(szSample"common/wpn_select.wav") )
    {
        new 
iButton
        
if( (iButton pev(idpev_button)) & IN_USE )
        {
            
set_pev(idpev_buttoniButton & ~IN_USE)
        }
        if( (
iButton get_pdata_int(idm_afButtonPressedXO_PLAYER)) & IN_USE )
        {
            
set_pdata_int(idm_afButtonPressediButton & ~IN_USEXO_PLAYER)
        }
        if( (
iButton get_pdata_int(idm_afButtonReleasedXO_PLAYER)) & IN_USE )
        {
            
set_pdata_int(idm_afButtonReleasediButton & ~IN_USEXO_PLAYER)
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-04-2011 at 12:31.
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-04-2011 , 14:09   Re: How to block PlayerUse ?
Reply With Quote #13

Isn't that sound for switching the weapons? Isn't it better to use ham and supercede it on func_vehicle entities?
bibu is offline
Rejiser
New Member
Join Date: Sep 2010
Location: Saint-Petersburg
Old 04-07-2011 , 08:47   Re: How to block PlayerUse ?
Reply With Quote #14

hm, one question.
Event of open door and event of touch button (in deathrun maps) - it's different event's?
Rejiser is offline
Send a message via ICQ to Rejiser Send a message via Skype™ to Rejiser
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-07-2011 , 13:05   Re: How to block PlayerUse ?
Reply With Quote #15

If you need to use a button it's the same, but if the only fact to touch makes the door open, then it's different.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-07-2011 , 15:59   Re: How to block PlayerUse ?
Reply With Quote #16

@Connor

Quote:
Originally Posted by bibu View Post
Isn't that sound for switching the weapons? Isn't it better to use ham and supercede it on func_vehicle entities?
bibu is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 04-07-2011 , 16:05   Re: How to block PlayerUse ?
Reply With Quote #17

Quote:
Originally Posted by bibu View Post
Isn't that sound for switching the weapons?
Why don't you find out yourself?

Last edited by matsi; 04-07-2011 at 16:08.
matsi is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-07-2011 , 17:17   Re: How to block PlayerUse ?
Reply With Quote #18

Quote:
Originally Posted by matsi View Post
Why don't you find out yourself?
Don't act like a bitch. If you can read the file's name it is wpn_select. And I also asked if ham wouldn't be better.
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-08-2011 , 00:27   Re: How to block PlayerUse ?
Reply With Quote #19

Quote:
Originally Posted by bibu View Post
Isn't that sound for switching the weapons? Isn't it better to use ham and supercede it on func_vehicle entities?
1. I don't think there is such a sound.
2. Yes, if you already knows what entities exist on the map.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 04-08-2011 , 13:23   Re: How to block PlayerUse ?
Reply With Quote #20

Quote:
Originally Posted by bibu View Post
Don't act like a bitch. If you can read the file's name it is wpn_select. And I also asked if ham wouldn't be better.
Why would you ask if you have the same file on your computer? Wouldn't it be better just listen to it?

"Don't act like a bitch."

Grow up.

Last edited by matsi; 04-08-2011 at 13:28.
matsi 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:45.


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