Üzenetek megjelenítése

Ez a szekció lehetővé teszi a felhasználó által írt összes hozzászólás megtekintését. Vedd figyelembe, hogy csak azokba a fórumokba írt hozzászólásokat látod, amelyekhez hozzáférésed van.


Üzenetek - Chad12341

Oldalak: [1] 2
1
Segítségkérés / Admin stats
« Dátum: 2017. Július 10. - 19:33:24 »
Sziasztok, lenne egy olyan problémám hogy írtam egy olyan scriptet ami a szuperadminoknak elérhető ez nem más mint az astats és az megmutatja mennyi a küldött és mennyi a fogadott PM-e és a fixelés száma. Az vele a probléma hogy megírtam neki egy savefixek functiont : 
 

function savefixek(source, dataName,oldValue)
        if (dataName == \"char:adminduty\") and isElement(source) and getElementData(source, \"acc:admin\") >= 1 then
   local currFix = getElementData(source, \'admin:fixes\')
--   outputChatBox(currFix .. \" \" .. getPlayerName(source))
   dbExec(con, \"UPDATE characters SET fixVehicles=? WHERE id=\'\" .. getElementData(source, \"char:id\") .. \"\'\", currFix)
--      outputDebugString(getPlayerName(source) .. \" fixei mentve! (\" .. currFix .. \")\")
   end
end
addEventHandler(\"onElementDataChange\", getRootElement(), savefixek)

 
Valamint beleírtam a fixveh parancsba is hogy insertelje a mysqlbe
 
 
 

function fixPlayerVehicle(thePlayer, commandName, targetPlayer)
if getElementData(thePlayer, \"acc:admin\") >= 1 then

   if not (targetPlayer) then
      outputChatBox(\"#7cc576Használat: #ffffff/\" .. commandName .. \" [Név / ID]\", thePlayer, 255, 255, 255, true)
   else      
      local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(thePlayer, targetPlayer)
      local adminduty = getElementData(thePlayer, \"char:adminduty\")
      local alevel = getElementData(thePlayer, \"acc:admin\")
      local veh = getPedOccupiedVehicle(targetPlayer)
      local currFix = getElementData(thePlayer, \'admin:fixes\') or 0
      
         if not targetPlayer or not getElementData(targetPlayer, \"loggedin\") then return end
      
      if veh then
         if (adminduty) == 0 then
            if (alevel) >= 6 then
               fixVehicle(veh)
               triggerClientEvent(root, \"setvehicleCompVisible\", root, targetPlayer)
               outputChatBox(\"#32b3ef \" .. getPlayerAdminName(thePlayer) .. \"#ffffff megjavította a járművedet. \", targetPlayer, 255, 255, 255, true)
               outputChatBox(\"Sikeresen megjavítottad #7cc576\" .. targetPlayerName:gsub(\"_\", \" \") .. \"#ffffff járművét.\", thePlayer, 255, 255, 255, true)
               outputAdminMessage(\"#7cc576\" .. getPlayerAdminName(thePlayer) .. \"#ffffff megjavította #7cc576\" .. targetPlayerName:gsub(\"_\",\" \") .. \"#ffffff járművét.\")
               setElementData(thePlayer, \'admin:fixes\', currFix + 1)
               
               --adminlog
               dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, \"acc:id\"), \"FIXVEH\", \"\" .. getPlayerAdminName(thePlayer) .. \" megjavította \" .. targetPlayerName:gsub(\"_\",\" \") .. \" járművét.\", targetPlayerName, getElementData(targetPlayer, \"acc:id\"))
            else
               outputChatBox(exhiba .. \"Nincs jogosultságod adminduty-n kívül megjavítani a járművet. Hibakód: FIXVEHAD1\", thePlayer, 255, 255, 255, true)
               --adminlog
               dbExec(con, adminlog, getPlayerAdminName(thePlayer), getElementData(thePlayer, \"acc:id\"), \"FIXVEHAD1\", \"\" .. getPlayerAdminName(thePlayer) .. \" megpróbálta megjavitani \" .. targetPlayerName:gsub(\"_\",\" \") .. \" járművét. [ACCES DENIED] [Hibakod: FIXVEHAD1]\", targetPlayerName, getElementData(targetPlayer, \"acc:id\"))
            end
         else
            triggerClientEvent(root, \"setvehicleCompVisible\", root, targetPlayer)
            fixVehicle(veh)
            outputChatBox(\"#32b3ef \" .. getPlayerAdminName(thePlayer) .. \"#ffffff megjavította a járművedet. \", targetPlayer, 255, 255, 255, true)
            outputChatBox(\"Sikeresen megjavítottad #7cc576\" .. targetPlayerName:gsub(\"_\", \" \") .. \"#ffffff járművét.\", thePlayer, 255, 255, 255, true)
            outputAdminMessage(\"#7cc576\" .. getPlayerAdminName(thePlayer) .. \"#ffffff megjavította #7cc576\" .. targetPlayerName:gsub(\"_\",\" \") .. \"#ffffff járművét.\")
            --adminlog
               dbExec(con, \"UPDATE characters SET fixVehicles=? WHERE id=\'\" .. getElementData(thePlayer, \"char:id\") .. \"\'\", currFix)
         end
      else
         outputChatBox(exhiba .. \"A játékos nincsen járműben.\", thePlayer, 255, 255, 255, true)
      end
   end
end
end
addCommandHandler(\"fixveh\", fixPlayerVehicle, false, false)

 
Nem kezdi el beleírni a mysql-be a Characters/fixvehicles-be. az alapértelmezetten van és nem moccan sehova hogyha tolok egy reconnectet akkor 0-zódik a fixek száma IG. Ha valaki tudna ebben segíteni megköszönném.

2
Segítségkérés / Fekvőrendőr collision
« Dátum: 2017. Június 15. - 20:29:55 »
Sziasztok, azt szeretném megkérdezni, hogy mikre lenne szükség egy olyan script megírásához hogy egy adott sebességnél kikapcsoljon a fekvőrendőrnek a collisionje?

3
Segítségkérés / Fegyver attach a hátra
« Dátum: 2017. Április 17. - 17:29:26 »
És azzal mit lehet kezdeni hogy látszódjon a háton? hogyha már nem errorozik

4
Segítségkérés / Fegyver attach a hátra
« Dátum: 2017. Április 17. - 15:56:24 »
A Double MTA is ugyan ilyen rendszerrel használja csak nem az inventoryba van beleépítve hanem külön resource-ba és exportálja az item-systemet, de viszont ha úgy próbálom meg akkor sem látszik a hátán a fegyver.

5
Segítségkérés / Fegyver attach a hátra
« Dátum: 2017. Április 17. - 15:24:08 »
A currentInventory-val írta ki az errort

6
Segítségkérés / Fegyver attach a hátra
« Dátum: 2017. Április 17. - 15:17:29 »
Ahol az errort írta hozzáírtam egy ilyet:
 

function updatePlayerWeapons()
    triggerServerEvent(\"getPlayerItems\", localPlayer, localPlayer)
    setTimer(function()
        for k, v in pairs(exports[\'mta_item\']:getPlayeritems(localPlayer)) do <--- itt írta a hibát
            local item = v[1]
            local weaponID = getWeaponID(item) or 0
            if weaponID > 0 and not isInTable(localPlayer, weaponID) then
                triggerServerEvent(\"attachWeapon\", localPlayer, localPlayer, weaponID)
            end
        end
    end, 300, 1)
end

 
Az errort már nem írja viszont nem látszik a fegyver a háton

7
Segítségkérés / Fegyver attach a hátra
« Dátum: 2017. Április 17. - 14:56:24 »
Sziasztok, az External 2017.01.10_1.-ei kipublikált modban van az item-systemben egy weapon attach script, egyetlen egy errort ír a debugscript, valamint meg sem jelenik a háton egyik fegyver sem. Ha valaki tudna segíteni hogy mi lehet a probléma akkor megköszönném!
 
ERROR:mta_item\\weapon_client.lua:302: bad argument #1 to \'pairs\' (table expected, got nil)
 

local objs = {}
local playerCache = {}
local pedsToAttached = {}
local weaponModels = {
    --- uzi, mp3, tec9
    [28] = 352,
    [29] = 353,
    [32] = 372,
    --- deagle
    [24] = 348,
    --- shotgunok
    [25] = 349,
    [26] = 350,
    [27] = 351,
    --- nagykaliber
    [30] = 355,
    [31] = 356,
    --- ütőfegyverek
    --[2] = 333,
    [5] = 336,
    --[6] = 337,
    --[7] = 338,
    --[8] = 339,
    --- sniper
    [33] = 357,
    [34] = 358,
}
local attachedRootCache = {}
local pedWeapons = {}
function isInTable(ped, wep)
    if pedWeapons[ped] then
        for k, v in ipairs(pedWeapons[ped]) do
            if v == wep then
                return true, k
            end
        end
    end
    
    return false
end
function addWep(ped, wep)
    if not pedWeapons[ped] then
        pedWeapons[ped] = {}
    end
    table.insert(pedWeapons[ped], wep)
end
function attachWeaponToBone(ped, wep, walkingstyle)
    if weaponModels[wep] then
        if not objs[ped] then
            objs[ped] = {}
        end
        
        if isInTable(ped, wep) then return end
            
        local this = #objs[ped]+1
        objs[ped][this] = createObject(weaponModels[wep], 0, 0, 0)
        setElementData(objs[ped][this], \"wep\", wep)
        setElementData(objs[ped][this], \"owner\", ped)
        
        if not pedsToAttached[ped] then
            pedsToAttached[ped] = {}
        end
        if not attachedRootCache[ped] then
            attachedRootCache[ped] = {}
        end
        
        table.insert(attachedRootCache[ped], {wep, objs[ped][this]})
        local newKey = #pedsToAttached[ped]
        pedsToAttached[ped][newKey] = objs[ped][this]
        
        if wep == 29 or wep == 28 then
            exports.bone_attach:attachElementToBone(objs[ped][this], ped, 14, 0.1, 0.05, 0, 0, -90, 90)
        elseif wep == 16 or wep == 17 or wep == 18 then
            exports.bone_attach:attachElementToBone(objs[ped][this], ped, 14, 0.15, -0.1, 0.2, 0, 0, 90)
        elseif wep == 32 then
            exports.bone_attach:attachElementToBone(objs[ped][this], ped, 14, 0.12, 0.05, 0, 0, -90, 90)
        elseif wep == 22 or wep == 23 or wep == 24 then
            exports.bone_attach:attachElementToBone(objs[ped][this], ped, 13, -0.06, 0.05, 0, 0, -90, 90)
        elseif wep == 4 then
            exports.bone_attach:attachElementToBone(objs[ped][this], ped, 13, -0.035, -0.1, 0.3, 0, 0, 90)
        elseif wep == 27 or wep == 26 or wep == 25 then
            if walkingstyle == 131 or walkingstyle == 132 or walkingstyle == 133 or walkingstyle == 129 or walkingstyle == 126 or walkingstyle == 121 or walkingstyle == 122 or walkingstyle == 124 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 5, 0.16, 0, 0.1, 190, 30, -90)
            elseif walkingstyle == 125 then
                exports.bone_attach:attachElementToBone(objs[ped][ped][this], ped, 5, 0.16, 0, 0.1, 190, 30, -105)
            else
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 5, 0.16, 0, 0.1, 190, 20, -110)
            end
        elseif wep == 33 or wep == 34 then
            if walkingstyle == 131 or walkingstyle == 132 or walkingstyle == 133 or walkingstyle == 129 or walkingstyle == 126 or walkingstyle == 121 or walkingstyle == 122 or walkingstyle == 124 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 5, 0.16, 0, 0.1, 190, 30, -90)
            elseif walkingstyle == 125 then
                exports.bone_attach:attachElementToBone(objs[ped][ped][this], ped, 5, 0.16, 0, 0.1, 190, 30, -105)
            else
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 5, 0.16, 0, 0.1, 190, 20, -110)
            end
        elseif wep == 30 then
            if walkingstyle == 131 or walkingstyle == 132 or walkingstyle == 133 or walkingstyle == 129 or walkingstyle == 126 or walkingstyle == 121 or walkingstyle == 122 or walkingstyle == 124 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.08, -0.1, 0.2, 10, 165, 82)
            elseif walkingstyle == 125 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.08, -0.1, 0.2, 10, 165, 92)
            else
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.05, -0.1, 0.2, 10, 165, 95)
            end
        elseif wep == 31 then
            if walkingstyle == 131 or walkingstyle == 132 or walkingstyle == 133 or walkingstyle == 129 or walkingstyle == 126 or walkingstyle == 121 or walkingstyle == 122 or walkingstyle == 124 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.15, -0.1, -0.2, 185, 145, 82)
            elseif walkingstyle == 125 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.15, -0.1, -0.2, 185, 145, 92)
            else
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.12, -0.1, -0.2, 185, 145, 95)
            end
        elseif wep >= 2 and wep <= 8 and wep ~= 4 then
            if walkingstyle == 131 or walkingstyle == 132 or walkingstyle == 133 or walkingstyle == 129 or walkingstyle == 126 or walkingstyle == 121 or walkingstyle == 122 or walkingstyle == 124 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.08, 0, -0.02, 0, -90, 82)
            elseif walkingstyle == 125 then
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.08, 0, -0.02, 10, -90, 92)
            else
                exports.bone_attach:attachElementToBone(objs[ped][this], ped, 6, -0.08, 0, -0.02, 10, -90, 100)
            end
        end
    end
end
addEvent(\"attachWeaponToBody\", true)
addEventHandler(\"attachWeaponToBody\", root, function(player, wep)
    if not playerCache[player] then
        playerCache[player] = {}
    end
    if not playerCache[player][wep] then
        playerCache[player][wep] = true
    end
    if isElementStreamedIn(player) then
        if not isInTable(player, wep) then
            attachWeaponToBone(player, wep, getPedWalkingStyle(player))
            addWep(player, wep)
        end
    end
end)
addEvent(\"removeWeaponFromBone\", true)
addEventHandler(\"removeWeaponFromBone\", root, function(player, wep)
    if playerCache[player] then
        if playerCache[player][wep] then
            local tbl, key = isInTable(player, wep)
            
            if tbl then
                pedWeapons[player][key] = nil
            end
            
            if attachedRootCache[player] then
                for k, v in pairs(attachedRootCache[player]) do
                    if v[1] == wep and isElement(v[2]) then
                        exports.bone_attach:detachElementFromBone(v[2])
                        destroyElement(v[2])
                        attachedRootCache[player][k] = nil
                    end
                end
            end
            playerCache[player][wep] = nil
        end
    end
end)
addEventHandler(\"onClientElementDataChange\", root, function(dataName)
    if source and dataName == \"char:adminduty\" then
        if getElementData(source, dataName) == 1 then
            if getElementType(source) == \"player\" then
                if objs[source] then
                    for k, v in ipairs(objs[source]) do
                        if isElement(v) then
                            destroyElement(v)
                            exports.bone_attach:detachElementFromBone(v)
                        end
                    end
                end
                objs[source] = {}
                pedWeapons[source] = {}
            end
        else
            if getElementType(source) == \"player\" then
                if playerCache[source] then
                    for wep, _ in pairs(playerCache[source]) do
                        if not isInTable(player, wep) then
                            attachWeaponToBone(source, wep, getPedWalkingStyle(source))
                            addWep(source, wep)
                        end
                    end
                end
            end
        end
    end
end)
--if getElementData(value, \"char:weaponInHand\")[1] or -1 > 0 then
    --if getWeaponModel(items[getElementData(value, \"char:weaponInHand\")[1] ][5]) ~= getElementModel(weapon) then
addEventHandler(\"onClientElementDataChange\", root, function(dataName)
    if source and dataName == \"char:weaponInHand\" then
        local weapon = getElementData(source, dataName)[3] or -1
        
        if weapon > 0 then
            if objs[source] then
                for k, v in ipairs(objs[source]) do
                    if isElement(v) and getElementModel(v) == weaponModels[weapon] then
                        setElementAlpha(v, 0)
                    end
                end
            end
        else
            if objs[source] then
                for k, v in ipairs(objs[source]) do
                    if isElement(v) and getElementAlpha(v) == 0 then
                        setElementAlpha(v, 255)
                    end
                end
            end
        end
    end
end)
addEvent(\"updateWeapons\", true)
addEventHandler(\"updateWeapons\", root, function(player)
    if getElementType(player) == \"player\" then
        if objs[player] then
            for k, v in ipairs(objs[player]) do
                if isElement(v) then
                    destroyElement(v)
                    exports.bone_attach:detachElementFromBone(v)
                end
            end
        end
        objs[player] = {}
        pedWeapons[player] = {}
        if playerCache[player] then
            for wep, _ in pairs(playerCache[player]) do
                if not isInTable(player, wep) then
                    attachWeaponToBone(player, wep, getPedWalkingStyle(player))
                    addWep(player, wep)
                end
            end
        end
    end    
end)
addEventHandler(\"onClientElementStreamIn\", root, function()
    if getElementType(source) == \"player\" then
        if playerCache[source] then
            for wep, _ in pairs(playerCache[source]) do
                if not isInTable(player, wep) then
                    attachWeaponToBone(source, wep, getPedWalkingStyle(source))
                    addWep(source, wep)
                end
            end
        end
    end
end)                            
addEventHandler(\"onClientElementStreamOut\", root, function()
    if getElementType(source) == \"player\" then
        if objs[source] then
            for k, v in ipairs(objs[source]) do
                if isElement(v) then
                    destroyElement(v)
                    exports.bone_attach:detachElementFromBone(v)
                end
            end
        end
        objs[source] = {}
        pedWeapons[source] = {}
    end
end)
addEvent(\"getPlayerInventory\", true)
addEventHandler(\"getPlayerInventory\", root, function(table)
    currentInventory = {}
    currentInventory = table
end)
 
function updatePlayerWeapons()
    triggerServerEvent(\"getPlayerItems\", localPlayer, localPlayer)
    setTimer(function()
        for k, v in pairs(currentInventory) do
            local item = v[1]
            local weaponID = getWeaponID(item) or 0
            if weaponID > 0 and not isInTable(localPlayer, weaponID) then
                triggerServerEvent(\"attachWeapon\", localPlayer, localPlayer, weaponID)
            end
        end
    end, 300, 1)
end
addEventHandler(\"onClientResourceStart\", resourceRoot, function()
    if getElementData(localPlayer, \"loggedin\") then
        updatePlayerWeapons()
    end
    triggerServerEvent(\"getAllWeaponCache\", localPlayer)
end)
addEvent(\"receiveWeaponCache\", true)
addEventHandler(\"receiveWeaponCache\", root, function(data)
    for k, v in pairs(data) do
        if isElement(k) and k ~= localPlayer then
            playerCache[v] = {}
            for wep,_ in pairs(v) do
                playerCache[v][wep] = true
                if isElementStreamedIn(k) then
                    if not isInTable(k, wep) then
                        attachWeaponToBone(k, wep, getPedWalkingStyle(k))
                        addWep(k, wep)
                    end
                end
            end
        end
    end
end)
addEventHandler(\"onClientPlayerQuit\", getRootElement(), function()
    if objs[source] then
        for k, v in ipairs(objs[source]) do
            if isElement(v) then
                destroyElement(v)
                exports.bone_attach:detachElementFromBone(v)
            end
        end
    end
    playerCache[source] = nil
    pedWeapons[source] = nil
    objs[source] = nil
end)

 
 

8
Segítségkérés / Szerelő script lagg
« Dátum: 2016. December 13. - 17:54:23 »
Itt az egész client oldali script esetleg ha valaki rátudna jönni mi lehet megköszönném
 

if fileExists(\"client.lua\") then
fileDelete(\"client.lua\")
end   
local monitorSize = {guiGetScreenSize()}
local panelSize = {350, 30}
local vehicleComponents = {}
local damageComponents = {}
local damageParts = {}
local loadingVehicleDamage = false
local isPedinVehicle = false
local mechanic = false
local sound = false
local font = dxCreateFont(\":mta_score/files/myriadproregular.ttf\",9) --<[ Font ]>--
local font2 = dxCreateFont(\":mta_score/files/myriadproregular.ttf\",11) --<[ Font ]>--
local font3 = dxCreateFont(\":mta_score/files/myriadproregular.ttf\",10) --<[ Font ]>--
local mechanic_progress_tick = 0
local mechanic_progress_max = panelSize[1]
local mechanic_progress_text = \"\"
local mechanic_progress_arguments = {}
local ColhapePos = {
{1632.9809570313, -2138.9689941406, 13.63906288147, 10, 10,4},
{1646.7819824219, -2139.0419921875, 13.63906288147, 10, 10,4},
{1619.1810302734, -2139.0419921875, 13.63906288147, 10, 10,4},
{1631.8903808594, -2175.7092285156, 13.631258010864, 10, 12,4},
{1618.0882568359, -2175.7080078125, 13.631258010864, 10, 12,4},
{1604.2884521484, -2175.7080078125, 13.631258010864, 10, 12,4},
{1590.4876708984, -2175.7082519531, 13.631258010864, 10, 12,4},
}
local createdMechanicCols = {}
local object1 = {}
local objectCol = {}
local vehiceLiftPanel = false
local currentLiftID = 0
 
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), function()
for index, value in ipairs (ColhapePos) do
   createdMechanicCols[index] = createColCuboid(value[1], value[2], value[3]-1, value[4], value[5], value[6])
   setElementData(createdMechanicCols[index], \"mechanic:boxID\", index)
end      
setElementData(localPlayer, \"current\", false)
end)
local vehicleElement = nil
addEventHandler(\"onClientColShapeHit\", getRootElement(),
function(player)
   if player ~= getLocalPlayer() then return end
   if (source and exports[\"exg_dashboard\"]:isPlayerInFaction(11)) then
      if (source == createdMechanicCols[getElementData(source, \"mechanic:boxID\")]) then
         mechanic = true
      elseif source:getData(\"mechanic:liftID\") and isPedInVehicle(localPlayer) then
         triggerServerEvent(\"attachFunction\", localPlayer, getPedOccupiedVehicle(localPlayer), source:getData(\"mechanic:liftID\"), 0)
         currentLiftID = source:getData(\"mechanic:liftID\")
         vehicleElement = getPedOccupiedVehicle(localPlayer)
      end
   end
end
)
addEventHandler(\"onClientColShapeLeave\", getRootElement(),
function(player)
   if player ~= getLocalPlayer() then return end
   if (source) then
      if (source == createdMechanicCols[getElementData(source, \"mechanic:boxID\")]) then
         mechanic = false
      end
   end
end
)
 
function vehicleLiftClick(button, state, x, y, elementx, elementy, elementZ, element)
if element and (element:getData(\"mechanic:Object\") or 0) > 0 and not isPedInVehicle(localPlayer) then
   if state == \"down\" and button == \"right\" and exports[\"exg_dashboard\"]:isPlayerInFaction(11) then
      local x, y, z = getElementPosition(getLocalPlayer())
      if getElementData(element, \"moving\") then outputChatBox(\"#F7CA18[ExternalGaming - Emelő] #ffffffEz az emelő már használatba van próbáld újra.\",255,255,255,true) return end
      if getElementData(localPlayer, \"current\") then outputChatBox(\"#F7CA18[ExternalGaming - Emelő] #ffffffTe már használsz egy emelőt próbáld később.\",255,255,255,true) return end
      if getDistanceBetweenPoints3D(x, y, z, elementx, elementy, elementZ) <= 5 then
         if not vehiceLiftPanel then  
            local liftID = tonumber(element:getData(\"mechanic:Object\") or 0)
            triggerServerEvent(\"moveObjectFunction\", localPlayer, localPlayer, element, objectTable[liftID][2], objectTable[liftID][3], objectTable[liftID][4]+2)
            if vehicleElement then
               setElementData(vehicleElement, \"forklift\", true)
            end
            vehiceLiftPanel = true
            local sound = playSound(\"files/lift.mp3\", true)
            setTimer(function()
               if isElement(sound) then
                  stopSound(sound)
               end
            end,10000, 1)
         else
            local liftID = tonumber(element:getData(\"mechanic:Object\") or 0)
            if vehicleElement then
               triggerServerEvent(\"detachFunction\", localPlayer, vehicleElement)   
               setElementData(vehicleElement, \"forklift\", false)
            end
            triggerServerEvent(\"moveObjectFunction\", localPlayer, localPlayer, element, objectTable[liftID][2], objectTable[liftID][3], objectTable[liftID][4])
            vehiceLiftPanel = false   
            local sound = playSound(\"files/lift.mp3\", true)
            setTimer(function()
               if isElement(sound) then
                  stopSound(sound)
               end
            end,10000, 1)
         end
      end
   end
end
end
addEventHandler(\"onClientClick\", root, vehicleLiftClick)
function drawMechanicPanel ()
if not isPedInVehicle(localPlayer) and mechanic and exports[\"exg_dashboard\"]:isPlayerInFaction(11)  then
   if #damageParts > 0 then
      dxDrawRectangle(monitorSize[1] - 200, monitorSize[2]/2 - (#damageParts*22 + 10)/2, 200, (#damageParts*22 + 10),tocolor(0,0,0,160)) -- Player Cuccok kirajzolasa ami nemfer componentbe
      for partIndex, partValue in pairs(damageParts) do
         dxDrawRectangle(monitorSize[1] - 200, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex / 22 - 16, 200, 20,tocolor(0, 0, 0,240))
         dxDrawText(\"ExternalGaming - #7cc576Mechanic\",monitorSize[1] - 200+5, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex / 22 - 16+2, 200, 20, tocolor(255, 255, 255, 255), 1, font, \"left\", \"top\", false, false, false, true)
         if isInSlot(monitorSize[1] - 190, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, 180, 20) then
            dxDrawRectangle(monitorSize[1] - 190, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, 180, 20,tocolor(124, 197, 118,180))
            dxDrawText(partValue[1],monitorSize[1] - 190 +180/2, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, monitorSize[1] - 190+180/2, 20 + monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, tocolor(0, 0, 0, 255), 1, font, \"center\", \"center\", false, false, false, true)
         else
            dxDrawRectangle(monitorSize[1] - 190, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, 180, 20,tocolor(0,0,0,180))
            dxDrawText(partValue[1],monitorSize[1] - 190+180/2, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16,monitorSize[1] - 190+180/2, 20 + monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, tocolor(255, 255, 255, 255), 1, font, \"center\", \"center\", false, false, false, true)
         end
         
      end
   end
   
   local state = getVehicleTarget()[1]
   local veh = getVehicleTarget()[2]
   isPedinVehicle = veh
   if mechanic_progress_state then
      mechanic_progress_tick = mechanic_progress_tick + 0.5
      if mechanic_progress_tick >= mechanic_progress_max then
         mechanic_progress_state = false
         mechanic_progress_tick = 0
         callRightFunction(mechanic_progress_text, mechanic_progress_arguments)
         mechanic_progress_text = \"\"
      end
      dxDrawRectangle(monitorSize[1]/2 - panelSize[1]/2, monitorSize[2] - panelSize[2]-60, panelSize[1], panelSize[2],tocolor(0, 0, 0,180))
      dxDrawRectangle(monitorSize[1]/2 - panelSize[1]/2, monitorSize[2] - panelSize[2]-60, mechanic_progress_tick, panelSize[2],tocolor(124, 197, 118,180))
      dxCreateBorder(monitorSize[1]/2 - panelSize[1]/2, monitorSize[2] - panelSize[2]-60, panelSize[1], panelSize[2],tocolor(0,0,0,255))
      dxDrawText(mechanic_progress_text, monitorSize[1]/2 - panelSize[1]/2 + panelSize[1]/2, monitorSize[2] - panelSize[2]-60 +panelSize[2]/2 , monitorSize[1]/2 - panelSize[1]/2 + panelSize[1]/2, monitorSize[2] - panelSize[2]-60 +panelSize[2]/2, tocolor(0, 0, 0, 255), 1, font3, \"center\", \"center\", false, false, false, true)
   end
   if not state or getElementData(veh, \"player->repairing\") then return end
   for k,v in pairs (damageComponents) do
      if vehicleComponents[v[4]] then
         local text = v[1]
         local text_kieg = \"\"
         local x = vehicleComponents[v[4]][2]
         local y = vehicleComponents[v[4]][3]
         
         if getVehicleComponentVisible(veh, v[4]) then
            text_kieg = \"leszerelése\"
         end
         if not getVehicleComponentVisible(veh, v[4]) then
            text_kieg = \"felszerelése\"
         end
         
         local width = dxGetTextWidth(text .. \" \" .. text_kieg,1)*1.2
         
         if isInSlot(x-5 - (width+25)/2, y, width+25, 25) then
            dxDrawRectangle(x-5 - (width+25)/2, y, width+25, 25,tocolor(124, 197, 118,220))
            dxDrawText(text .. \" \" .. text_kieg, x - (width+25)/2, y, width+15 + x - (width+25)/2, 25 + y, tocolor(0, 0, 0, 255), 1, font2, \"center\", \"center\", false, false, false, true)
         else
            dxDrawRectangle(x-5 - (width+25)/2, y, width+25, 25,tocolor(0, 0, 0,200))
            dxDrawText(text .. \" \" .. text_kieg, x - (width+25)/2, y, width+15 + x - (width+25)/2, 25 + y, tocolor(255, 255, 255, 255), 1, font2, \"center\", \"center\", false, false, false, true)
         end
         dxCreateBorder(x-5 - (width+25)/2, y, width+25, 25,tocolor(0,0,0,255))
      end
   end
end
end
addEventHandler(\"onClientRender\", root, drawMechanicPanel)
function functionClick(Button, state, playerx, playery)
if Button == \"left\" and state == \"down\" and loadingVehicleDamage then
   if mechanic_progress_state then outputChatBox(\"#19B5FE[ExternalGaming - Mechanic] #ffffffEgyszerre csak egy folyamatot végezhetsz\", 255, 255, 255, true) return end
   for k,v in pairs (damageComponents) do
      if vehicleComponents[v[4]] then
         local text = v[1]
         local x = vehicleComponents[v[4]][2]
         local y = vehicleComponents[v[4]][3]
         local width = dxGetTextWidth(text,1)*1.4
         if dobozbaVan(x-5 - (width+25)/2, y, width+25, 25, playerx, playery) then
            if getVehicleComponentVisible(v[5], v[4]) then
               mechanic_progress_state = true
               mechanic_progress_text = v[1]..\" leszerelése folyamatban\"
               mechanic_progress_tick = 0
               mechanic_progress_arguments = {v[1], v[5], v[4]}
               
               sound = playSound(\"files/mechanic.mp3\", true)
               setSoundVolume(sound, 1)
               
               setElementData(v[5], \"player->repairing\", true)
               setElementData(localPlayer, \"player->repairing\", true)
               triggerServerEvent(\"playerAnimationToServer\", localPlayer, localPlayer, \"BOMBER\", \"BOM_Plant\")
               exports.mta_chat:sendLocalMeMessage(localPlayer,\"elkezdte leszerelni a(z) \".. v[1] .. \"-t\")
            else
               if exports[\'mta_item\']:hasItem(localPlayer, v[6], 1) then
                  triggerServerEvent(\"playerAnimationToServer\", localPlayer, localPlayer, \"BOMBER\", \"BOM_Plant\", v[6])
                  mechanic_progress_state = true
                  mechanic_progress_text = v[1]..\" felszerelése folyamatban\"
                  mechanic_progress_tick = 0
                  mechanic_progress_arguments = {v[1], v[5], v[4]}
                  sound = playSound(\"files/mechanic.mp3\", true)
                  setSoundVolume(sound, 1)
                  exports.mta_chat:sendLocalMeMessage(localPlayer,\"elkezdte felszerelni a(z) \".. v[1] .. \"-t\")
                     
                  setElementData(v[5], \"player->repairing\", true)
                  setElementData(localPlayer, \"player->repairing\", true)
                  updateVehicleComponent(v[5], v[4], \"create\")
               else
                  outputChatBox(\"#19B5FE[ExternalGaming - Mechanic] #ffffff Nincs meg a megfelelő alkatrész a szereléshez. #7cc576(\" .. exports[\'mta_item\']:getItemName(v[6])..\")\", 255, 255, 255, true)
               end
            end
         end
      end
   end
   for partIndex, partValue in pairs(damageParts) do
      if dobozbaVan(monitorSize[1]- 110, monitorSize[2]/2 - (#damageParts*22 + 10)/2 + partIndex * 22 - 16, 100, 20, playerx, playery) then      
         if partValue[1] == \"Motor javítása\" then
            triggerServerEvent(\"player->repairEngine\", localPlayer, localPlayer, isPedinVehicle)
         end
      end
   end
end
end
addEventHandler(\"onClientClick\", getRootElement(), functionClick)
 
function callRightFunction(text, v)
if text == v[1]..\" leszerelése folyamatban\" then
   updateVehicleComponent(v[2], v[3], \"remove\")
   if isElement(sound) then destroyElement(sound) end
   
   triggerServerEvent(\"playerAnimationToServer\", localPlayer, localPlayer, nil, nil)
   setElementData(localPlayer, \"player->repairing\", false)
elseif text == v[1]..\" felszerelése folyamatban\" then
   updateVehicleComponent(v[2], v[3], \"create\")
   if isElement(sound) then destroyElement(sound) end
   
   setElementData(localPlayer, \"player->repairing\", false)
   triggerServerEvent(\"playerAnimationToServer\", localPlayer, localPlayer, nil, nil)
else

end
setElementData(v[2], \"player->repairing\", false)
end
function getVehicleTarget()
if not isPedInVehicle(localPlayer) and mechanic then
   vehicleComponents = {}
   damageParts = {}
   loadingVehicleDamage = false
   isPedinVehicle = false
   local playerX, playerY, playerZ = getElementPosition(localPlayer)
   for index, value in ipairs (getElementsByType(\"vehicle\")) do
      local vehicleX, vehicleY, VehicleZ = getElementPosition(value)
      if getDistanceBetweenPoints3D(playerX, playerY, playerZ, vehicleX, vehicleY, VehicleZ) < 5 then
         if not loadingVehicleDamage then
            loadingVehicleDamage = true
            getVehicleDamagedComponent(value)
            for componentName in pairs (getVehicleComponents(value)) do
               local x,y,z = getVehicleComponentPosition (value,componentName,\"world\")
               local wx,wy,wz = getScreenFromWorldPosition (x,y,z)
               if wx and wy then
                  vehicleComponents[componentName] = {componentName,wx,wy}
               end
               setElementData(value, \"player->repairing\", false)
            end
            if (getElementHealth(value) < 999) then
               damageParts[#damageParts + 1] = {\"Motor javítása\"}
            end
            loadingVehicleDamage = true
         end
         return {true,value}
      end
   end
   return {false,false}
end
end

function getVehicleDamagedComponent(vehicle)
if exports[\"exg_dashboard\"]:isPlayerInFaction(11) then
   if not isElement(vehicle) then
      return
   end
   damageComponents = {}
   local panelNames = {{\"Bal első panel\",\"\", 67}, {\"Jobb első panel\",\"\", 68}, {\"Bal hátsó panel\",\"\", 69}, {\"Jobb hátsó panel\",\"\", 70}, {\"Szélvédő\",\"windscreen_dummy\", 71}, {\"Első lökhárító\",\"bump_front_dummy\", 72}, {\"Hátsó lökhárító\",\"bump_rear_dummy\", 83}}
   for i = 0, 6 do
      local panelState = getVehiclePanelState(vehicle, i)
      if (panelState ~= 0) then
         damageComponents[#damageComponents + 1] = {panelNames[i + 1][1], 1, i, panelNames[i + 1][2], vehicle, panelNames[i + 1][3]}
         --setElementData(vehicle, \"player->panel\", true) -- Beállítás Leszerelésre.
      end
   end
   local doorNames = {{\"Motorháztető\",\"bonnet_dummy\", 73}, {\"Csomagtartó\",\"boot_dummy\", 74}, {\"Bal első ajtó\",\"door_lf_dummy\", 75}, {\"Jobb első ajtó\",\"door_rf_dummy\", 76}, {\"Bal hátsó ajtó\",\"door_lr_dummy\", 77}, {\"Jobb hátsó ajtó\",\"door_rr_dummy\", 78}}
   for i = 0, 5 do
      local doorState = getVehicleDoorState(vehicle, i)
      if (doorState ~= 0) then
         damageComponents[#damageComponents + 1] = {doorNames[i + 1][1], 2, i, doorNames[i + 1][2], vehicle, doorNames[i + 1][3]}
         setElementData(vehicle, \"player->door\", 1) -- Beállítás Leszerelésre.
      end
   end
--   if getElementData(vehicle, \"forklift\") then
      local wheelNames = {{\"Bal első kerék\",\"wheel_lf_dummy\", 79}, {\"Bal hátsó kerék\",\"wheel_lb_dummy\", 80}, {\"Jobb első kerék\",\"wheel_rf_dummy\", 81}, {\"Jobb hátsó kerék\",\"wheel_rb_dummy\", 82}}
      local fLeftWheel, rLeftWheel, fRightWheel, rRightWheel = getVehicleWheelStates(vehicle)
      if (fLeftWheel ~= 0) then
         damageComponents[#damageComponents + 1] = {wheelNames[1][1], 3, 1, wheelNames[1][2], vehicle, wheelNames[1][3]}
         setElementData(vehicle, \"player->fLeftWheel\", 1) -- Beállítás Leszerelésre.
      end
      if (rLeftWheel ~= 0) then
         damageComponents[#damageComponents + 1] = {wheelNames[2][1], 3, 2, wheelNames[2][2], vehicle, wheelNames[2][3]}
         setElementData(vehicle, \"player->rLeftWheel\", 1) -- Beállítás Leszerelésre.
      end
      if (fRightWheel ~= 0) then
         damageComponents[#damageComponents + 1] = {wheelNames[3][1], 3, 3, wheelNames[3][2], vehicle, wheelNames[3][3]}
         setElementData(vehicle, \"player->fRightWheel\", 1) -- Beállítás Leszerelésre.
      end
      if (rRightWheel ~= 0) then
         damageComponents[#damageComponents + 1] = {wheelNames[4][1], 3, 4, wheelNames[4][2], vehicle, wheelNames[4][3]}   
         setElementData(vehicle, \"player->rRightWheel\", 1) -- Beállítás Leszerelésre.
      end   
   --end
   return damageComponents
end
end
-- Component törlés
function updateVehicleComponent(element, componentName, type)
if element and componentName then
   if type == \"remove\" then
      triggerServerEvent(\"player->removeComponentFromVehicle\", localPlayer, localPlayer, element, componentName)
   else
      triggerServerEvent(\"player->updateComponentVehicle\", localPlayer, localPlayer, element, componentName)
      
      if string.find(componentName, \"wheel\") then
         triggerServerEvent(\"player->repairWheel\", localPlayer, localPlayer, element, componentName)
      end
      if componentName == \"windscreen_dummy\" or componentName == \"bump_front_dummy\" or componentName == \"bump_rear_dummy\" then
         triggerServerEvent(\"player->repairPanel\", localPlayer, localPlayer, element, getDamagedPanelID(componentName))
      end
      if componentName == \"bonnet_dummy\" or componentName == \"boot_dummy\" or componentName == \"door_lf_dummy\" or componentName == \"door_rf_dummy\" or componentName == \"door_lr_dummy\" or componentName == \"door_rr_dummy\" then
         triggerServerEvent(\"player->repairDoors\", localPlayer, localPlayer, element, getDamagedDoorID(componentName))
      end
   end
end
end
function receiveRemove(element, componentName)
if element and componentName then
   setVehicleComponentVisible(element, componentName, false)
end
end
addEvent(\"player->removeComponentFromVehicleG\", true)
addEventHandler(\"player->removeComponentFromVehicleG\", root, receiveRemove)
function receiveCreate(element, componentName)
if element and componentName then
   setVehicleComponentVisible(element, componentName, true)
end
end
addEvent(\"player->updateComponentVehicleG\", true)
addEventHandler(\"player->updateComponentVehicleG\", root, receiveCreate)
-- Component törlés vége
local panelID = {
{\"Front-left panel\", 0}, -- Nem Hasznalt cucc
{\"Front-right panel\", 1}, -- Nem Hasznalt cucc
{\"Rear-left panel\", 2}, -- Nem Hasznalt cucc
{\"Rear-right panel\", 3}, -- Nem Hasznalt cucc
{\"windscreen_dummy\", 4},
{\"bump_front_dummy\", 5},
{\"bump_rear_dummy\", 6},
}
local doorID = {
{\"bonnet_dummy\", 0},
{\"boot_dummy\", 1},
{\"door_lf_dummy\", 2},
{\"door_rf_dummy\", 3},
{\"door_lr_dummy\", 4},
{\"door_rr_dummy\", 5},
}
function getDamagedPanelID(componentName)
for k, v in ipairs(panelID) do
   if tostring(componentName) == tostring(v[1]) then
      return v[2]
   end
end
return false
end
function getDamagedDoorID(componentName)
for k, v in ipairs(doorID) do
   if tostring(componentName) == tostring(v[1]) then
      return v[2]
   end
end
return false
end
function isInSlot(xS,yS,wS,hS)
if(isCursorShowing()) then
   XY = {guiGetScreenSize()}
   local cursorX, cursorY = getCursorPosition()
   cursorX, cursorY = cursorX*XY[1], cursorY*XY[2]
   if(dobozbaVan(xS,yS,wS,hS, cursorX, cursorY)) then
      return true
   else
      return false
   end
end   
end
 
function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
   return true
else
   return false
end
end
function dxCreateBorder(x,y,w,h,color)
dxDrawRectangle(x,y,w+1,1,color) -- Fent
dxDrawRectangle(x,y+1,1,h,color) -- Bal Oldal
dxDrawRectangle(x+1,y+h,w,1,color) -- Lent Oldal
dxDrawRectangle(x+w,y+1,1,h,color) -- Jobb Oldal
end

 
 

9
Segítségkérés / Szerelő script lagg
« Dátum: 2016. December 10. - 13:16:13 »
Idézetet írta: AlexSwamp date=1481365294


   
      Debugscript 3-t érdemes használni, lehet valamit nem tud letölteni vagy pedig olyan jót sikerült megírniuk, hogy renderbe került valami olyan aminek nem kellett volna. Lehetséges egy rakat dolog amitől laggolhat, ezt így azért random senki nem fogja neked kiszülni, mert nem mágus senki. Vagy nézd meg milyen hibakódot/kódokat kapsz és ha van akkor is, illetve ha nincs akkor is a scriptet érdemes társítani ide.
      Köszönöm, hogy te legalább segítettél valamit nem úgy mint Incama!
   


 

10
Segítségkérés / Szerelő script lagg
« Dátum: 2016. December 09. - 15:33:23 »
Üdv mindenkinek belenéztem az external gaming-es szerelő scriptbe hogy is működik stb. de az a probléma hogy ha valaki elkezdi szerelni a kocsit akkor olyan mint ha ping laggja lenne de elég keményen, ennek mi lehet az oka?

11
Segítségkérés / Téli időszámítás
« Dátum: 2016. December 05. - 16:40:24 »
Sikerült megoldanom, köszönöm a segítséget

12
Segítségkérés / Téli időszámítás
« Dátum: 2016. December 03. - 13:08:23 »
sajnos nem igazán sikerült megoldani

13
Modellezés / Modell hiba
« Dátum: 2016. November 26. - 13:17:03 »
Sziasztok, miért van az hogy modelleztem egy plázát és berakom egy object helyére és az alap gta object texturája ottmarad, de viszont áttudok rajta futni? és hogyha felé repülök akkor ott tudok mászkálni a láthatatlan modellen.

14
Segítségkérés / gate-system
« Dátum: 2016. November 22. - 17:23:46 »
tudnál valami segítséget adni hogy mégis hogy kéne megadni neki az értéket?

15
Segítségkérés / gate-system
« Dátum: 2016. November 21. - 14:22:57 »
Az értéket a MYSQL-ből kellene neki lekérni, mert MYSQL-el működik a rendszer csak hiába szúrok be egy kaput sql táblába IG nem jelenik meg sehogy sem.

Oldalak: [1] 2
SimplePortal 2.3.7 © 2008-2024, SimplePortal