How to set enitity's body
Code:
public set_mine(id) {Code:
public pfn_touch(ptr, ptd) { |
Re: How to set enitity's body
You need to set the size after setting the solid type.
Code:
/* Set entity bounds. */ |
Re: How to set enitity's body
Code:
public set_mine(id) { |
Re: How to set enitity's body
And you must spawn it.
Made a few adjustments: Code:
public set_mine(id) {You could easily make one variable, use entity_get_vector(id, EV_VEC_origin, fOrigin) and use -32 or -16 if player is ducking. |
Re: How to set enitity's body
Thanks' for the 'ducking' tip.
Quote:
Even so, code still isn't working properly. Nothing's happening when mine is touched by a player. |
Re: How to set enitity's body
I see you use MOVETYPE_FLY... I recommend using MOVETYPE_TOSS or something, so that the mine falls on it's own.
How do you hook the touch, register_touch() ? See that you don't mix up variables in the function, first it's the ent then the ent touching it and also, see that the classname in the register_touch() is "landmine". |
Re: How to set enitity's body
Well, touch is working for other entities, like rpgrocket, or something (cause I have mixed rpg in it). Only landmine isn't working.
I realized that the condition of my pfn_touch is bad. Code:
if(equal(ClassName, "landmine") && equal(toucherClass, "player"))If i set just: Code:
if(equal(ClassName, "landmine")) |
Re: How to set enitity's body
Maybe try to use register_touch from engine
Code:
register_touch( your_mine_classname, "player", "fn_MineTouch" ) |
Re: How to set enitity's body
Still nothing :/.
I run and jump over the mine, but it's not going to explode anyway. |
Re: How to set enitity's body
Still nothing :/.
I run and jump over the mine, but it's not going to explode anyway. |
| All times are GMT -4. The time now is 00:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.