is user currently touching entity
so I need some piece of code to check if player or entity is currently touching some other entity :)
something like this: is_entity_touching_entity(ent1,ent2) :) |
Re: is user currently touching entity
I don't know another way than to make a huge array and store last touch gametime and then check if it's touched at least 0.1 seconds ago or something....
Why exacly do you need this ? maybe you can do it in a better way. |
Re: is user currently touching entity
Hook touch for your entities you want to detect touching.
Store last touch get_gametime() in array for players and pev_fuser(1-4) for entities. Then check if (last touch >= (get_gametime() - 0.1)) |
Re: is user currently touching entity
Quote:
Player can press +use and if he's at enemy spawn ( info_player_start and info_player_deathmatch), he can plant flag and get 3 frags :) EDIT: I tryed this, but it isn't working :( PHP Code:
|
Re: is user currently touching entity
Then just use find_ent_in_sphere() with a big enough radius when player uses +use.
And AFAIK, point entities (like info_player_*) don't have collision box therefore they don't trigger touch. |
Re: is user currently touching entity
ok, thanks :)
I will use find_ent_in_sphere to check is there any spawn point near to player :) |
| All times are GMT -4. The time now is 03:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.