-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
The server must have the drive by script, and it should automatically bind it when you join the server.
-
Why do you say "revive" as if the community was dead? it's pretty damn alive I would say. As far as I know, GTA IV had a lot of technicall problems, which made it hard to create a good MP mod.
-
Eso es porque la variable 'tank' sigue teniendo un valor, cambia el: if tank then a: if isElement ( tank ) then Y tambien deberias poner la variable 'tank' en el valor 'nil', asi: destroyElement ( tank ) tank = nil
-
Acabo de probar el script que yo te di, y funciona perfectamente.
-
You can inject mouse moves/clicks with: injectBrowserMouseDown injectBrowserMouseUp injectBrowserMouseMove injectBrowserMouseWheel.
-
Subi el recurso a algun sitio, tipo mediafire, y postea el link.
-
local w, h = guiGetScreenSize( ) local isShaderEnabled = false addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) onBloodChange ( "blood" ) end ) function renderEffect2 ( ) dxSetRenderTarget ( ) dxUpdateScreenSource ( screenSrc2 ) dxDrawImage ( 0, 0, w, h, screenShader2 ) end function enableBlackWhite ( enable ) if ( enable ) then if ( isShaderEnabled ) then return end screenShader2 = dxCreateShader ( "blackwhite.fx" ) screenSrc2 = dxCreateScreenSource ( w, h ) if ( screenShader2 and screenSrc2 ) then dxSetShaderValue ( screenShader2, "BlackWhiteTexture", screenSrc2 ) addEventHandler ( "onClientHUDRender", getRootElement( ), renderEffect2 ) end else if ( screenShader2 and screenSrc2 ) then destroyElement ( screenShader2 ) destroyElement ( screenSrc2 ) screenShader2, screenSrc2 = nil, nil removeEventHandler ( "onClientHUDRender", getRootElement( ), renderEffect2 ) end end isShaderEnabled = enable end function onBloodChange ( dataName ) if ( dataName == "blood" ) then local blood = ( tonumber ( getElementData ( localPlayer, "blood" ) ) or 0 ) if ( blood < 2000 ) then enableBlackWhite ( true ) else enableBlackWhite ( false ) end end end addEventHandler ( "onClientElementDataChange", localPlayer, onBloodChange ) Probalo.
-
Set their descriptions to "DELETE", so we can know they are yours.
-
Ese codigo activara el shader cuando el element data "blood" sea menor que 2000, no igual que.
-
Algun error en el debugscript?
-
Desktop: CPU: Intel Core i5 3570 3.4GHz RAM: 16 GB GPU: GTX 970 Factory Overclocked Hard Drives: 4 TB, 1 TB and 256 GB SSD Notebook: CPU: Intel Core i3 3110M 2.4GHz RAM: 4 GB GPU: HD Graphics 4000 Hard Drive: 640 GB
-
He was asking for exported functions list or a page with info about this:
-
That wiki page is not for these scripts, it's for this resource: https://community.multitheftauto.com/index.php?p= ... ls&id=4871
-
[HELP] I want to create team but what wrong with it??
Castillo replied to KainDepZai's topic in Scripting
It's "addCommandHandler" not "addComandHandler". -
There's no reason to delete the topic, as it might help someone with a similar problem.
-
El MTA paradise no utiliza las cuentas del MTA si no me equivoco. Lo que podes hacer es, que al intentar crear el personaje, cuente cuantos creaste hasta ahora.
-
checking if some specific data already exists in SQLDatabase
Castillo replied to John Smith's topic in Scripting
I don't understand what do you mean. -
checking if some specific data already exists in SQLDatabase
Castillo replied to John Smith's topic in Scripting
local theResult, numRows = dbPoll ( isPlayerInClan, -1 ) if ( numRows == 0 ) then -- your code end -
checking if some specific data already exists in SQLDatabase
Castillo replied to John Smith's topic in Scripting
You need to use dbQuery + dbPoll to check if something is already in the database. -
I guess the website is not working, and failing to convert the video to audio only.
-
You're welcome.
-
You could try setting a timer to check, instead of just after leaving.
-
function createANewObject(objID, x, y, z, rotx, roty, rotz) dunnewObj = createObject(objID, x, y, z, rotx, roty, rotz) local name = tostring(getPlayerName(source)) setTimer(function () local newcolshape = createColTube(x, y, z - 3, 10, 7) setElementData(newcolshape, "col.group", "".. name) setElementData(newcolshape, "col.gate", dunnewObj) end, 5000, 1) outputChatBox("Colshape will be created in 5 seconds, please move away from the gate!", source, 255, 255, 0) setElementDoubleSided(dunnewObj, true) outputChatBox("Name: " .. name) exports.mysqlconfig:exec("INSERT INTO objects (plrName, serial, x, y, z, rotx, roty, rotz, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", name, getPlayerSerial(source), x, y, z, rotx, roty, rotz, objID) end addEvent("createNewObject", true) addEventHandler("createNewObject", root, createANewObject) addEventHandler("onColShapeHit", root, function(player, matchingDimension) local name = getElementData(source, "col.group") if (tostring(name) == tostring(getPlayerName(player))) then local gate = getElementData(source, "col.gate") if (gate) then local isOpen = getElementData(gate, "gate.open") --local plrInCol = getElementsWithinColShape(source, "player") --local vehInCol = getElementsWithinColShape(source, "vehicle") if (isOpen == false) then local gx, gy, gz = getElementPosition(gate) local gz = gz + 3 moveObject(gate, 1200, gx, gy, gz, 0, 0, 0, "OutBounce") setElementData(gate, "gate.open", true) end end end end ) addEventHandler("onColShapeLeave", root, function(player, matchingDimension) local name = getElementData(source, "col.group") if (tostring(name) == tostring(getPlayerName(player))) then local gate = getElementData(source, "col.gate") if (gate) then local plrInCol = getElementsWithinColShape(source, "player") local vehInCol = getElementsWithinColShape(source, "vehicle") outputChatBox("1: " .. tostring(#plrInCol) .. ", 2: " .. tostring(#vehInCol), player) if (not tonumber(#plrInCol) >= 1 or tonumber(#vehInCol) >= 1) then local gx, gy, gz = getElementPosition(gate) gz = gz - 3 moveObject(gate, 1200, gx, gy, gz, 0, 0, 0, "OutBounce") setElementData(gate, "gate.open", false) end end end end )function createANewObject(objID, x, y, z, rotx, roty, rotz) dunnewObj = createObject(objID, x, y, z, rotx, roty, rotz) local name = tostring(getPlayerName(source)) setTimer(function () local newcolshape = createColTube(x, y, z - 3, 10, 7) setElementData(newcolshape, "col.group", "".. name) setElementData(newcolshape, "col.gate", dunnewObj) end, 5000, 1) outputChatBox("Colshape will be created in 5 seconds, please move away from the gate!", source, 255, 255, 0) setElementDoubleSided(dunnewObj, true) outputChatBox("Name: " .. name) exports.mysqlconfig:exec("INSERT INTO objects (plrName, serial, x, y, z, rotx, roty, rotz, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", name, getPlayerSerial(source), x, y, z, rotx, roty, rotz, objID) end addEvent("createNewObject", true) addEventHandler("createNewObject", root, createANewObject) addEventHandler("onColShapeHit", root, function(player, matchingDimension) local name = getElementData(source, "col.group") if (tostring(name) == tostring(getPlayerName(player))) then local gate = getElementData(source, "col.gate") if (gate) then local isOpen = getElementData(gate, "gate.open") --local plrInCol = getElementsWithinColShape(source, "player") --local vehInCol = getElementsWithinColShape(source, "vehicle") if (isOpen == false) then local gx, gy, gz = getElementPosition(gate) local gz = gz + 3 moveObject(gate, 1200, gx, gy, gz, 0, 0, 0, "OutBounce") setElementData(gate, "gate.open", true) end end end end ) addEventHandler("onColShapeLeave", root, function(player, matchingDimension) local name = getElementData(source, "col.group") if (tostring(name) == tostring(getPlayerName(player))) then local gate = getElementData(source, "col.gate") if (gate) then local plrInCol = getElementsWithinColShape(source, "player") local vehInCol = getElementsWithinColShape(source, "vehicle") outputChatBox("1: " .. tostring(#plrInCol) .. ", 2: " .. tostring(#vehInCol), player) if ( #plrInCol == 0 and #vehInCol == 0 ) then local gx, gy, gz = getElementPosition(gate) gz = gz - 3 moveObject(gate, 1200, gx, gy, gz, 0, 0, 0, "OutBounce") setElementData(gate, "gate.open", false) end end end end ) Try that.