Raised This Month: $ Target: $400
 0% 

Detect +USE key


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-10-2007 , 18:56   Re: Detect +USE key
Reply With Quote #1

Fm_CmdStart is called when a command is issued by player.
PreThink is called on every player frame, that means MANY times per second.

Code:
UserCmd Constants 

 // Interpolation time on client
	UC_LerpMsec,		// short
	// Duration in ms of command
	UC_Msec,		// byte
	// Command view angles
	UC_ViewAngles,		// float array[3]
	
	// Intended velocities
	// Forward velocity
	UC_ForwardMove,		// float
	// Sideways velocity
	UC_SideMove,		// float
	// Upward velocity
	UC_UpMove,		// float
	// Light level at spot where we are standing
	UC_LightLevel,		// byte
	// Attack buttons
	UC_Buttons,		// unsigned short
	// Impulse command issued
	UC_Impulse,		// byte
	// Current weapon id
	UC_WeaponSelect,	// byte
	
	// Experimental player impact stuff
	UC_ImpactIndex,		// int
	UC_ImpactPosition	// float array[3]
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 11-13-2007 , 17:08   Re: Detect +USE key
Reply With Quote #2

Quote:
Originally Posted by Alka View Post
Fm_CmdStart is called when a command is issued by player.
PreThink is called on every player frame, that means MANY times per second.

Code:
UserCmd Constants 

 // Interpolation time on client
	UC_LerpMsec,		// short
	// Duration in ms of command
	UC_Msec,		// byte
	// Command view angles
	UC_ViewAngles,		// float array[3]
	
	// Intended velocities
	// Forward velocity
	UC_ForwardMove,		// float
	// Sideways velocity
	UC_SideMove,		// float
	// Upward velocity
	UC_UpMove,		// float
	// Light level at spot where we are standing
	UC_LightLevel,		// byte
	// Attack buttons
	UC_Buttons,		// unsigned short
	// Impulse command issued
	UC_Impulse,		// byte
	// Current weapon id
	UC_WeaponSelect,	// byte
	
	// Experimental player impact stuff
	UC_ImpactIndex,		// int
	UC_ImpactPosition	// float array[3]
Am I the only one who thinks that this is not actually right? Just having something writing into the console every cmdstart showed, that this thing is called as many times as pre/post thinks. Any suggestions?
__________________
alien is offline
Send a message via ICQ to alien
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-13-2007 , 19:48   Re: Detect +USE key
Reply With Quote #3

Quote:
Originally Posted by alien View Post
Am I the only one who thinks that this is not actually right? Just having something writing into the console every cmdstart showed, that this thing is called as many times as pre/post thinks. Any suggestions?
It more than likely is called near enough as pre/post think however this is called upon execution which gives you greater control and flexability with controls etc. Which you cannot get with pre/post.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 11-13-2007 , 20:16   Re: Detect +USE key
Reply With Quote #4

Thank you Orangutanz. May I have a couple of questions?

What are these?

#define FMRES_HANDLED 2 // Probably to block forward into the engine?
#define FMRES_SUPERCEDE 4 // To pass forward into the engine?
#define FMRES_IGNORED 1 // To ... well.
#define FMRES_OVERRIDE 3 // To lol. No idea!

And what's random_seed parameter?
__________________
alien is offline
Send a message via ICQ to alien
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-14-2007 , 08:38   Re: Detect +USE key
Reply With Quote #5

Quote:
Originally Posted by alien View Post
Thank you Orangutanz. May I have a couple of questions?

What are these?

#define FMRES_HANDLED 2 // Probably to block forward into the engine?
#define FMRES_SUPERCEDE 4 // To pass forward into the engine?
#define FMRES_IGNORED 1 // To ... well.
#define FMRES_OVERRIDE 3 // To lol. No idea!

And what's random_seed parameter?
See here about the handling defines:
MetaMod Coding

random_seed will be as it suggests (random numbers), looking deeper at it obviously there is something which is random within the structure of CmdStart possibly UC_LerpMsec or UC_Msec, unsure exactly where it is used.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz 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 01:13.


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