About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
How to get player pos ?
Author Message
FireMan Offline
Member

Post: #1
How to get player pos ?
Hello. I use tut 16 - Camera Modes.cpp. How to get player pos ? How to display the position of a player (player set in the World Editor). If player enter the positions 0,0,0 player changed the hand animation or make screenshot. How to do that ?

Forum reklamowe: http://ad-forum.pl
11-21-2009 01:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #2
RE: How to get player pos ?
try Players[0].pos();
11-21-2009 03:24 PM
Visit this user's website Find all posts by this user Quote this message in a reply
FireMan Offline
Member

Post: #3
RE: How to get player pos ?
Code:
Vec pos2(0,0,0);

...

if(Players[0].pos=pos2)
{
    sound.volume(20);
}

error C2659: '=' : function as left operand

OR

Code:
Vec pos2(0,0,0);

...

if(Players[0].pos(pos2))
{
    sound.volume(20);
}

error C2451: conditional expression of type 'void' is illegal

What i doing wrong ?

Forum reklamowe: http://ad-forum.pl
11-21-2009 04:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Seba Offline
Member

Post: #4
RE: How to get player pos ?
This:
if(Players[0].pos=pos2)
Change to:
if(Players[0].pos==pos2)
11-21-2009 05:38 PM
Find all posts by this user Quote this message in a reply
FireMan Offline
Member

Post: #5
RE: How to get player pos ?
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'overloaded-function' (or there is no acceptable conversion)

Forum reklamowe: http://ad-forum.pl
11-21-2009 05:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: How to get player pos ?
pos -> pos()
and operator== won't do any good, you need to use distance function

if(Dist(pos(),pos)<=2 meters)
11-21-2009 05:42 PM
Find all posts by this user Quote this message in a reply
FireMan Offline
Member

Post: #7
RE: How to get player pos ?
THX Esenthel

Forum reklamowe: http://ad-forum.pl
11-21-2009 06:07 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply