Raised This Month: $ Target: $400
 0% 

SlowMotion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-08-2013 , 19:43   SlowMotion
Reply With Quote #1

Is there anyway to make slow motion game for 5 seconds every 10 minutes? Or will i have to change player speed and weapon speed?
__________________
Jhob94 is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 08-08-2013 , 20:14   Re: SlowMotion
Reply With Quote #2

Found this but im on my phone right know. I think you got knowledge to Edit it
Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <xs>

#define PLUGIN	"Slowmotion"
#define AUTHOR	"DarkGL"
#define VERSION	"1.0"

#define MAX 32

new bool: bSlow[ MAX + 1 ] ,
	Float: oldVeloc[ MAX + 1 ][ 3 ] ,
	Float: fTime[ MAX + 1 ] ,
	pGrav ,
	pSlowSpeed ;
	
new const Float:g_fWeaponsSpeed[ ]={
	000.0,
	250.0, 000.0, 260.0, 250.0, 240.0, 
	250.0, 250.0, 240.0, 250.0, 250.0,                
	250.0, 250.0, 210.0, 240.0, 240.0,    
	250.0, 250.0, 210.0, 250.0, 220.0,              
	230.0, 230.0, 250.0, 210.0, 250.0,            
	250.0, 235.0, 221.0, 250.0, 245.0 
};

public plugin_init(){
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd( "say /slow" , "voidSlow" );
	
	pGrav		=	get_cvar_pointer( "sv_gravity" );
	pSlowSpeed	=	register_cvar( "amx_slowmo" , "0.3" );
}

public client_connect( id ){
	bSlow[ id ]	=	false;
}

public voidSlow( id ){
	
	bSlow[ id ]	=	!bSlow[ id ];
	
	if( bSlow[ id ] ){
		pev( id , pev_velocity , oldVeloc[ id ] );
		fTime[ id ]	=	get_gametime();
	}
	else{
		engfunc( EngFunc_SetClientMaxspeed , id , g_fWeaponsSpeed[ get_user_weapon( id ) ] );
	}
	
	return PLUGIN_HANDLED;
}

public client_PreThink( id ){
	if( !is_user_alive( id ) || !bSlow[ id ] ){
		return PLUGIN_CONTINUE;
	}
	
	new Float: fVeloc[ 3 ] ,
		Float: fOrigin[ 3 ] ,
		Float: SLOW_SPEED ;
	
	SLOW_SPEED	=	get_pcvar_float( pSlowSpeed );
		
	pev( id , pev_origin , fOrigin );
	pev( id , pev_velocity ,fVeloc  );
	
	if( !( -0.01 <= fVeloc[ 0 ] - oldVeloc[ id ][ 0 ] <= 0.01 ) ){
		fVeloc[ 0 ] -=	oldVeloc[ id ][ 0 ];
		fVeloc[ 0 ]	*= SLOW_SPEED;
		
		oldVeloc[ id ][ 0 ] += fVeloc[ 0 ];
	}
	if( !( -0.01 <= fVeloc[ 1 ] - oldVeloc[ id ][ 1 ] <= 0.01 ) ){
		fVeloc[ 1 ] -=	oldVeloc[ id ][ 1 ];
		fVeloc[ 1 ]	*= SLOW_SPEED;
		
		oldVeloc[ id ][ 1 ] += fVeloc[ 1 ];
	}
	
	new Float: fTimeSub	=	get_gametime() - fTime[ id ];
	
	fTime[ id ]	=	get_gametime();
	
	fOrigin[ 2 ]	-=	floatmul( fVeloc[ 2 ] , fTimeSub );
	fOrigin[ 2 ]	+=	floatmul( fVeloc[ 2 ] , fTimeSub * SLOW_SPEED );
	
	if( !( pev( id , pev_flags ) & FL_ONGROUND ) && ! ( pev( id , pev_flags ) & FL_PARTIALGROUND ) ){
		
		fVeloc[ 2 ] +=	floatmul( pev( id , pev_gravity ) * get_pcvar_float( pGrav ) , fTimeSub );
		fVeloc[ 2 ]	-=	floatmul( pev( id , pev_gravity ) * get_pcvar_float( pGrav ) , fTimeSub * SLOW_SPEED );
	}
	
	oldVeloc[ id ][ 2 ]	=	fVeloc[ 2 ];
	
	fTime[ id ]	=	get_gametime();
	
	engfunc( EngFunc_SetOrigin , id , fOrigin );
	set_pev( id , pev_velocity , oldVeloc[ id ] );
	set_pev( id , pev_framerate , SLOW_SPEED );
	
	engfunc( EngFunc_SetClientMaxspeed , id , g_fWeaponsSpeed[ get_user_weapon( id ) ] * SLOW_SPEED );
	
	return PLUGIN_CONTINUE;
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 08-08-2013 at 20:16.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-08-2013 , 20:35   Re: SlowMotion
Reply With Quote #3

I will test it tomorrow
__________________
Jhob94 is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-09-2013 , 17:21   Re: SlowMotion
Reply With Quote #4

That's slow speed, you have to reduce speed on everything (I mean frames)
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-10-2013 , 04:42   Re: SlowMotion
Reply With Quote #5

This might be stupid suggestion. But sv_maxspeed might help? I use it with my nuke strike section. Every thing slows down. Apart from if you jump. It does not slow down jumping.
__________________
Blizzard_87 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-10-2013 , 08:12   Re: SlowMotion
Reply With Quote #6

Well this was my idea:
When someone get hited twice with amount of 15hp each hit, all get slow for 3 seconds and who was hited move normal and play a sound like adrenaline effect.
__________________

Last edited by Jhob94; 08-10-2013 at 08:12.
Jhob94 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 15:56.


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