djtopoofc Posted January 18, 2023 Share Posted January 18, 2023 markerlaranja = createMarker( 1226.1005859375, 398.4169921875, 21.106098175049, "cylinder", 2, 0, 255, 0, 255) markerlaranja2 = createMarker( 1234.0703125, 414.9501953125, 20.760526657104, "cylinder", 2, 0, 255, 0, 255) markerlaranja3 = createMarker( 1240.6142578125, 429.1787109375, 19.204351425171, "cylinder", 2, 0, 255, 0, 255) markerlaranja4 = createMarker( 1247.7998046875, 445.1884765625, 18.851581573486, "cylinder", 2, 0, 255, 0, 255) markerlaranja5 = createMarker( 1261.6875, 436.865234375, 18.878652572632, "cylinder", 2, 0, 255, 0, 255) markerlaranja6 = createMarker( 1254.720703125, 420.564453125, 19.131044387817, "cylinder", 2, 0, 255, 0, 255) markerlaranja7 = createMarker( 1248.970703125, 406.7763671875, 18.996059417725, "cylinder", 2, 0, 255, 0, 255) markerlaranja8 = createMarker( 1242.2373046875, 392.5908203125, 19.099172592163, "cylinder", 2, 0, 255, 0, 255) markerlaranja9 = createMarker( 1258.947265625, 387.2275390625, 19.473236083984, "cylinder", 2, 0, 255, 0, 255) markerlaranja10 = createMarker( 1263.2685546875, 399.974609375, 19.328210830688, "cylinder", 2, 0, 255, 0, 255) markerlaranja11 = createMarker( 1268.9052734375, 413.3408203125, 19.240316390991, "cylinder", 2, 0, 255, 0, 255) markerlaranja12 = createMarker( 1275.1494140625, 429.0166015625, 18.900918960571, "cylinder", 2, 0, 255, 0, 255) LetraParaMarkers = "k" function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end timerEntregar = {} local next = exports.n3xt_inventario function colher (source) unbindKey (source, "K", "down", colher ) setElementFrozen(playerSource, true) setTimer(function() setElementFrozen(playerSource, false) bindKey (source, "K", "down", colher ) unbindKey ( source, LetraParaMarkers, "down", colher ) next:giveItem(source, "Chocolate", 1) end, 11300, 1) end function emarker(marker,md) if (md) then if isPedInVehicle ( source ) then return end if marker == markerlaranja or marker == markerlaranja2 or marker == markerlaranja3 or marker == markerlaranja4 or marker == markerlaranja5 or marker == markerlaranja6 or marker == markerlaranja7 or marker == markerlaranja8 or marker == markerlaranja9 or marker == markerlaranja10 or marker == markerlaranja11 or marker == markerlaranja12 then message(source, "Precione K para Colher Laranjas.", "info") bindKey ( source, LetraParaMarkers, "down", colher ) end end end addEventHandler("onPlayerMarkerHit",getRootElement(),emarker) function lmarker(marker,md) if (md) then if marker == markerlaranja then unbindKey ( source, LetraParaMarkers, "down", colher ) end end end addEventHandler("onPlayerMarkerLeave",getRootElement(),lmarker) como posso fazer o player ficar "travado" após usar a key K? Link to comment
MYSOTO Posted January 18, 2023 Share Posted January 18, 2023 (edited) function funk (source) setElementFrozen(source, true) -- Freeze player Movement bindKey (source, "K", "up", desbloquear) --Add key to desbloquear funtion next:giveItem(source, "Chocolate", 1) end function desbloquear (source) setElementFrozen(source, false) -- desbloquea el movimiento del jugador end Edited January 18, 2023 by MYSOTO 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