Forum

more help

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

more help

Postby RooT » Thu Sep 08, 2005 11:45 pm

ok thanks for helping with my last question sajt, your names already in my mod 8) 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%
User avatar
RooT
 
Posts: 40
Joined: Wed Sep 07, 2005 1:28 am

Postby Wazat » Thu Sep 08, 2005 11:56 pm

If the scope is called "scope" and "self" is the player, then you would say:
Code: Select all
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: Select all
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.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest