-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Ajam, te entiendo, quieres que cuando el vehiculo tenga 30% de vida se apague el motor. function totalled(loss) if (getElementHealth(source) <= 30) then toggleControl(getVehicleOccupant (source),"accelerate",false) toggleControl(getVehicleOccupant (source),"brake_reverse",false) end end addEventHandler("onVehicleDamage",getRootElement(),totalled)
-
Someone hacked XX3's account, he uploaded this resource and the description is the same as the one who hacked mine. https://community.multitheftauto.com/ind ... ls&id=2662
-
Si, el MTA 1.1 acepta live streams en la funcion playSound.
-
El evento 'onVehicleDamage' no tiene el parametro del jugador, solo el del vehiculo y el damage que perdio. function totalled(loss) if (loss > 30) then toggleControl(getVehicleOccupant (source),"accelerate",false) toggleControl(getVehicleOccupant (source),"brake_reverse",false) end end addEventHandler("onVehicleDamage",getRootElement(),totalled)
-
Well, if we're talking about dxscoreboard, where do you think you should look at? P.S: /me command is a built-in MTA command, you can't edit it, but you could cancel the message and create your own, but for this, you need scripting knowledge.
-
Firstly, this is in the wrong section, this should go in "Resources" section. And about your "problem", the dxscoreboard doesn't support HEX colours, but, if I'm right, you can set a setting on it called "allow_colors" or something like that in meta.xml.
-
No tengo ni idea como ese recurso funciona, pero me parece que no. Siempre podrias empezar a aprender a programar en LUA .
-
Well... I would say that you need it without the Icons, and they has to be apart, else they'll be just part of the iPhone main image. P.S: I suggest you to use guieditor for GUI/DX Drawing scripts .
-
Hehehe, I'll always help here when I can, I like to help ppl around, to learn and then they'll help others in future (I hope ) .
-
You welcome. And... I haven't got much time even for myself, also I suck at explaining, sorry dude .
-
Yup, there is, here: addEventHandler("onResourceStart",resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey(player, "j", "down", engineOn) bindKey(player, "k", "down", engineOff) end end) addEventHandler("onPlayerJoin",root, function () bindKey(source, "j", "down", engineOn) bindKey(source, "k", "down", engineOff) end) function engineOn(player, key, keyState) if(keyState == "down") then if not isPedInVehicle(player) then return end local theVehicle = getPedOccupiedVehicle(player) setVehicleEngineState(theVehicle, true) end end function engineOff(player, key, keyState, theVehicle) if(keyState == "down") then if not isPedInVehicle(player) then return end local theVehicle = getPedOccupiedVehicle(player) setVehicleEngineState(theVehicle, false) end end
-
function engineOn(player, key, keyState) if(keyState == "down") then if not isPedInVehicle(player) then return end local theVehicle = getPedOccupiedVehicle(player) setVehicleEngineState(theVehicle, true) end end function engineOff(player, key, keyState, theVehicle) if(keyState == "down") then if not isPedInVehicle(player) then return end local theVehicle = getPedOccupiedVehicle(player) setVehicleEngineState(theVehicle, false) end end function bindTheKeys(player, commandName) bindKey(player, "j", "down", engineOn) bindKey(player, "k", "down", engineOff) end addCommandHandler("bindit", bindTheKeys)
-
Help me deathmatch server cant connect please!!
Castillo replied to HistoriaConVos's question in Client
I think that you should ask here: viewforum.php?f=104 -
toopq8_22, I'm afraid you didn't understood him, he's saying that he cannot connect to a server (NOT HIS).
-
Maybe you should put a string, not a variable (vehicle_left, vehicle_right)...? addEventHandler("onVehicleEnter", getRootElement(), function(player) local vehicle = getPedOccupiedVehicle(player) if getControlState(player, "vehicle_left") then setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) else setVehicleOverrideLights(vehicle,0) end if getControlState(player, "vehicle_right") then setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) setVehicleOverrideLights(vehicle, 1) setVehicleOverrideLights(vehicle, 2) else setVehicleOverrideLights(vehicle,0) end end)
-
Copia el client side de nuevo, arregle unos errores.
-
Ok, te explico, lo que estas intentando es crear una tabla por lo que veo, pero esta mal, te dire como es. -------------Client Side ------------------------------ function Gasolina (bool) if bool then ------------------------Label----------------------------------------- combustibleLbl = guiCreateLabel (0.775, 0.85,0.18,0.04,"Gasolina",true) guiLabelSetColor(combustibleLbl,255,255,255) guiLabelSetVerticalAlign(combustibleLbl,"center") guiLabelSetHorizontalAlign(combustibleLbl,"center",false) guiSetFont(combustibleLbl,"default-small") ------------------------Barra de proceso------------------------------- combustibleBarra = guiCreateProgressBar(0.775,0.85,0.18,0.04,true) guiMoveToBack (combustibleBarra) guiProgressBarSetProgress(combustibleBarra,100) else if isElement(combustibleLbl) then destroyElement(combustibleLbl) end if isElement(combustibleBarra) then destroyElement(combustibleBarra) end end end addEvent("cuandoEntraAlAuto",true) addEventHandler("cuandoEntraAlAuto",getRootElement(),Gasolina) function bajarFuel() if (isPedInVehicle(getLocalPlayer())) then guiProgressBarSetProgress(combustibleBarra,guiProgressBarGetProgress(combustibleBarra) -5) if (guiProgressBarGetProgress(combustibleBarra) == 0) then toggleControl("accelerate",false) toggleControl("brake_reverse",false) guiSetText(combustibleLbl,"Sin combustible") end end end setTimer(bajarFuel,10000,0) function llenartanque() if (isPedInVehicle(getLocalPlayer()) and getElementData(getPedOccupedVehicle(getLocalPlayer()), "FUEL") == true) then if (guiProgressBarGetProgress(combustibleBarra) < 80) then guiProgressBarSetProgress(combustibleBarra,100) toggleControl("accelerate",false) toggleControl("brake_reverse",false) elseif (guiProgressBarGetProgress(combustibleBarra) < 90) then outPutChatBox ("No necesitas cargar combustible!") end end end addCommandHandler("llenartanque",llenartanque) function timerCombustible(enabled) if(isPedInVehicle(getLocalPlayer())) then if(enabled == true) then tanqueTimer = setTimer(llenartanque,10000,0) else killTimer(refillTimer) end else outputChatBox("Necesitas estar en un vehiculo!") end end addEvent("cuandoEstaRefilleando",true) addEventHandler("cuandoEstaRefilleando",getRootElement(),timerCombustible) -------------Server Side-------------------------------- local puestosGasolina = { {1937.4731, -1772.6284, 12.7925, 0}, } addEventHandler("onResourceStart",resourceRoot, function () for i,v in ipairs (puestosGasolina) do local gasolinaMarker = createMarker (v[1],v[2],v[3],"cylinder",2,255,255,0,177) if gasolinaMarker then setElementData(gasolinaMarker,"FUEL",true) setElementInterior(gasolinaMarker,v[4]) addEventHandler("onMarkerHit",gasolinaMarker,cuandoEntraAlMarker) addEventHandler("onMarkerLeave",gasolinaMarker,cuandoSaleDelMarker) end end end) function Motor (playerSource,commandName) local theVehicle = getPedOccupiedVehicle (playerSource) local motor = getVehicleEngineState (theVehicle) if motor == false then setVehicleEngineState(theVehicle,true) triggerClientEvent(playerSource,"cuandoEntraAlAuto",playerSource,true) elseif motor == true then setVehicleEngineState(theVehicle,false) triggerClientEvent(playerSource,"cuandoEntraAlAuto",playerSource,false) end end addCommandHandler("motor",Motor) function cuandoEntraAlMarker(player,sDimension) triggerClientEvent(player,"cuandoEstaRefilleando",player,true) end function cuandoSaleDelMarker(player,sDimension) triggerClientEvent(player,"cuandoEstaRefilleando",player,false) end Ok, arregle varios errores en tu script, proba a ver que tal.
-
El map editor no crea puertas, sin embargo, hay un resource publico que se llama "omg" que crea esto, aca te dejo el link para la version traducida al español. Link: https://community.multitheftauto.com/index.php?p= ... ls&id=1595
-
You welcome .
-
Isn't that what I said in my first reply? P.S: Use tonumber() not tostring()
-
I actually didn't understood you so good. You are asking if you can do something like this: local myTable = {myValue1 = 1, myValue2 = 2} outputChatBox(tostring(myTable.myValue1)) outputChatBox(tostring(myTable.myValue2)) ?
-
table1 = { ["LoremIpsum"] = 1 } function getInfo(blah1) local item1 = blah1 outputChatBox("Output: "..table1[item1]) -- If it works like I want it to, this should output "1" end addEvent("whenTriggeredClientSide",true) addEventHandler("whenTriggeredClientSide",getRootElement(),getInfo) That?
