I think that if you look at screenFADE_util thread, you can find a post from arkshine with another stock, for make screenshake according to distance from a specific origin.
Following one is a simple stock with float input values.
PHP Code:
// ScreenShake
stock Util_ScreenShake(id, Float:duration, Float:frequency, Float:amplitude)
{
static ScreenShake = 0;
if( !ScreenShake )
{
ScreenShake = get_user_msgid("ScreenShake");
}
message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, ScreenShake, _, id);
write_short( FixedUnsigned16( amplitude, 1<<12 ) ); // shake amount
write_short( FixedUnsigned16( duration, 1<<12 ) ); // shake lasts this long
write_short( FixedUnsigned16( frequency, 1<<8 ) ); // shake noise frequency
message_end();
}
stock FixedUnsigned16( Float:value, scale )
{
new output;
output = floatround(value * scale);
if ( output < 0 )
output = 0;
if ( output > 0xFFFF )
output = 0xFFFF;
return output;
}
__________________