|H|TiTanium Posted June 18, 2013 Share Posted June 18, 2013 So, now, I'm trying to make an Event's Area, where players can't kill each others. It worked, but when player leaves Area he can't aim, or fire ( I know I've set fire and aim_weapon as false ) . The problem is that I want to make them allowed to shoot and kill each other outside Event's area . It's bugging players and they need to reconnect to fix the bugs. I don't see a good point on it, May you please help me to make players allowed to kill each other outside area and keep making them unable to shoot inside area ? local col = createColCuboid ( -676.31543, -2143.39429, 20.17123, 200, 200, 200 ) local zone = createRadarArea ( -676.31543, -2143.39429, 200, 200, 0, 255, 0, 60 ) setElementData ( zone, "zombieProof", true ) function eventsArea ( hitElement, matchingDimension ) if ( getElementType ( hitElement ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Everyone" ) ) then toggleControl ( hitElement, "fire", false ) toggleControl ( hitElement, "aim_weapon", false ) toggleControl ( hitElement, "vehicle_fire", false ) outputChatBox ( "Você entrou na área de Eventos", hitElement, 0, 255, 0 ) end end end addEventHandler ( "onColShapeHit", col, eventsArea ) Link to comment
|H|TiTanium Posted June 18, 2013 Author Share Posted June 18, 2013 sorry, is there anyone that could help me ? Link to comment
PaiN^ Posted June 18, 2013 Share Posted June 18, 2013 local col = createColCuboid ( -676.31543, -2143.39429, 20.17123, 200, 200, 200 ) local zone = createRadarArea ( -676.31543, -2143.39429, 200, 200, 0, 255, 0, 60 ) setElementData ( zone, "zombieProof", true ) function eventsArea ( hitElement, matchingDimension ) if ( getElementType ( hitElement ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Everyone" ) ) then toggleControl ( hitElement, "fire", false ) toggleControl ( hitElement, "aim_weapon", false ) toggleControl ( hitElement, "vehicle_fire", false ) outputChatBox ( "Você entrou na área de Eventos", hitElement, 0, 255, 0 ) end end end addEventHandler ( "onColShapeHit", col, eventsArea ) function quited( hitElement ) if ( getElementType ( hitElement ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Everyone" ) ) then toggleControl ( hitElement, "fire", true ) toggleControl ( hitElement, "aim_weapon", true ) toggleControl ( hitElement, "vehicle_fire", true ) outputChatBox ( "Você entrou na área de Eventos", hitElement, 0, 255, 0 ) -- modify this ! end end addEventHandler ( "onColShapeLeave", col, quited ) Link to comment
|H|TiTanium Posted June 18, 2013 Author Share Posted June 18, 2013 You forgot to create an end on line 28 and change "addEventHandler ( "onColShapeLeave", col, quited )" to line 29. But I've already fixed it. Thank you 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