This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

how to make shake?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 09-27-2012 , 07:38   how to make shake?
Reply With Quote #1

how to make shake like in this video? in sourcepawn
http://www.youtube.com/watch?v=0CtAsCmFc98

amxx: http://forums.alliedmods.net/showthread.php?p=1087040

PHP Code:
UTIL_FixedUnsigned16 ( const Float:Value, const Scale ) {
    return 
clampfloatroundValue Scale ), 00xFFFF ); // unknown function for sourcepawn
}

public 
Shake(id)
{
    new 
Dura UTIL_FixedUnsigned16(4.0<< 12)
    new 
Freq UTIL_FixedUnsigned16(0.7 << 8)
    new 
Ampl UTIL_FixedUnsigned16(20.0<< 12)
    
    
message_begin(MSG_ONE MsgScreenShake , {0,0,0} ,id)
    
write_shortAmpl // --| Shake amount.
    
write_shortDura // --| Shake lasts this long.
    
write_shortFreq // --| Shake noise frequency.
    
message_end ()
}

public 
FlashEvent(id)
{
    
set_pev(idpev_punchangleFloat:{125.0125.0125.0})
    
set_task(3.0"Shake"id// Every 3.0 seconds?!

__________________

Last edited by neatek; 09-27-2012 at 07:54.
neatek is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 09-27-2012 , 07:40   Re: how to make shake?
Reply With Quote #2

Use the "Shake" usermessage
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 09-27-2012 , 07:42   Re: how to make shake?
Reply With Quote #3

Quote:
Originally Posted by minimoney1 View Post
Use the "Shake" usermessage
okay, i will try... thx , but i know it...

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_blind"nK_FlashBang);
}

public 
nK_FlashBang(Handle:Event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(Event,"userid"));
    
CreateTimer(4.0ShakeCameraclient);
}

public 
Action:ShakeCamera(Handle:timerany:client)
{
    if(
Client_IsIngame(client) && Client_IsValid(client))
    {
        
ScreenShake(client50.06.00.1);
    }
}

stock ScreenShake(targetFloat:intensity=30.0Float:duration=10.0Float:frequency=3.0)
{
    new 
Handle:bf
    if ((
bf StartMessageOne("Shake"target)) != INVALID_HANDLE)
    {
        
BfWriteByte(bf0);
        
BfWriteFloat(bfintensity);
        
BfWriteFloat(bfduration);
        
BfWriteFloat(bffrequency);
        
EndMessage();
    }

What values ​​for the frequency and others need to be?
__________________

Last edited by neatek; 09-27-2012 at 07:52.
neatek is offline
wanted2411
Senior Member
Join Date: Jun 2012
Old 09-27-2012 , 09:27   Re: how to make shake?
Reply With Quote #4

Duration = 4.0,
Frequency = 0.7,
Intensity = 20.0.

Last edited by wanted2411; 09-27-2012 at 09:28.
wanted2411 is offline
Hunter S. Thompson
Senior Member
Join Date: Jun 2012
Old 09-27-2012 , 09:49   Re: how to make shake?
Reply With Quote #5

The Shake Screen thing makes guns go all wonky. It'll throw guns everywhere, no idea why.
Hunter S. Thompson is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-27-2012 , 10:44   Re: how to make shake?
Reply With Quote #6

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_blind"blind);
}

public 
blind(Handle:Event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(Event,"userid"));
    new 
Float:duration GetEntPropFloat(clientProp_Send"m_flFlashDuration");

    
//SetEntPropFloat(client, Prop_Send, "m_flFlashMaxAlpha", 0.5); // Use this to remove flash if you want see result

    
if(duration 2.0)
    {
        
duration *= 100.0;

        new 
Float:vec[3];
        
vec[0] = GetRandomFloat(-durationduration);
        
vec[1] = GetRandomFloat(-durationduration);
        
vec[2] = GetRandomFloat(-durationduration);
        
SetEntPropVector(clientProp_Send"m_vecPunchAngle"vec);
    }

*edit
What differences
ViewPunch

Shake
__________________
Do not Private Message @me

Last edited by Bacardi; 09-27-2012 at 13:01.
Bacardi is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 09-27-2012 , 11:28   Re: how to make shake?
Reply With Quote #7

Bacardi;
thx for you help! very helpful
__________________

Last edited by neatek; 09-29-2012 at 08:48.
neatek is offline
zack807
Member
Join Date: Jan 2012
Location: brunei
Old 10-06-2012 , 04:28   Re: how to make shake?
Reply With Quote #8

can this plugin change it??? when been knife the player will get shake like this...
zack807 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-06-2012 , 06:27   Re: how to make shake?
Reply With Quote #9

Quote:
Originally Posted by zack807 View Post
can this plugin change it??? when been knife the player will get shake like this...
yes
Bacardi is offline
InB
AlliedModders Donor
Join Date: Aug 2012
Location: Los Angeles
Old 10-12-2012 , 00:30   Re: how to make shake?
Reply With Quote #10

How about when player spawns, can u make their screen shake for 3-5 seconds, just to make spawning a bit cooler?
InB 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 08:34.


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