Raised This Month: $ Target: $400
 0% 

Help getting models frame


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shine771
Senior Member
Join Date: Jun 2007
Old 05-09-2009 , 14:20   Help getting models frame
Reply With Quote #1

Hello again. I'm trying to get the models current sequences frame, but seems like pev_frame doesn't work. I tried to store it in both integer and float, but it always returns 0 or 0.0. I tried with AddToFullPack(Es_frame). It always returns 1. I'm trying to catch a frame(ex. 21) and do a specific action when the models animation reaches frame ##(ex. 21).

Thanks.
shine771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-09-2009 , 14:50   Re: Help getting models frame
Reply With Quote #2

pev_frame works fine. You should have something wrong in your code.
Arkshine is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-09-2009 , 14:54   Re: Help getting models frame
Reply With Quote #3

I registered HamThink for "info_target". My entity thinks every 0.01 second. Every think it check entities sequence. If it matches the DEFINEDSEQUENCE then it checks it's frame.
Code:
static Frame
Frame = pev(Entity,pev_frame)
I also tried:
Code:
static Frame
pev(Entity,pev_frame,Frame)
And:
Code:
static Float:Frame
pev(Entity,pev_frame,Frame)
I used log_amx to check the frame. It always returned 0/0.0.
shine771 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-09-2009 , 15:02   Re: Help getting models frame
Reply With Quote #4

http://www.amxmodx.org/funcwiki.php?go=module&id=16

Code:
enum {
	//...
	pev_float_start,
	pev_impacttime,
	pev_starttime,
	pev_idealpitch,
	pev_ideal_yaw,
	pev_pitch_speed,
	pev_yaw_speed,
	pev_ltime,
	pev_nextthink,
	pev_gravity,
	pev_friction,
	pev_frame,
	pev_animtime,
	pev_framerate,
	pev_scale,
	pev_renderamt,
	pev_health,
	pev_frags,
	pev_takedamage,
	pev_max_health,
	pev_teleport_time,
	pev_armortype,
	pev_armorvalue,
	pev_dmg_take,
	pev_dmg_save,
	pev_dmg,
	pev_dmgtime,
	pev_speed,
	pev_air_finished,
	pev_pain_finished,
	pev_radsuit_finished,
	pev_maxspeed,
	pev_fov,
	pev_flFallVelocity,
	pev_fuser1,
	pev_fuser2,
	pev_fuser3,
	pev_fuser4,
	pev_float_end,
	//...
};
pev_frame is a float value, therefore the 3rd way is the only way you can use it:
Code:
new Float:frame; pev(entity, pev_frame, frame);

Quote:
Originally Posted by hleV View Post
What about:
Code:
static Float:Frame Frame = pev(Entity, pev_frame)
pev() returns an integer value.
If you want a Float value from pev(), you must reference the variable.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-09-2009 , 14:59   Re: Help getting models frame
Reply With Quote #5

Code:
set_pev(iEnt, pev_frame, 9999.999999); static Float:fFrame; pev(iEnt, pev_frame, fFrame); server_print("%f", fFrame); // Shows 10000.000000
__________________

Last edited by hleV; 05-09-2009 at 15:09.
hleV is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-09-2009 , 15:02   Re: Help getting models frame
Reply With Quote #6

Haha, it doesn't matter. I tried it without a variable, directly putting into log_amx. I tried %f and %d.
Exolent, i noticed that testing it. Thanks.

Maybe it doesn't work on entities? I've only seen it work on players, cause i've never used it on entities, i've used only sequences and framerate.
shine771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-09-2009 , 15:06   Re: Help getting models frame
Reply With Quote #7

Frame beeing an integer you can use directly pev( entity, pev_frame) without problem here. Are you sure that the sequence is playing ?
Arkshine is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-09-2009 , 15:08   Re: Help getting models frame
Reply With Quote #8

That Exolent didn't even let me to edit the post in time. :@ Anyway, check my edition.
__________________
hleV is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-09-2009 , 16:41   Re: Help getting models frame
Reply With Quote #9

Quote:
Are you sure that the sequence is playing ?
Yes, absolutely. Any ideas?
shine771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-09-2009 , 17:55   Re: Help getting models frame
Reply With Quote #10

No. Is it possible to see your code ?
Arkshine 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:27.


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