mcer Posted October 6, 2013 Share Posted October 6, 2013 When someone changes his weapon, I want to start a function, and that over a period of time this function have to finish. I tried with this "onClientPlayerWeaponSwitch" but when I tried to use it, the function only has ended in a period of less than 1 second. Can anyone help me?. Link to comment
Ab-47 Posted October 6, 2013 Share Posted October 6, 2013 (edited) I guess that's the only function you can use, you can also try to trigger an event when the weapon switch event is triggered, like: function WeaponSwitch() triggerEvent("Weapon.WepFunction", source) end addEventHandler("onClientPlayerWeaponSwitch", root, WeaponSwitch) function WepFunction() outputChatBox("Weapon Switched") end addEvent("Weapon.WepFunction", true) addEventHandler("Weapon.WepFunction", root, WepFunction) Edited October 6, 2013 by Guest Link to comment
Castillo Posted October 6, 2013 Share Posted October 6, 2013 You forgot the quotes at triggerEvent. Link to comment
Ab-47 Posted October 6, 2013 Share Posted October 6, 2013 You forgot the quotes at triggerEvent. Sorry, fixed ._. Link to comment
mcer Posted October 6, 2013 Author Share Posted October 6, 2013 You forgot the quotes at triggerEvent. Sorry, fixed ._. What I want is: That function has multiple DXtext and DXimages. Appear over a period of time. Link to comment
myonlake Posted October 6, 2013 Share Posted October 6, 2013 Then you have to make a timer, set its interval to your choice of time and make it run once. If the timer is already pending then cancel the function. Otherwise pass the function to client-side and trigger some renderer to draw DirectX. Link to comment
mcer Posted October 6, 2013 Author Share Posted October 6, 2013 Then you have to make a timer, set its interval to your choice of time and make it run once. If the timer is already pending then cancel the function. Otherwise pass the function to client-side and trigger some renderer to draw DirectX. Can you make an example?. I used "setTimer" before making this post. Link to comment
mcer Posted October 6, 2013 Author Share Posted October 6, 2013 What I would like to make is something like when you change the radio station. A text appears for a few seconds. But, what would appear in this case would be a set of DXimages and DXText for (example); 5 seconds and after that it disappears. Link to comment
pa3ck Posted October 6, 2013 Share Posted October 6, 2013 Well what if you use a timer and set the execution time to the number you want to execute it and create an other timer whick kills the first timer? setTimer killTimer Link to comment
mcer Posted October 6, 2013 Author Share Posted October 6, 2013 Well what if you use a timer and set the execution time to the number you want to execute it and create an other timer whick kills the first timer? setTimer killTimer When i use the setTimer, It only appear when you scroll the mouse and disappear in less than a second. Link to comment
pa3ck Posted October 6, 2013 Share Posted October 6, 2013 Well what if you use a timer and set the execution time to the number you want to execute it and create an other timer whick kills the first timer? setTimer killTimer When i use the setTimer, It only appear when you scroll the mouse and disappear in less than a second. Did you trigger the event? Or just set a timer on the 'onClientPlayerWeaponSwitch' Link to comment
mcer Posted October 6, 2013 Author Share Posted October 6, 2013 Well what if you use a timer and set the execution time to the number you want to execute it and create an other timer whick kills the first timer? setTimer killTimer When i use the setTimer, It only appear when you scroll the mouse and disappear in less than a second. Did you trigger the event? Or just set a timer on the 'onClientPlayerWeaponSwitch' Yes, I did. Link to comment
Moderators Citizen Posted October 8, 2013 Moderators Share Posted October 8, 2013 Can you post again your code as it is right now ? Thanks Link to comment
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