TheMaysTRo Posted July 29, 2014 Share Posted July 29, 2014 Hello . i create a col shape . local tempCol = createColCuboid ( 2360.6469726563,-1803.5179443359,1442.5999755859, 500, 120, 10.0 ) and when i hit this col shape only .I want to toggle vehicles and jetpack off there . and toggle them back on when i exit col shape . Link to comment
Max+ Posted July 29, 2014 Share Posted July 29, 2014 what do you mean by toggel them off ? you want to destory vehilces & JetPacks in the col Shape if you enter and create them back if you exit ? Link to comment
TheMaysTRo Posted July 29, 2014 Author Share Posted July 29, 2014 what do you mean by toggel them off ?you want to destory vehilces & JetPacks in the col Shape if you enter and create them back if you exit ? if someone entred the colshape with car , his car destroyed or something , and jetpack . he can't use them in the colshape Link to comment
Max+ Posted July 29, 2014 Share Posted July 29, 2014 (edited) Try this --- ServerSide local tempCol = createColCuboid ( 2360.6469726563,-1803.5179443359,1442.5999755859, 500, 120, 10.0 ) addEventHandler("onColShapeHit",resourceRoot, function ( player ) if ( isElementWithinColShape ( player, tempCol ) ) then if ( doesPedHaveJetPack ( player ) ) and ( isPedInVehicle ( player )) then removePedJetPack ( player ) removePedFromVehicle ( player ) outputChatBox ( ' You Cant Use JetPack Or Vehicle in Here ',player, 255, 0, 0 ) end end end ) Edited # Edited July 29, 2014 by Guest Link to comment
TheMaysTRo Posted July 29, 2014 Author Share Posted July 29, 2014 Try this --- ClientSide local tempCol = createColCuboid ( 2360.6469726563,-1803.5179443359,1442.5999755859, 500, 120, 10.0 ) addEventHandler("onClientColShapeHit",tempCol, function ( theElement ) if ( theElement == localPlayer ) then if ( doesPedHaveJetPack ( theElement ) ) then removePedJetPack ( theElement ) vehicles = getElementsByType("vehicle") for _,v in ipairs(vehicles) do destroyElement ( v ) outputChatBox ( ' You Cant Use JetPack Or Vehicle in Here ', 255, 0, 0 ) end end end end ) Not working :[ Link to comment
Max+ Posted July 29, 2014 Share Posted July 29, 2014 Try Now i edited my post /debugscript 3 Change it in meta.xml to serverside Link to comment
AboShanab Posted July 29, 2014 Share Posted July 29, 2014 (edited) @Max+ : Your Code For Hit In Colshape Not With In Colshape .. Try To Use setTimer .. Edited July 29, 2014 by Guest Link to comment
Max+ Posted July 29, 2014 Share Posted July 29, 2014 @Max+ : Your Code For Hit In Marker Not With In Marker ..Try To Use setTimer .. ? onClientColShapeHit it's for col shapes ! Link to comment
#DRAGON!FIRE Posted July 29, 2014 Share Posted July 29, 2014 local colshape = createColCuboid ( .... ) local Timer = { }; addEventHandler( "onColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) end Timer[ element ] = setTimer ( function ( element ) if ( isElementWithinColShape ( element, colshape ) ) then if ( doesPedHaveJetPack ( element ) ) then removePedJetPack ( element ) end if ( getPedOccupiedVehicle( element ) ) then destroyElement ( getPedOccupiedVehicle( element ) ) end else killTimer ( Timer[ element ] ) end, 100, 0, element ) end end end ) addEventHandler( "onColShapeLeave", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) Timer[ element ] = nil end end end end ) Link to comment
Max+ Posted July 29, 2014 Share Posted July 29, 2014 local colshape = createColCuboid ( .... ) local Timer = { }; addEventHandler( "onColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) end Timer[ element ] = setTimer ( function ( element ) if ( isElementWithinColShape ( element, colshape ) ) then if ( doesPedHaveJetPack ( element ) ) then removePedJetPack ( element ) end if ( getPedOccupiedVehicle( element ) ) then destroyElement ( getPedOccupiedVehicle( element ) ) end else killTimer ( Timer[ element ] ) end, 100, 0, element ) end end end ) addEventHandler( "onColShapeLeave", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) Timer[ element ] = nil end end end end ) why the timer is needed here ? Link to comment
#DRAGON!FIRE Posted July 29, 2014 Share Posted July 29, 2014 if u hit the colshape and with Jet or Vehicle it destroyed .. then ? But if I take a jet or vehicle again !! Link to comment
Max+ Posted July 29, 2014 Share Posted July 29, 2014 if u hit the colshape and with Jet or Vehicle it destroyed .. then ? But if I take a jet or vehicle again !! but it's when he enter the col every time he get in it's get destroyed . 1 Link to comment
#DRAGON!FIRE Posted July 29, 2014 Share Posted July 29, 2014 No !! .. your code just when player enter . Link to comment
TheMaysTRo Posted July 29, 2014 Author Share Posted July 29, 2014 Try this --- ServerSide local tempCol = createColCuboid ( 2360.6469726563,-1803.5179443359,1442.5999755859, 500, 120, 10.0 ) addEventHandler("onColShapeHit",resourceRoot, function ( player ) if ( isElementWithinColShape ( player, tempCol ) ) then if ( doesPedHaveJetPack ( player ) ) and ( isPedInVehicle ( player )) then removePedJetPack ( player ) removePedFromVehicle ( player ) outputChatBox ( ' You Cant Use JetPack Or Vehicle in Here ',player, 255, 0, 0 ) end end end ) Edited # well , not working local colshape = createColCuboid ( .... ) local Timer = { }; addEventHandler( "onColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) end Timer[ element ] = setTimer ( function ( element ) if ( isElementWithinColShape ( element, colshape ) ) then if ( doesPedHaveJetPack ( element ) ) then removePedJetPack ( element ) end if ( getPedOccupiedVehicle( element ) ) then destroyElement ( getPedOccupiedVehicle( element ) ) end else killTimer ( Timer[ element ] ) end, 100, 0, element ) end end end ) addEventHandler( "onColShapeLeave", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) Timer[ element ] = nil end end end end ) not working also Link to comment
TheMaysTRo Posted July 29, 2014 Author Share Posted July 29, 2014 Help Please ? i want that no one can use a jetpack or vehicle on this col shape Link to comment
Et-win Posted July 29, 2014 Share Posted July 29, 2014 "It doesn't work, help!", "It doesn't work, fix it!", "It do"... Tell us what DOESN'T work, tell us what DEBUGSCRIPT 3 gives... Saying "It doesn't work" doesn't help us at ALL to help you....... Link to comment
TheMaysTRo Posted July 29, 2014 Author Share Posted July 29, 2014 "It doesn't work, help!", "It doesn't work, fix it!", "It do"... Tell us what DOESN'T work, tell us what DEBUGSCRIPT 3 gives... Saying "It doesn't work" doesn't help us at ALL to help you....... well i gave you the col shape code ,thats what i can do , itried what they gave me and its not working , if you don't like to help don't help me . Link to comment
Et-win Posted July 29, 2014 Share Posted July 29, 2014 Maybe I'd want to help, but it's easier for us if you tell us what doesn't work. Link to comment
TheMaysTRo Posted July 29, 2014 Author Share Posted July 29, 2014 Maybe I'd want to help, but it's easier for us if you tell us what doesn't work. ok . i tried this and i don't know why its not working ? any idea ? local hayMarker2 = createMarker (2614.2666015625,-1754.1813964844,1442.5999755859, "cylinder", 290, 2500, 0, 0, 100, getRootElement()) setElementVisibleTo (hayMarker2,root,false ) function jetpackremove (player) if doesPedHaveJetPack( player ) then removePedJetPack ( player ) end end addEventHandler ("onMarkerHit", hayMarker2, jetpackremove) Link to comment
#DRAGON!FIRE Posted July 30, 2014 Share Posted July 30, 2014 i forget end ... try this and don't forget remove .... and put your colshape args local colshape = createColCuboid ( .... ) local Timer = { }; addEventHandler( "onColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) end Timer[ element ] = setTimer ( function ( element ) if ( isElementWithinColShape ( element, colshape ) ) then if ( doesPedHaveJetPack ( element ) ) then removePedJetPack ( element ) end if ( getPedOccupiedVehicle( element ) ) then destroyElement ( getPedOccupiedVehicle( element ) ) end else killTimer ( Timer[ element ] ) end end, 100, 0, element ) end end end ) addEventHandler( "onColShapeLeave", resourceRoot, function ( element ) if ( source == colshape ) then if ( getElementType ( element ) == "player" ) then if ( isTimer ( Timer[ element ] ) ) then killTimer ( Timer[ element ] ) Timer[ element ] = nil end end end end ) Link to comment
Amine#TN Posted January 19, 2017 Share Posted January 19, 2017 can i get the function when player have case then remove his jetpack Link to comment
ViRuZGamiing Posted January 20, 2017 Share Posted January 20, 2017 This person isn't capable of filling in arguments so we have another case of ''hey I need this script'' 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