capitanazop Posted October 28, 2008 Posted October 28, 2008 hi, when i wanna create a object system when you touch a the object in movement you loose hp. what function i need? i search but i dont find any function like OnplayerTouchObject. bye n sorry for ma english
50p Posted October 29, 2008 Posted October 29, 2008 http://development.mtasa.com/index.php? ... yerContact
robhol Posted October 29, 2008 Posted October 29, 2008 http://development.mtasa.com/index.php?title=OnPlayerContact AFAIK this only triggers when the player actually jumps onto an element, not just touching it or colliding with it.
50p Posted October 29, 2008 Posted October 29, 2008 http://development.mtasa.com/index.php?title=OnPlayerContact AFAIK this only triggers when the player actually jumps onto an element, not just touching it or colliding with it. That's what he wants... Or maybe he wants an event that is triggered on ever server pulse? There isn't such event and won't be... That's why we have onClientRender. You can add some data to player (setElementData) that says you are touching object, then you can check (getElementData) if he's touching object in both server-side and client-side scripts. But from what I understand he wants to take away players' hp when touch (contact) with object. If you want to make an object be like a "fire ground" that if you walk on it your hp goes down, you should use timers (server-side) or onClientRender (client-side).
robhol Posted October 29, 2008 Posted October 29, 2008 IT sounds like he wants to make a moving object that knocks some HP off ya, but.. it's not really too well explained. Can you clarify a bit, cap?
capitanazop Posted October 31, 2008 Author Posted October 31, 2008 i wanna a object whit move and if this touch you loose hp.
aralmo Posted October 31, 2008 Posted October 31, 2008 I think you can do it with something like that on clientSide using the onClientRender event. local sphere = createColSphere( posX, posY, posZ, radius ) local closePlayers = getElementsWithinColShape( sphere, "player" ) The sphere should be the collision area of the damaging object, and the closePlayers are the players currently hitting it.
robhol Posted October 31, 2008 Posted October 31, 2008 I think you can do it with something like that on clientSide using the onClientRender event. local sphere = createColSphere( posX, posY, posZ, radius ) local closePlayers = getElementsWithinColShape( sphere, "player" ) The sphere should be the collision area of the damaging object, and the closePlayers are the players currently hitting it. Not exactly a good idea, because if players stay in the colshape, they'd keep being raped. Better to use an event.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now