Leaderboard
Popular Content
Showing content with the highest reputation on 15/07/20 in all areas
-
I always wanted to create a facility on the mars like Elon musk, woho .. that's not possible. I have just imagined how it would be. And i have created the Mars Facility in my dreams and I didn't forget to add some little details on it) FEATURES In this map there are three panels over the map lets you enable/disable the scripts. 1. Irrigation System: there is a script panel in the artifical garden place that lets you watering plants, if you hit the red marker Irrigation system will stop and then if you hit the green marker, it will start to watering plants again. 2. Nexcar Lights ON / OFF: (Bad name i know) there is a panel lets you enable or disable car lights, and it works same as Irrigation system 3. Space Shuttle Control Panel: You can see how it look like on the video, there is a panel let's you control the space shuttle, when you hit green marker, an alarm plays and elevator moves space shuttle into underground. And when you hit Red marker, the elevator will move space shuttle back to surface. Also there is a teleport that lets you move A to B (classic) And there is no camera fade when you have going into the teleport like as in the video. (check the video in the bottom) You can check MAP Sketch here Screenshots Loadbay Outside Nexcar place Artificial Garden Powers Best Regards, Nebla2 points
-
olá , bom dia/boa tarde/boa noite/ estou com um problema com o meu script de Ligar/desligar motor com os "triggerServerEvent"."o script faz com que, quando um player entra no carro ele começa desligado, e o player tem que pressionar [ i ] para ligar o veiculo,porém por algum motivo bizarro quando um player está em um veiculo e outro entra/sai de outro veiculo os dois veículos desligam e não consigo identificar o problema, por isso estou pedindo ajuda aq ;-;" Script: ----/////////------ --Lado do Cliente ----/////////------ function ligarMotor() triggerServerEvent("motor",getLocalPlayer()) end --Seta o Motor Como Desligado ao Entrar + Bind para Ligar/desligar o motor addEventHandler("onClientVehicleEnter",getRootElement(),function() outputChatBox("#FFFF00Para Ligar/Desligar o Motor Aperte [ i ]",r,g,b,true) triggerServerEvent("motor",getLocalPlayer()) bindKey("i","down",ligarMotor) ----//////--- --Seta o Motor Como Desligado ao Sair ----//////--- end) addEventHandler("onClientVehicleStartExit",getRootElement(),function() unbindKey("i","down",ligarMotor) triggerServerEvent("motor",getLocalPlayer()) triggerServerEvent("certezza",getLocalPlayer()) end) ------------------------------------------------------------------------- ----/////////------ --Lado do Server ----/////////------ ---desliga e liga o motor baseado no input do cliente local function motorToggle() local theVehicle = getPedOccupiedVehicle(source) if (getVehicleEngineState(theVehicle) == true) then setVehicleEngineState(theVehicle,false) setVehicleLightState(theVehicle,0,1) setVehicleLightState(theVehicle,1,1) setVehicleLightState(theVehicle,2,1) setVehicleLightState(theVehicle,3,1) elseif (getVehicleEngineState(theVehicle) == false) then setVehicleEngineState(theVehicle,true) setVehicleLightState(theVehicle,0,0) setVehicleLightState(theVehicle,1,0) setVehicleLightState(theVehicle,2,0) setVehicleLightState(theVehicle,3,0) end end addEvent("motor",true) addEventHandler("motor",getRootElement(),motorToggle) --///--- --dá a certeza que o motor vai desligar ao sair (mesmo se ja estiver desligado) ---///-- local function certeza() local theVehicle = getPedOccupiedVehicle(source) if (getVehicleEngineState(theVehicle) == true) then setVehicleEngineState(theVehicle,false) setVehicleLightState(theVehicle,0,1) setVehicleLightState(theVehicle,1,1) setVehicleLightState(theVehicle,2,1) setVehicleLightState(theVehicle,3,1) end end addEvent("certezza",true) addEventHandler("certezza",getRootElement(),certeza) se alguém puder me ajudar ficarei mt grato1 point
-
1 point
-
Bom, se eu fosse você, eu criava todo o script do lado server-side, assim, evitando constantemente o uso de envios de eventos para o server-side. Teste lá : -- / lado server-side. --# bindkey. addEventHandler("onPlayerLogin", root, function () bindKey ( source, "i", "down", ligar_desligar_motor ) end) addEventHandler("onResourceStart", resourceRoot, function () for i, player in ipairs( getElementsByType("player") ) do bindKey ( player, "i", "down", ligar_desligar_motor ) end end) addEventHandler("onResourceStop", resourceRoot, function () for i, player in ipairs( getElementsByType("player") ) do unbindKey ( player, "i", "down", ligar_desligar_motor ) end end) -- funções. function ligar_desligar_motor ( player ) local veh = getPedOccupiedVehicle ( player ) if veh and getPedOccupiedVehicleSeat( player ) == 0 then if ( getVehicleEngineState (veh) == false ) then setVehicleEngineState (veh, true) setVehicleLightState (veh,0,0) setVehicleLightState (veh,1,0) setVehicleLightState (veh,2,0) setVehicleLightState (veh,3,0) else setVehicleEngineState (veh, false) setVehicleLightState (veh,0,1) setVehicleLightState (veh,1,1) setVehicleLightState (veh,2,1) setVehicleLightState (veh,3,1) end end end -- eventos. addEventHandler ( "onPlayerVehicleEnter", root, function ( theVehicle, seat ) if seat == 0 then if ( getVehicleEngineState (theVehicle) == false ) then setVehicleEngineState (theVehicle, true) setVehicleLightState (theVehicle,0,0) setVehicleLightState (theVehicle,1,0) setVehicleLightState (theVehicle,2,0) setVehicleLightState (theVehicle,3,0) end end end) addEventHandler ( "onPlayerVehicleExit", root, function ( theVehicle, seat ) if seat == 0 then if ( getVehicleEngineState (theVehicle) == true ) then setVehicleEngineState (theVehicle, false) setVehicleLightState (theVehicle,0,1) setVehicleLightState (theVehicle,1,1) setVehicleLightState (theVehicle,2,1) setVehicleLightState (theVehicle,3,1) end end end)1 point
-
Already denied at https://forum.multitheftauto.com/topic/125819-l-banned-in-mta-cd47/ (same person, different PC) Please don't return1 point
-
bom Mt obrigado vou testar aqui e ver se funciona! não funcionou man, continua com o mesmo bug, quando alguem esta em um veiculo assim com eu e sai/entra do carro ambos os carros desligam, ele n tá agindo individualmente ;-; mas obg pela ajuda1 point
-
Nesse caso, no Server, você precisa adicionar uma função para verificar qual o assento do jogador. Recomendo você usar getPedOccupiedVehicleSeat para verificar se o passageiro é o motorista (no caso, 0) Ficaria então: ------------------------------------------------------------------------- ----/////////------ --Lado do Server ----/////////------ ---desliga e liga o motor baseado no input do cliente local function motorToggle() local theVehicle = getPedOccupiedVehicle(source) if getPedOccupiedVehicleSeat(source) == 0 then if (getVehicleEngineState(theVehicle) == true) then setVehicleEngineState(theVehicle,false) setVehicleLightState(theVehicle,0,1) setVehicleLightState(theVehicle,1,1) setVehicleLightState(theVehicle,2,1) setVehicleLightState(theVehicle,3,1) elseif (getVehicleEngineState(theVehicle) == false) then setVehicleEngineState(theVehicle,true) setVehicleLightState(theVehicle,0,0) setVehicleLightState(theVehicle,1,0) setVehicleLightState(theVehicle,2,0) setVehicleLightState(theVehicle,3,0) end end end addEvent("motor",true) addEventHandler("motor",getRootElement(),motorToggle)1 point
-
1 point
-
1 point
-
Como o Gw8 disse, deve ter outro código com esse texto DX. Nesse trecho de código não tem como mostrar ambos os textos. @ber 'stats' não irá retornar um valor válido (string), o valor precisa estar entre aspas.1 point
-
@zRodrigoMM I'm sorry ~5 years ago I gave bad resource as example to use And still maybe late reply but still could be useful for someone. Here is a better autoteams resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=612 There are instructions in the config.xml file. Good luck!1 point
-
1 point
-
https://wiki.multitheftauto.com/wiki/SetPedAnimation 5th argument, loop: indicates whether or not the animation will loop. just set it to false1 point
-
1 point
-
You need an accept id. This can't be done via a bind key unless the accept id is always the same and you hardcode it into the function itself.1 point
-
1 point
-
1 point
-
function testp() valor={ [581] = 10000, [468] = 20000, [461] = 30000, [521] = 30000, [586] = 80000, [522] = 120000, --e outros ids } v=getPedOccupiedVehicle(localPlayer)--v é o veiculo a ter o preço checado, aqui to usando o veiculo que o player esta for veiculo in pairs(valor) do if v and veiculo==getElementModel(v) then outputChatBox("valor desse veiculo: "..valor[getElementModel(v)]/5) end end end addCommandHandler("testepreco",testp)1 point
-
1 point
-
Tente: function spawn(player) if player then local carselected = getElementData(player, "CARSelect") if vehSpawn[player] then destroyElement(vehSpawn[player]) end local Money = getPlayerMoney(player) local Valor = 5000 if Money >= Valor then if not carselected then return end -- SE NÃO EXISTIR carselected A FUNÇÃO RETORNARÁ AO FIM! if carselected == 1 then exports.Gunner_MensagensDX:outputDx ( player, "Carro alugado com sucesso!", "success" ) vehSpawn[player] = createVehicle(car1, 262.19952, -3096.83765, 6.45605) takePlayerMoney(player, 5000) elseif carselected == 2 then exports.Gunner_MensagensDX:outputDx ( player, "Carro alugado com sucesso!", "success" ) vehSpawn[player] = createVehicle(car2, 262.19952, -3096.83765, 6.45605) takePlayerMoney(player, 5000) elseif carselected == 3 then exports.Gunner_MensagensDX:outputDx ( player, "Carro alugado com sucesso!", "success" ) vehSpawn[player] = createVehicle(car3, 262.19952, -3096.83765, 6.45605) takePlayerMoney(player, 5000) end else exports.Gunner_MensagensDX:outputDx ( player, "Dinheiro insuficiente!", "error" ) end end end addEvent("GiveCAR", true) addEventHandler("GiveCAR", getRootElement(), spawn)1 point