Search the Community
Showing results for tags 'horn'.
-
Hola buenas, aclaro que no entiendo mucho sobre programación, he aprendiendo poco a poco viendo tutoriales y modificando una que otra cosa que descargo. El punto es que quiero hacer que este script de TP funcione con autos, que se pueda activar tocando el Claxon del vehículo, para que pueda Tpearme con el mismo vehiculo a un punto en especifico, y así darle un uso para "TP de Garaje", intenté cambiar el BindKey por "horn" y de un interior a otro me lleva a otras cordenadas y de un exterior no se teletransporta, estaría bastante agradecido si me pudiesen ayudar. local interiors = { -- {Ext"X", Ext"Y", Ext"Z", | IDInt, IDDim | IntX, IntY, IntZ | IDInt, IDDim | "Nombre"}, {1177.90234375, -1338.9755859375, 14.912269592285, 0, 0, 447, 2520, -98, 10, 0, "LSMD"}, {1195.3037109375, -1354.92578125, 13.389284133911, 0, 0, 1198.0654296875, -1402.2587890625, 13.257797241211, 0, 0, "Prueba"}, } enterPickup = nil exitPickup = nil local bind = "Enter" local screenW, screenH = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() for i,v in pairs (interiors) do local enterPickup = createPickup(v[1], v[2], v[3], 3, 1318, 1) setElementInterior(enterPickup, v[4]) setElementDimension(enterPickup, v[5]) local exitPickup = createPickup(v[6], v[7], v[8], 3, 1318, 1) setElementInterior(exitPickup, v[9]) setElementDimension(exitPickup, v[10]) addEventHandler("onClientRender", root, function() if (isElementWithinPickup(localPlayer, enterPickup)) and getElementInterior(localPlayer) == getElementInterior(enterPickup) and getElementDimension(localPlayer) == getElementDimension(enterPickup) then dxDrawHelp("Propiedad : "..v[11], "Presiona "..bind.." para entrar.") elseif (isElementWithinPickup(localPlayer, exitPickup)) and getElementInterior(localPlayer) == getElementInterior(exitPickup) and getElementDimension(localPlayer) == getElementDimension(exitPickup) then dxDrawHelp("Propiedad : "..v[11], "Presiona "..bind.." para salir.") end end) bindKey(bind, "down", function() if (isElementWithinPickup(localPlayer, enterPickup)) and getElementInterior(localPlayer) == getElementInterior(enterPickup) and getElementDimension(localPlayer) == getElementDimension(enterPickup) then triggerServerEvent("warpPlayer", localPlayer, localPlayer, v[6], v[7], v[8], v[9], v[10]) elseif (isElementWithinPickup(localPlayer, exitPickup)) and getElementInterior(localPlayer) == getElementInterior(exitPickup) and getElementDimension(localPlayer) == getElementDimension(exitPickup) then triggerServerEvent("warpPlayer", localPlayer, localPlayer, v[1], v[2], v[3], v[4], v[5]) end end) end end) local blips = { -- blip ekleye bilirsiniz. {810.4853515625, -1616.16015625, 13.546875, 10}, } for i,v in pairs (blips) do createBlip(v[1], v[2], v[3], v[4], 2, 255, 255, 255, 255, 0, 100) end function guiGridListGetSelectedItemText ( gridList, column ) local item = guiGridListGetSelectedItem ( gridList ) if item then return guiGridListGetItemText ( gridList, item, column or 1 ) end return false end -- function isElementWithinPickup(theElement, thePickup) if (isElement(theElement) and getElementType(thePickup) == "pickup") then local x, y, z = getElementPosition(theElement) local x2, y2, z2 = getElementPosition(thePickup) if (getDistanceBetweenPoints3D(x2, y2, z2, x, y, z) <= 1) then return true end end return false end function round(num) if ( num >= 0 ) then return math.floor( num + .5 ) else return math.ceil( num - .5 ) end end function convertNumber( number ) local formatted = number while true do formatted, k = string.gsub( formatted, "^(-?%d+)(%d%d%d)", '%1 %2' ) if ( k==0 ) then break end end return formatted end function guiComboBoxAdjustHeight ( combobox, itemcount ) if getElementType ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end local width = guiGetSize ( combobox, false ) return guiSetSize ( combobox, width, ( itemcount * 20 ) + 20, false ) end
-
Hi. I'm trying to do script while which block control HORN from other keys than ( H // CAPSLOCK) Code server: function klakson (source) if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h")) then setControlState (source, "horn", true ) outputChatBox ("on",getRootElement(),255,0,0,true) -- only information else toggleControl ( "horn", false ) outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information end end addEventHandler ("onClientResourceStart",getRootElement(),klakson) Any ideas? ;/