AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TE_PLAYERATTACHMENT sprites help (https://forums.alliedmods.net/showthread.php?t=83431)

tuty 01-09-2009 14:50

TE_PLAYERATTACHMENT sprites help
 
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

SnoW 01-09-2009 14:54

Re: TE_PLAYERATTACHMENT sprites help
 
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()


tuty 01-09-2009 14:58

Re: TE_PLAYERATTACHMENT sprites help
 
Quote:

Originally Posted by SnoW (Post 741137)
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(); 


Emp` 01-09-2009 16:11

Re: TE_PLAYERATTACHMENT sprites help
 
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.

tuty 01-09-2009 16:24

Re: TE_PLAYERATTACHMENT sprites help
 
it works... thx :)


All times are GMT -4. The time now is 09:18.

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