Raised This Month: $ Target: $400
 0% 

TE_PLAYERATTACHMENT sprites help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-09-2009 , 14:50   TE_PLAYERATTACHMENT sprites help
Reply With Quote #1

hi , i have 2 sprites one X and another one Y

and i have this code
PHP Code:
new weaponid get_user_weapon(id);
message_begin(MSG_ALLSVC_TEMPENTITY);
write_byte(TE_PLAYERATTACHMENT);
write_byte(id);
write_coord(60);
switch(
weaponid)
{
      case 
CSW_P228:
            
write_short(spriteY);
      case 
CSW_SCOUT
            
write_short(spriteX);


}
write_short(100);
message_end(); 
but doesn't work.. some ideas? :d
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-09-2009 , 14:54   Re: TE_PLAYERATTACHMENT sprites help
Reply With Quote #2

Here is an example that has nothing to do with the thread. (Though it's an awesome one, but has nothing to do with this)
Code:
message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(0)
write_coord() // start position
write_coord()
write_coord()
write_coord() // end position
write_coord()
write_coord()
write_short() // sprite index
write_byte() // starting frame
write_byte() // frame rate in 0.1's
write_byte() // life in 0.1's
write_byte() // line width in 0.1's
write_byte() // noise amplitude in 0.01's
write_byte() // Red
write_byte() // Green
write_byte() // Blue
write_byte() // brightness
write_byte() // scroll speed in 0.1's
message_end()

Last edited by SnoW; 01-09-2009 at 15:46.
SnoW is offline
Send a message via MSN to SnoW
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-09-2009 , 14:58   Re: TE_PLAYERATTACHMENT sprites help
Reply With Quote #3

Quote:
Originally Posted by SnoW View Post
Maybe 60 for cords isn't enough? Here's little example:
Code:
message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(0)
write_coord() // start position
write_coord()
write_coord()
write_coord() // end position
write_coord()
write_coord()
write_short() // sprite index
write_byte() // starting frame
write_byte() // frame rate in 0.1's
write_byte() // life in 0.1's
write_byte() // line width in 0.1's
write_byte() // noise amplitude in 0.01's
write_byte() // Red
write_byte() // Green
write_byte() // Blue
write_byte() // brightness
write_byte() // scroll speed in 0.1's
message_end()

what the .. is that? a full te playerattachment is like this

PHP Code:
message_begin(MSG_ALLSVC_TEMPENTITY);
write_byte(TE_PLAYERATTACHMENT);
write_byte(index);
write_coord(60);
write_short(sprite);
write_short(time);
message_end(); 
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-09-2009 , 16:11   Re: TE_PLAYERATTACHMENT sprites help
Reply With Quote #4

Try
PHP Code:
new weaponid get_user_weapon(id);
message_begin(MSG_ALLSVC_TEMPENTITY);
write_byte(TE_PLAYERATTACHMENT);
write_byte(id);
write_coord(60);
switch(
weaponid)
{
      case 
CSW_P228:
            
write_short(spriteY);
      default: 
            
write_short(spriteX);
}
write_short(100);
message_end(); 
It should work your way though unless there is an error somewhere else.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-09-2009 , 16:24   Re: TE_PLAYERATTACHMENT sprites help
Reply With Quote #5

it works... thx
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
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 09:18.


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