Panda Posted December 8, 2014 Share Posted December 8, 2014 Hello everyone! Well It's my first topic over here so.. hope that u guys will help me . Anyway let's move on, Some people knows that Annoying shit "Crouch thing" I mean when i play vs someone with sniper he use C To escape from the shot,I wanna remove this noob trick, Help me please. I started with this, but it's not working! Server Side! function Test(weapon) if ( weapon == 34 ) then toggleControl ( source, "crouch", true) end end addEventHandler ("onPlayerDamage", getRootElement(), Test) Thanks. Link to comment
Panda Posted December 8, 2014 Author Share Posted December 8, 2014 Nope, when we play 1vs1 with sniper only . When i try to hit the enemy he crouch to avoid the bullet. Hope that u'll help me thanks. And the point of my script is when i put the sniper in my hand then i won't be able to crouch, when i change to M4 or something else then i'll be able to crouch and play normal. Thank you. Link to comment
DiSaMe Posted December 8, 2014 Share Posted December 8, 2014 Your script only disables the control when the player is hit by sniper rifle. Instead, you could try disabling crouching ability for the weapon: setWeaponProperty If that doesn't work, then you should detect when the player switches the weapon and enable/disable control depending on which weapon the player switched to: https://wiki.multitheftauto.com/wiki/On ... aponSwitch Link to comment
Panda Posted December 8, 2014 Author Share Posted December 8, 2014 Well mate can you help me with that, setWeaponProperty is made to set the skills and shits not to disable Crouching. ? Thanks. Link to comment
DiSaMe Posted December 8, 2014 Share Posted December 8, 2014 'setWeaponProperty' sets properties of weapons, and the properties vary among different skills. For example, the weapons have better accuracy on higher skills. I'm not sure if the skill is relevant to weapons like sniper rifle, but if so, I'd just unset the crouching flags for all skills for sniper rifle. Link to comment
Panda Posted December 8, 2014 Author Share Posted December 8, 2014 Well can you give me an example? I mean my script won't work, i understand. But can u help me, i mean do u have any idea how to do that? Thanks. Link to comment
DiSaMe Posted December 8, 2014 Share Posted December 8, 2014 Oh, well, I just tried it and it doesn't seem to work. Either I did something wrong or it just doesn't work for sniper rifle. The latter case is more likely, so maybe you should detect when the player switches to/from sniper rifle using "onClientPlayerWeaponSwitch" event and toggle the control from there. Link to comment
Panda Posted December 8, 2014 Author Share Posted December 8, 2014 Alright mate, i'll try it. Link to comment
Panda Posted December 8, 2014 Author Share Posted December 8, 2014 Well done, it's working now. Thanks anyway. 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