Raised This Month: $ Target: $400
 0% 

screen shake effect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-16-2013 , 04:42   screen shake effect
Reply With Quote #1

Can you help me with this plugin?
I want to edit screen shake effect. I need to make it less..


message_begin(MSG_ONE , gMsgScreenShake , {0,0,0} ,id)
write_short( 1<<14 );

I test some values instead 14, but effect is not changed.. He is too strong (big screen slope)


PHP Code:
#include <amxmodx>
#include <engine>

#define PA_LOW  25.0
#define PA_HIGH 50.0
#define DEFAULT_VOLUME 0.8

new gMsgScreenShake gMsgScreenFade;

public 
plugin_init() {
  
register_plugin("HE damage effect" "0.2" "v3x");
  
register_event("Damage" "event_Damage" "b" "2>0");
  
register_cvar("he_damage_effect" "1");
  
gMsgScreenShake get_user_msgid("ScreenShake");
  
gMsgScreenFade get_user_msgid("ScreenFade");
}





public 
event_Damage(id
{
    if(
get_cvar_num("he_damage_effect") <= 0   || !is_user_connected(id)   || !is_user_alive(id)  || is_user_bot(id)) return;
    
    new 
iWeapIDattacker get_user_attacker(id iWeapID);
    
    if(!
is_user_connected(attacker)) return;
    
    if(
iWeapID == 4) {

        
client_cmd(id "volume 0");
        
set_task(0.5 "volume_up_1" id);

        new 
Float:fVec[3];
        
fVec[0] = random_float(PA_LOW PA_HIGH);
        
fVec[1] = random_float(PA_LOW PA_HIGH);
        
fVec[2] = random_float(PA_LOW PA_HIGH);
        
entity_set_vector(id EV_VEC_punchangle fVec);

        
message_begin(MSG_ONE gMsgScreenShake , {0,0,0} ,id)
        
write_short1<<14 );
        
write_short1<<14 );
        
write_short1<<14 );
        
message_end();
        
        
message_begin(MSG_ONE_UNRELIABLE gMsgScreenFade , {0,0,0} , id);
        
write_short1<<10 );
        
write_short1<<10 );
        
write_short1<<12 );
        
write_byte225 );
        
write_byte);
        
write_byte);
        
write_byte125 );
        
message_end();
  }
}

public 
volume_up_1(id) {
  
client_cmd(id "volume 0.1");
  
set_task(0.2 "volume_up_2" id);
}

public 
volume_up_2(id) {
  
client_cmd(id "volume 0.2");
  
set_task(0.2 "volume_up_3" id);
}

public 
volume_up_3(id) {
  
client_cmd(id "volume 0.3");
  
set_task(0.2 "volume_up_4" id);
}

public 
volume_up_4(id) {
  
client_cmd(id "volume 0.4");
  
set_task(0.2 "volume_up_5" id);
}

public 
volume_up_5(id) {
  
client_cmd(id "volume 0.5");
  
set_task(0.2 "volume_up_6" id);
}

public 
volume_up_6(id) {
  
client_cmd(id "volume 0.6");
  
set_task(0.2 "volume_up_7" id);
}

public 
volume_up_7(id) {
  
client_cmd(id "volume 0.7");
  
set_task(0.2 "volume_up_8" id);
}

public 
volume_up_8(id) {
   
client_cmd(id "volume %f" DEFAULT_VOLUME);

__________________
sorry my bad english...

Last edited by alonelive; 01-16-2013 at 04:43.
alonelive is offline
Kiske
Veteran Member
Join Date: May 2009
Old 01-16-2013 , 05:18   Re: screen shake effect
Reply With Quote #2

http://wiki.amxmodx.org/Half-Life_1_...ts#ScreenShake

(1<<12) = 1 sec.

Try (1<<12) * 0.5 in amplitude parameter.

PHP Code:
        message_begin(MSG_ONE gMsgScreenShake , {0,0,0} ,id)
        
write_short( (1<<12) * 0.5 );
        
write_short1<<12 );
        
write_short1<<12 );
        
message_end(); 
Kiske is offline
Send a message via Skype™ to Kiske
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-16-2013 , 05:39   Re: screen shake effect
Reply With Quote #3

Kiske, Warning: Tag mismatch on line 39
Trying write_short( (1<<12) * 1/2 );

Tried.. No effect.
__________________
sorry my bad english...

Last edited by alonelive; 01-16-2013 at 05:41.
alonelive is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-16-2013 , 07:06   Re: screen shake effect
Reply With Quote #4

maybe write_short( ( 1<<12 ) * ( 1 / 2 ) );
__________________

Last edited by Bos93; 01-16-2013 at 07:06.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-16-2013 , 10:23   Re: screen shake effect
Reply With Quote #5

1<<11 = 2^11
and so on.
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-17-2013 , 12:03   Re: screen shake effect
Reply With Quote #6

PHP Code:
write_shortFixedUnsigned160.5 1<<12 
PHP Code:
FixedUnsigned16(Float:flValueiScale)
{
    new 
iOutput;

    
iOutput floatround(flValue iScale);

    if ( 
iOutput )
        
iOutput 0;

    if ( 
iOutput 0xFFFF )
        
iOutput 0xFFFF;

    return 
iOutput;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 13:43.


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