Anyone have the answer to this
I am trying to attach a model to a player, I have the model in both the valve/models directory and cstrike/models called roots2.mdl
Here is the source: Code:
When the test_sprite() routine is called I see this in console: No model 1200! No model 1424! I know these models exist, I saw the download message when I first connected and the .dml file was precached... Anyone have the answer? Thanks -Mug |
Hi,
I have used the TE_PLAYERATTACHMENT tempentity in my superkeeper plugin. The only differency i found is this: Code:
As you can see, the player id is a byte and not short; making it a short would mess up offsets when reading and you would get bad values (that's probably why it can't find the model: the id is messed up) Also note that the write_coord only specifies a relatie value I believe the origin of the model is the origin of the player with z value += the offset. So you would set it to 50 rather than playerZ + 50. Hope this help :) |
PM, thank you very much, that post cleared up everything for me... :)
-Mug |
Actually, I do have one more question (dont we always). ;)
Is there a way to display the playerattachment to a set of players, for example just the CT team, as opposed to the one player its attached to or everyone? I am unfamilar with the variations on MSG_BROADCAST, MSG_ALL and if they can be masked or set for just a single player of group of players. Thanks! -Mug |
Loop through all the players, and send it as MSG_ONE
example of a message_begin using MSG_ONE: message_begin(MSG_ONE,SVC_TEMPENTITY,{0,0,0}, idPlayer) |
I'd say loop through the players and send it using MSG_ALL.
Sending with MSG_ONE will make sure only one player sees the attachement. I posted info about MSG_** on the old amx forums some time ago (pretty long time ago) (cant find it anymore, argh) Code:
#define MSG_BROADCAST 0 // unreliable to allMost important ones: MSG_BROADCAST - send to all players, unreliable stream MSG_ALL - send to all players, reliable stream MSG_ONE_UNRELIABLE - send to one player, unreliable stream MSG_ONE - send to one player, reliable stream the PAS and PVS stuff are about what the player hears / sees I think (something like that it was :D ) Now the TE_PLAYERATTACHMENT tempentity takes the player id, so sending it to all players will display an attachment on the id on all player's screens, but sending it to id only will display it only on his screen. Hope this helps :D |
PM, my question is if I only wanted the CT team to see the message wouldnt I have to loop and only send it to one id at a time? If not I'm confused why MSG_ALL would accomplish that.
I'm also wondering if PLAYERATTACHMENT is the right message to be using. Basically I want to display a model surrounding the player's model based on their location at the specific time (the player will then be held in place for a set duration)... If I use PLAYERATTACH when the player ducks or jumps the attached model moves with them, is there a better way to create the model so it doesn't move with the player? I tried message # 17 (TE_SPRITE) but it displayed the model as a ghostform, was mostly transparent and whiteish, while the other message displays the correct model... -Mug |
When you send a message using MSG_ONE, only one client will receive it. So when you send a TE_PLAYERATTACHMENT using MSG_ONE, only one client will see the attachment.
You can specify which players will see the attachment. OMG now i read your messages again and found that that you WANT that only some players will see it; sorry! :D |
Thanks PM, I was getting worried.
Is there a better way to position a model at a specific location so it doesn't move with the player, is creating an entity with that model the only way to do that? -Mug |
| All times are GMT -4. The time now is 17:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.