Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,038 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: [ANet] enemy [Re: MasterQ32] #408394
09/30/12 15:32
09/30/12 15:32
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Code:
you=players[enet_ent_creator(enet_ent_globpointer(players[cl_id]))];



I assume that players[] is an array where the local pointer of each player is stored. The index is the client id of the player.

If my assumption is correct, it should be like this (code snippet running in the enemies function):

Code:
// get the pointer to the player
you = players[enet_get_clientid()];
// calc distance between enemy and player
distance = vec_dist(you.x, my.x);



ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] enemy [Re: Dark_samurai] #408407
09/30/12 17:36
09/30/12 17:36
Joined: Sep 2012
Posts: 21
France
larafale Offline OP
Newbie
larafale  Offline OP
Newbie

Joined: Sep 2012
Posts: 21
France
Thanks a lot, it works fine into the real enemy function.

Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1