DarkByte Posted September 18, 2015 Posted September 18, 2015 Hi. Can someone help me with a script? Its like when player not aiming and press mouse1 button or left button from mouse he is shooting. But i wanna make it only when aiming to shoot When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
DarkByte Posted September 18, 2015 Author Posted September 18, 2015 Im still learning please make a example When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
JR10 Posted September 18, 2015 Posted September 18, 2015 addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
DarkByte Posted September 18, 2015 Author Posted September 18, 2015 Not working When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
HUNGRY:3 Posted September 18, 2015 Posted September 18, 2015 Not working lol it works but jr forgot lua tag addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end(
DarkByte Posted September 18, 2015 Author Posted September 18, 2015 Not working lol it works but jr forgot lua tag addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end( addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end) Still not working When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
JR10 Posted September 18, 2015 Posted September 18, 2015 Had a syntax error. addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end) You check use /debugscript 3 to check for errors yourself. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Moderators IIYAMA Posted September 18, 2015 Moderators Posted September 18, 2015 This event is called when a player fires a weapon. onClientPlayerWeaponFire is triggers after the bullet has been fired, that's why there is no info on the wiki about cancelEvent. And if it did, these parameters wouldn't make any sense:(hitX, hitY, hitZ, hitElement) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DarkByte Posted September 19, 2015 Author Posted September 19, 2015 Still not working +No errors in debug When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
DarkByte Posted September 19, 2015 Author Posted September 19, 2015 Ive fixed it. When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
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