Raised This Month: $51 Target: $400
 12% 

help shake


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tolpecek
Member
Join Date: Dec 2018
Old 12-27-2018 , 11:12   help shake
Reply With Quote #1

Hello, need help again
it should be black and shake but i do nothing. thanks a lot again
Code:
#define SHAKE_AMPLITUDE    16.0    // max = 16.0
#define SHAKE_DURATION    6.0        // max = 16.0
#define SHAKE_FREQUENCY    100.0    // max = 256.0
Code:
if (equali(arg1, "/zariche") == 1)
    {
	ScreenFade_Zariche(id)
	return PLUGIN_HANDLED
}
Code:
public ScreenFade_Zariche(id)
{
	print_color(id, "Napisal si zariche") // jsut check if function was called
	new players[32], num
	//get_players(players, num, "ace", "CT")
	get_players(players, num);

	new shakeAmplitude = __FixedUnsigned16(SHAKE_AMPLITUDE, 1<<12)
	new shakeDuration  = __FixedUnsigned16(SHAKE_DURATION, 1<<12)
	new shakeFrequency = __FixedUnsigned16(SHAKE_FREQUENCY, 1<<9)

	for(--num; num>=0; num--)
	{
		message_begin(MSG_ONE, gmsgShake, .player = players[num])
		{
		write_short( shakeAmplitude )  // shake amount.
		write_short( shakeDuration )   // shake lasts this long.
		write_short( shakeFrequency )  // shake noise frequency.
	}
	message_end()


	message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, players[num]);
	{
	write_short(4096*10);    // Duration
	write_short(4);    // Hold time 4096*2
	write_short(4096);    // Fade type
	write_byte(0);        // Red
	write_byte(0);        // Green
	write_byte(0);        // Blue
	write_byte(255);    // Alpha
	}
	message_end();
	}	
return PLUGIN_HANDLED
}
Code:
__FixedUnsigned16(Float:flValue, iScale)
{
	new iOutput;

	iOutput = floatround(flValue * iScale)

	if ( iOutput < 0 )
		iOutput = 0

	if ( iOutput > 0xFFFF )
		iOutput = 0xFFFF
	
	return iOutput
}
tolpecek is offline
LondoN
Senior Member
Join Date: Dec 2015
Location: Roman, Romania.
Old 12-27-2018 , 17:32   Re: help shake
Reply With Quote #2

Code:
		message_begin ( MSG_ONE_UNRELIABLE, ScreenShake, {0,0,0}, Players [ i ] );
		write_short ( 1<<14 );
		write_short ( 1<<14 );
		write_short ( 1<<14 );
		message_end ( );
it's works fine this part of code for me.
__________________
LondoN 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:11.


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