• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Detect Player "Camera" position

Status
Not open for further replies.
GetCameraTargetPositionX()
No, you don't need to. The function itself returns asynchronous value, depending on who's machine it's called.
For example, player 1 is currently looking at the exact center of the map. So the function will return "0" for player 1.
At the very same moment, player 2 is looking at different location, so it will return different value for player 2 (not "0").
I hope you get what I mean.
 
So here's the pseudo code:
Code:
    if IsPlayerInForce(GetLocalPlayer(), ThePlayerGroup) and GetCameraPositionX() > RectMinX and GetCameraPositionX() < RectMaxX and GetCameraPositionY() > RectMinY and GetCameraPositionY() < RectMaxY then
        Do whatever here. But do note that everything's done here will be asynchronous. If you are not careful of what you're doing then it will lead you to desync problem.
    endif
 
Status
Not open for further replies.
Back
Top