Raised This Month: $51 Target: $400
 12% 

Change hight of entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xandaros
Junior Member
Join Date: Aug 2007
Old 08-31-2008 , 10:39   Change hight of entities
Reply With Quote #1

Hey folks,
I want to change the y axis of an entity with 2 commands.

Every time you execute one of the commands, it will move 1 unit up/down.

How do I do that?

Xan

PS: I never scripted something for amxx...
Xandaros is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-31-2008 , 13:24   Re: Change hight of entities
Reply With Quote #2

Do you mean change its size or its origin?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 08-31-2008 , 13:54   Re: Change hight of entities
Reply With Quote #3

Code:
//Fakemeta way: new origin[3] pev(ent, pev_origin, origin) engfunc(EngFunc_SetOrigin, ent, origin)   //Engine way: new Float:origin[3] entity_get_vector(ent, EV_VEC_ORIGIN, origin) entity_set_vector(ent, EV_VEC_ORIGIN, origin)   origin[0] = X coordinate origin[1] = Y coordinate origin[2] = Z coordinate

Last edited by [X]-RayCat; 08-31-2008 at 14:20.
[X]-RayCat is offline
Xandaros
Junior Member
Join Date: Aug 2007
Old 08-31-2008 , 13:57   Re: Change hight of entities
Reply With Quote #4

Ah... Very well

Okay... And how do I reposition entities? I don't mean yourself... I mean the entity you are currently aiming at. How is that possible?

Xan

@Exolent:
I thought it's impossible to change the size of entities Oo (at least point entities)
Xandaros is offline
Old 08-31-2008, 14:12
[X]-RayCat
This message has been deleted by [X]-RayCat. Reason: .. :)
Xandaros
Junior Member
Join Date: Aug 2007
Old 08-31-2008 , 14:16   Re: Change hight of entities
Reply With Quote #5

Sorry, I don't understand that code^^

Can you please explain:
pev
engfunc
prameters of entity_[get/set]_vector

Thanks in advance,
Xan
Xandaros is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 08-31-2008 , 14:18   Re: Change hight of entities
Reply With Quote #6

Take a look at Engine module

Take a look at Fakemeta module

;)
[X]-RayCat is offline
Xandaros
Junior Member
Join Date: Aug 2007
Old 08-31-2008 , 14:26   Re: Change hight of entities
Reply With Quote #7

I don't understand this page you sent me... Sorry^^
I don't understand the most documentations...

however

As far as i can see, this only set's the position of the entity "ent"...

How do I get the entity, the command executing player(or spectator), is looking at?

This way I can store it in "ent"...

I think I've understood the Engine way...

Long text... my question for short:
How to store the entity, you are looking at, in a variable?

Xan
Xandaros is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 08-31-2008 , 14:39   Re: Change hight of entities
Reply With Quote #8

Quote:
Originally Posted by Xandaros View Post
I don't understand this page you sent me... Sorry^^
I don't understand the most documentations...

however

As far as i can see, this only set's the position of the entity "ent"...

How do I get the entity, the command executing player(or spectator), is looking at?

This way I can store it in "ent"...

I think I've understood the Engine way...

Long text... my question for short:
How to store the entity, you are looking at, in a variable?

Xan
I dont know how you can't understand the fakemeta way.

Code:
//look at the pev_* constants in the link i gave you set_pev(index, pev_*, ...) //set pev(index, pev_*, ...) //get   Engine EV_* works the same way.. :)

I suggest you to scroll all the functions on the both links.

Last edited by [X]-RayCat; 08-31-2008 at 14:41.
[X]-RayCat is offline
Xandaros
Junior Member
Join Date: Aug 2007
Old 08-31-2008 , 14:42   Re: Change hight of entities
Reply With Quote #9

Ah... however^^
How do I store an entity in a variable?

Xan
Xandaros is offline
Xandaros
Junior Member
Join Date: Aug 2007
Old 08-31-2008 , 15:00   Re: Change hight of entities
Reply With Quote #10

That's what I've done now:

Code:
#include <amxmodx>
register_clcmd("e_up", "MoveEntUp",0, "")
register_clcmd("e_down", "MoveEntDown",0, "")

public MoveEntUp() {
    new ent;
    new Float:origin[3]
    entity_get_vector(ent, EV_VEC_ORIGIN, origin)
    origin[2] = origin[2] + 1
    entity_set_vector(ent, EV_VEC_ORIGIN, origin)
}
I think the only thing I haven't got is, setting the "ent" value...

How do I do that?
Have I forgot anything else?

Please help,
Xan
Xandaros is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode