Product Chat / Get curernt coordinates of an entity

Author
Message
Team wolf
7
Years of Service
User Offline
Joined: 26th Dec 2016
Location:
Posted: 6th Jan 2017 22:24
I want to get the x,y,z pos values and rotation values of an entity with are the comands?
Also i am a bit conused how these work.

function UpdateEntityRT(e,object,x,y,z,rx,ry,rz,ave,act,col,key,zon,ezon,plrvis,hea,frm,pdst,avd,lmb,lmi)
g_Entity[e]['x'] = x;
g_Entity[e]['y'] = y;
g_Entity[e]['z'] = z;
g_Entity[e]['anglex'] = rx;
g_Entity[e]['angley'] = ry;
g_Entity[e]['anglez'] = rz;
g_Entity[e]['obj'] = object;
g_Entity[e]['active'] = ave;
g_Entity[e]['activated'] = act;
g_Entity[e]['collected'] = col;
g_Entity[e]['haskey'] = key;
g_Entity[e]['plrinzone'] = zon;
g_Entity[e]['entityinzone'] = ezon;
g_Entity[e]['plrvisible'] = plrvis;
g_Entity[e]['health'] = hea;
g_Entity[e]['frame'] = frm;
g_Entity[e]['plrdist'] = pdst;
g_Entity[e]['avoid'] = avd;
g_Entity[e]['limbhit'] = lmb;
g_Entity[e]['limbhitindex'] = lmi;
end

I know i am making a lot of questions and thank you for your answers.I hope one day i will be in position to help newcomers
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Jan 2017 00:49
those are the list of variables that store the related data about the entity (referred to as 'e')

so to get the objects' x,y and z position you would need
g_Entity[e]['x']
g_Entity[e]['y']
g_Entity[e]['z']
you can simply Prompt them to show on screen or use them directly like
SetPosition(1,g_Entity[2]['x'],g_Entity[2]['y'],g_Entity[2]['z'])
which would move object 1 to object 2's location.

the angles are the same but you use
g_Entity[e]['angley']
etc
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-11-24 18:41:22
Your offset time is: 2024-11-24 18:41:22