FireMan
Member
|
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 |
|
Harry
Member
|
RE: How to get player pos ?
try Players[0].pos();
|
|
11-21-2009 03:24 PM |
|
FireMan
Member
|
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 |
|
Seba
Member
|
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 |
|
FireMan
Member
|
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 |
|
Esenthel
Administrator
|
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 |
|
FireMan
Member
|
RE: How to get player pos ?
THX Esenthel
Forum reklamowe: http://ad-forum.pl
|
|
11-21-2009 06:07 PM |
|