Raised This Month: $7 Target: $400
 1% 

Weapon animations...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 12-09-2005 , 15:07   Weapon animations...
Reply With Quote #1

Hello,
I've been trying to write a RPG but unfortunately I've got some trouble with the weapon animations.. I'm using this function, I found it somewhere in the forums:
Code:
set_animation(id, anim) {     entity_set_int(id, EV_INT_weaponanim, anim)     message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, id)     write_byte(anim)     write_byte(entity_get_int(id, EV_INT_body))     message_end() }
It actually looks fine to me but it doesn't work... So, of course, I'm wondering what's wrong with it. Maybe somebody can help me with it.

Thanks in advance.
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 12-09-2005 , 18:34  
Reply With Quote #2

I think all you need is just entity_set_int(id, EV_INT_weaponanim, anim).

The other part of the code looks redundant when you already have entity_set_int(id, EV_INT_weaponanim, anim).

I have tried setting a weapon animation with just entity_set_int(id, EV_INT_weaponanim, anim) and it works fine with me when I use custom weapon models. You only need the first line to do your weapon animation.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 12-09-2005 , 18:45  
Reply With Quote #3

the code above works as long as you press the key bound to +attack BUT it stops when you release it... that's my problem
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-10-2005 , 12:11  
Reply With Quote #4

Quote:
Originally Posted by Basic-Master
the code above works as long as you press the key bound to +attack BUT it stops when you release it...
Weapons automatically revert to their idle animation after being idle for a set period of time.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 12-11-2005 , 11:25   Re: Weapon animations...
Reply With Quote #5

Quote:
Originally Posted by Basic-Master
I found it somewhere in the forums:
I believe it was in one of my posts ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Reply


Thread Tools
Display Modes

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 22:18.


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