OrbTanT Posted July 23, 2014 Share Posted July 23, 2014 I am using the resource "interiors" of the mta, and I would like to take the weapons when the player is within the interiors or not shoot within the same, I thought in this script, I don't know if the correct is put within the script of "interiors" for working. addEventHandler("onClientRender", root, function() local i = getElementInterior(localPlayer) if (i ~= 0) then toggleControl("fire", false) -- desabilita o tiro e o soco else toggleControl("fire", true) end end) OR if you have other means to remove the weapons and "fire" within the interiors Link to comment
Bonsai Posted July 23, 2014 Share Posted July 23, 2014 You shouldn't do such things onClientRender, since its for supposed to be for drawing things and this usage might make players lag. Try to use onClientPlayerWeaponFire and check for the interior there. Link to comment
OrbTanT Posted July 23, 2014 Author Share Posted July 23, 2014 In the case I have to check if the player is in a different interior 0, I will confer Link to comment
OrbTanT Posted July 23, 2014 Author Share Posted July 23, 2014 The script now checks to see if a player is in a different interiors 0, even so is not working. addEventHandler("onClientPlayerWeaponFire", root, function() local i = getElementInterior(localPlayer) if (i ~= 0) then toggleControl("fire", false) -- desabilita o tiro e o soco else toggleControl("fire", true) end end) 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