Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

more help

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
RooT Joined: 07 Sep 2005 Posts: 40 |

Posted: Thu Sep 08, 2005 11:45 pm Post subject: more help |

ok thanks for helping with my last question sajt, your names already in my mod now another question. how do i use the drawtoclientonly feature of db? i am making a scope for my sniper rifle and i want it to only show up for the client that is using it, obviously. just a quick tutorial on this function would be much appreciated, check out my site too i added a litlle bit. http://www.angelfire.com/ult/td
-Root one
_________________
My mod site!
Mod Status:
Turret Defense: 30%
UPS: 45%

Back to top |

Wazat Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA |

Posted: Thu Sep 08, 2005 11:56 pm Post subject: |

If the scope is called "scope" and "self" is the player, then you would say:

Code:
scope.drawonlytoclient = self;

Then the scope will only draw itself to self (the player). You could also use scope.owner instead of self, or whatever is appropriate.
Another good thing you could do instead is set scope.viewmodelforclient, which does several things:

Makes the scope only visible to the player
Makes the scope automatically move with the player without lagging
Causes the scope turn with the player's vision perfectly
Allows you to set the scope's origin relative to the player instead of relative to world (so '0 0 10' is 10 units above the player's screen center).

To make the scope do this, write this code:

Code:
scope.viewmodelforclient = self; scope.origin = '4 0 10'; // 10 units above the player's view origin and slightly to the right scope.angles = '0 0 0'; // no angle offset, just point straight

I think that's all you need. DPExtensions.qc is a good place to check for info on that stuff, so definitely look at that. There are several options I've forgotten to mention.
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group