JKzin Posted January 26 Share Posted January 26 (edited) Olá, como faço para colocar as funções de remover as peças do veículo, tem as funções de colocar, porém, não sei colocar as funções para remover. Spoiler local theTableMenuScroll = {} function startRollMessageMenu(text, r, g, b, data) table.insert(theTableMenuScroll,{text,r,g,b,data}) end function dxDrawingColorTextMenuScroll(str, ax, ay, bx, by, color, alpha, scale, font, alignX, alignY) if alignX then if alignX == "center" then elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end local boxSpace = dxGetFontHeight(1,"default-bold")+dxGetFontHeight(1,"default-bold")*0.1 local optionsTable = { ["player"] = { {"Give Bandage"}, {"Give Painkiller"}, {"Give Morphine"}, }, } function showClientMenuItem(arg1,arg2,arg3,arg4) theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) numberMenuScroll = 1 if arg1 == "Take" then startRollMessageMenu("Pegar item",250,250,250,arg2) setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "stop" then disableMenu() refreshLoot(false) end if arg1 == "Helicrashsite" then startRollMessageMenu("Abrir",250,250,250,"helicrashsite") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Hospitalbox" then startRollMessageMenu("Abrir",250,250,250,"hospitalbox") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "AIRDROP" then startRollMessageMenu("Abrir",250,250,250,"AIRDROP") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == 'militaryBox' then startRollMessageMenu('Abrir',250,250,250,'militaryBox') setElementData(localPlayer,'usedItemTrue', true) end if arg1 == 'smeltery' then startRollMessageMenu('Abrir',250,250,250,'militaryBox') setElementData(localPlayer,'usedItemTrue', true) end --========================================================addtenda if arg1 == "Vehicle" then setElementData(localPlayer,"usedItemTrue", true) startRollMessageMenu("Abrir",250,250,250,"object") setElementData(localPlayer,"usedItemTrue", true) if getElementData(getElementData(arg3,"parent"),"tent") then setElementData(localPlayer,"usedItemTrue", true) startRollMessageMenu("Remover tenda",250,250,250,"tent") setElementData(localPlayer,"usedItemTrue", true) return end -- if getElementData(getElementData(arg3,"parent"),"tent3") then -- startRollMessageMenu("Gear Tent",255,255,255,"object") -- startRollMessageMenu("Remove Tent",255,255,255,"tent3") tentar isso <<<< -- setElementData(localPlayer,"usedItemTrue", true) -- return -- end --======================================================== if (getElementData(arg4,"fuel") or 0) < getVehicleMaxFuel(arg4) then startRollMessageMenu("Colocar combustivel ("..tostring(math.floor(getElementData(arg4,"fuel") or 0)).."/"..getVehicleMaxFuel(arg4)..")",250,250,250,"FuelOne") setElementData(localPlayer,"usedItemTrue", true) setElementData(localPlayer,"isSetingTent",true) setTimer(function() setElementData(localPlayer,"isSetingTent",false) end,3000,1,localPlayer) end if (getElementData(arg4,"fuel") or 0) >= 20 then startRollMessageMenu("Tirar combustivel ("..tostring(math.floor(getElementData(arg4,"fuel") or 0)).."/"..getVehicleMaxFuel(arg4)..")",250,250,250,"FuelTwo") setElementData(localPlayer,"usedItemTrue", true) setElementData(localPlayer,"isSetingTent",true) setTimer(function() setElementData(localPlayer,"isSetingTent",false) end,3000,1,localPlayer) end --startRollMessageMenu("Equipment (Vehicle)",240,240,240,"vehicle") if getElementData(localPlayer,"Toolbox") >= 1 then if getElementHealth(arg3) < 1000 and getElementHealth(arg3) >= 100 then startRollMessageMenu("Reparar veiculo",250,250,250,"repairvehicle") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"vehicle_armor") or 0) < (getElementData(arg4,"armorPointsMax") or 0) then if (getElementData(localPlayer,"Steel Sheet") or 0) >= 1 then startRollMessageMenu("Colocar blindagem",250,250,250,"setListStale") setElementData(localPlayer,"usedItemTrue", true) end end local tires,engine,parts = getVehicleAddonInfos (getElementModel(arg3)) if (getElementData(arg4,"Engine_inVehicle") or 0) < engine then startRollMessageMenu("Colocar engine ("..(getElementData(arg4,"Engine_inVehicle") or 0).."/"..engine..")",250,250,250,"EngineOne") setElementData(localPlayer,"usedItemTrue", true) setElementData(localPlayer,"isSetingTent",true) setTimer(function() setElementData(localPlayer,"isSetingTent",false) end,3000,1,localPlayer) end if (getElementData(arg4,"Tire_inVehicle") or 0) < tires then local r,g,b = 240,240,240 if (getElementData(arg4,"Tire_inVehicle") or 0) == 3 then r,g,b = 189,187,37 elseif (getElementData(arg4,"Tire_inVehicle") or 0) == 2 then r,g,b = 249,157,11 elseif (getElementData(arg4,"Tire_inVehicle") or 0) == 1 then r,g,b = 255,0,0 elseif (getElementData(arg4,"Tire_inVehicle") or 0) == 0 then r,g,b = 255,0,0 end startRollMessageMenu("Colocar tire ("..(getElementData(arg4,"Tire_inVehicle") or 0).."/"..tires..")",r,g,b,"TireOne") end if (getElementData(arg4,"Parts_inVehicle") or 0) < parts then startRollMessageMenu("Colocar Tank Parts ("..(getElementData(arg4,"Parts_inVehicle") or 0).."/"..parts..")",250,250,250,"PartsOne") setElementData(localPlayer,"usedItemTrue", true) setElementData(localPlayer,"isSetingTent",true) setTimer(function() setElementData(localPlayer,"isSetingTent",false) end,3000,1,localPlayer) end end end if arg1 == "Player" then if isElement(arg2) and getElementData(arg2,"bleeding") > 0 and getElementData(getLocalPlayer(),"Bandage") >= 1 then startRollMessageMenu("Colocar bandage",250,250,250,"bandage") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Dead" then startRollMessageMenu("Abrir",250,250,250,"dead") startRollMessageMenu("Hora da morte",250,250,250,"deadreason") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Fireplace" then if getElementData(getLocalPlayer(),"Raw Meat") >= 1 then startRollMessageMenu("Assar Raw Meat",250,250,250,"fireplace") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "patrol" then if getElementData(getLocalPlayer(),"Empty Gas Canister") >= 1 then startRollMessageMenu("Encher Empty Gas Canister",250,250,250,"patrolstation") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Gear" then startRollMessageMenu("Abrir",250,250,250,"itemloot") setElementData(localPlayer,"usedItemTrue", true) end numberMenuScroll = 1 end addEvent("showClientMenuItem",true) addEventHandler("showClientMenuItem",getLocalPlayer(),showClientMenuItem) function PlayerScrollMenu (key,keyState,arg) if getElementData(localPlayer,"usedItemTrue") then if ( keyState == "down" ) then if arg == "up" then numberMenuScroll = numberMenuScroll-1 if numberMenuScroll < 1 then numberMenuScroll = #theTableMenuScroll end elseif arg == "down" then numberMenuScroll = numberMenuScroll+1 if numberMenuScroll > #theTableMenuScroll then numberMenuScroll = 1 end end end end end bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" ) bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" ) bindKey ( "pgup", "down", PlayerScrollMenu, "up" ) bindKey ( "pgdn", "down", PlayerScrollMenu, "down" ) function disableMenu() theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) setNewbieInfo (false,"","") end addEvent("disableMenu",true) addEventHandler("disableMenu",getLocalPlayer(),disableMenu) function refreshMenuCar() idd = numberMenuScroll theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) setNewbieInfo (false,"","") showClientMenuItem("Vehicle",nil,getElementData(getElementData(localPlayer,"currentCol"),"parent"),getElementData(localPlayer,"currentCol")) numberMenuScroll = idd end addEvent("refreshMenuCar",true) addEventHandler("refreshMenuCar",getLocalPlayer(),refreshMenuCar) function getPlayerInCol(tab) for theKey,thePlayer in ipairs(tab) do if thePlayer ~= getLocalPlayer() then return true end end return false end isInFirePlace = false function onPlayerTargetPickup (theElement) if getElementData(getLocalPlayer(),"isDead",true) then return end if theElement == getLocalPlayer() then if getElementData(source,"parent") == getLocalPlayer() then return end local player = getPlayerInCol(getElementsWithinColShape ( source, "player" )) if getPedOccupiedVehicle(getLocalPlayer()) then return end isInFirePlace = false setElementData(getLocalPlayer(),"isInFirePlace",false) if getElementData(source,"player") then showClientMenuItem("Player",getElementData(source,"parent")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) return end if player then return end --========================================================addtenda if getElementData(source,"tent") then if getElementData(source,"visible") == false then setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) return end end --======================================================== if getElementData(source,"patrolstation") then showClientMenuItem("patrol") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"","",source) return end if getElementData(source,"AirDrop") then showClientMenuItem("AIRDROP","airdrop") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setNewbieInfo (true,"","",source) return end if getElementData(source,"smeltery") then showClientMenuItem("smeltery","smeltery") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setElementData(getLocalPlayer(),"smeltery",true) setNewbieInfo (true,"","",source) return end if getElementData(source,'militaryBox') then showClientMenuItem('militaryBox','militaryBox') setElementData(localPlayer,'currentCol',source) setElementData(localPlayer,'loot',true) setElementData(localPlayer,'lootname','Gear') setNewbieInfo (true,'','',source) return end if getElementData(source,"fireplace") then showClientMenuItem("Fireplace") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Fireplace","Need: Raw Meat",source) isInFirePlace = true return end if getElementData(source,"deadman") then showClientMenuItem("Dead",getElementData(source,"playername")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..getElementData(source,"playername")..")") setNewbieInfo(true, "", "", source) return end if getElementData(source,"item") then showClientMenuItem("Take",getElementData(source,"item")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"",">> "..getElementData(source,"item").." <<\n\nPressione '-' ou 'scroll' para pegar o item!",source) return end if getElementData(source,"helicrash") then showClientMenuItem("Helicrashsite","helicrash") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"","",source) return end if getElementData(source,"hospitalbox") then showClientMenuItem("Hospitalbox","hospitalbox") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"","",source) return end if getElementData(source,"vehicle") and not getElementData(source,"deadVehicle") then if not getElementData(source,"tent") then name = getVehicleName(getElementData(source,"parent")) else name = "Tent" end showClientMenuItem("Vehicle",name,getElementData(source,"parent"),source) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..name..")") setNewbieInfo(true, "", "", source) return end if getElementData(source,"itemloot") then showClientMenuItem("Gear") setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setElementData(getLocalPlayer(),"currentCol",source) setNewbieInfo (true,"","",source) return end showClientMenuItem("stop") end end addEventHandler("onClientColShapeHit",getRootElement(),onPlayerTargetPickup) function onPlayerTargetPickup (theElement) if theElement == getLocalPlayer() then showClientMenuItem("stop") setElementData(getLocalPlayer(),"loot",false) setElementData(getLocalPlayer(),"currentCol",false) setElementData(getLocalPlayer(),"near_trader",false) setElementData(getLocalPlayer(),"near_trader_shape",nil ) setNewbieInfo (false,"","") isInFirePlace = false setElementData(getLocalPlayer(),"isInFirePlace",false) if getElementData(source,"smeltery") then setElementData(getLocalPlayer(),"smeltery",false) end end end addEventHandler("onClientColShapeLeave",getRootElement(),onPlayerTargetPickup) local screenWidth, screenHeight = guiGetScreenSize() local newbieShow = false local newbieHead = "-" local newbieText = "-" local newbiePosition = 0,0,0 function setNewbieInfo (show,head,text,element) newbieShow = show newbieHead = head newbieText = text newbiePosition = element end addEventHandler("onClientRender", getRootElement(), function() local boxSpace = dxGetFontHeight(1,"default-bold")+dxGetFontHeight(1,"default-bold")*0.1 local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then disableMenu() else for id, value in pairs(theTableMenuScroll) do if id == numberMenuScroll then r,g,b,a = 92,141,71,255 else r,g,b,a = 0,0,0,0 end dxDrawRectangle ( 0, 250+id*boxSpace, screenWidth*0.1, boxSpace, tocolor (r,g,b,a) ) dxDrawingColorTextMenuScroll(value[1],6 + 1, 250+id*boxSpace, 6 + 1, 250+(id+1)*boxSpace, tocolor(255,255,255,255),170, 1, "default-bold", "center", "center") dxDrawingColorTextMenuScroll(value[1],6, 250+id*boxSpace, 6, 250+(id+1)*boxSpace, tocolor(value[2],value[3],value[4],170),170, 1, "default-bold", "center", "center") end end if newbieShow == false then return end local x,y,z = getElementPosition(newbiePosition) local x,y = getScreenFromWorldPosition (x,y,z) local length = dxGetTextWidth(newbieText,1,"default-bold") --local xx,yy,xx2,yy2 = x-length/2, y-70/2, length+22, 70 if x and y then dxDrawImage ( x,y,screenWidth*0.027, screenHeight*0.04, "images/loot.png",tocolor(255,255,255)) isThereSomeoneInLoot() -- ANT DOOP DE ITENS end end ) function fireRaiseTemperature () if isInFirePlace then if getElementData(getLocalPlayer(),"temperature") <= 38 then setElementData(getLocalPlayer(),"temperature",getElementData(getLocalPlayer(),"temperature")+0.25) end end end setTimer(fireRaiseTemperature,10000,0) unbindKey("mouse3","both") function onPlayerPressMiddleMouse (key,keyState) if ( keyState == "down" ) then if not getElementData(localPlayer,"usedItemTrue") then return end local itemName = getMenuMarkedItem() if itemName == "helicrashsite" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "itemloot" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "hospitalbox" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "vehicle" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == 'militaryBox' then local col = getElementData(localPlayer,'currentCol') local gearName = 'Gear' refreshLoot(col,gearName) showInventoryManual() return end if itemName == "AIRDROP" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "smeltery" then local gearName = "Gear" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "repairvehicle" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent")) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Toolbox", 240, 240, 240 ) end disableMenu() return end if itemName == "object" then showInventory("j","down") return end if itemName == "FuelOne" then if (getElementData(getLocalPlayer(),"Full Gas Canister") or 0) >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if getElementData(col,"fuel")+20 < getVehicleMaxFuel(col) then addingfuel = 20 elseif getElementData(col,"fuel")+20 > getVehicleMaxFuel(col)+15 then triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Veiculo Cheio",240,240,240) disableMenu() return else addingfuel = getVehicleMaxFuel(col)-getElementData(col,"fuel") end setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) setElementData(getLocalPlayer(),"Full Gas Canister",getElementData(getLocalPlayer(),"Full Gas Canister")-1) setElementData(getLocalPlayer(),"Empty Gas Canister",(getElementData(getLocalPlayer(),"Empty Gas Canister") or 0)+1) setElementData(col,"fuel",getElementData(col,"fuel")+addingfuel) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Voce colocou combustivel",240,240,240) else startRollMessage2("Inventory", "Você não tem Full Gas Canister", 240, 240, 240 ) end playSound("sounds/Refuel.mp3") refreshMenuCar() disableMenu() return end if itemName == "FuelTwo" then if (getElementData(getLocalPlayer(),"Empty Gas Canister") or 0) >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(getLocalPlayer(),"Full Gas Canister",getElementData(getLocalPlayer(),"Full Gas Canister")+1) setElementData(getLocalPlayer(),"Empty Gas Canister",(getElementData(getLocalPlayer(),"Empty Gas Canister") or 0)-1) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) setElementData(col,"fuel",getElementData(col,"fuel")-20) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Voce removeu combustivel",240,240,240) else startRollMessage2("Inventory", "Você não tem Empty Gas Canister", 240, 240, 240 ) end playSound("sounds/Refuel.mp3") refreshMenuCar() disableMenu() return end if itemName == "AirDrop" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Airdrop" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "setListStale" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(localPlayer,"Steel Sheet") or 0) >= 1 then setElementData(col,"vehicle_armor",getElementData(col,"vehicle_armor") + 50) setElementData(localPlayer,"Steel Sheet",getElementData(localPlayer,"Steel Sheet") - 1) triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","Voce colocou Steel Sheet",240,240,240) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) if getElementData(col,"vehicle_armor") >= getElementData(col,"armorPointsMax") then setElementData(col,"vehicle_armor",getElementData(col,"armorPointsMax")) end end else startRollMessage2("Inventory", "Você não tem Toolbox", 240, 240, 240 ) end playSound("sounds/repair.mp3") refreshMenuCar() disableMenu() return end if itemName == "TireOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Tire") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Tire_inVehicle",(getElementData(col,"Tire_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Tire",(getElementData(getLocalPlayer(),"Tire") or 0)-1) triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","Voce colocou Tire",240,240,240) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Tire", 240, 240, 240 ) end else startRollMessage2("Inventory", "Você não tem Toolbox", 240, 240, 240 ) end playSound("sounds/repair.mp3") refreshMenuCar() disableMenu() return end if itemName == "EngineOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Engine") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Engine_inVehicle",(getElementData(col,"Engine_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Engine",(getElementData(getLocalPlayer(),"Engine") or 0)-1) triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","Voce colocou Engine",240,240,240) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Engine", 240, 240, 240 ) end else startRollMessage2("Inventory", "Você não tem Toolbox", 240, 240, 240 ) end playSound("sounds/repair.mp3") refreshMenuCar() disableMenu() return end if itemName == "PartsOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Tank Parts") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Parts_inVehicle",(getElementData(col,"Parts_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Tank Parts",(getElementData(getLocalPlayer(),"Tank Parts") or 0)-1) triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","Voce colocou Tank Parts",240,240,240) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Tank Parts", 240, 240, 240 ) end else startRollMessage2("Inventory", "Você não tem Toolbox", 240, 240, 240 ) end playSound("sounds/repair.mp3") refreshMenuCar() disableMenu() return end --========================================================addtenda if itemName == "tent" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("removeTent",getLocalPlayer(),getElementData(col,"parent")) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) playSound("sounds/tenda.mp3") disableMenu() return end --======================================================== if itemName == "fireplace" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("addPlayerCookMeat",getLocalPlayer()) disableMenu() return end if itemName == "bandage" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent")) disableMenu() return end if itemName == "giveblood" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent")) disableMenu() return end if itemName == "dead" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear ("..getElementData(col,"playername")..")" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "deadreason" then local col = getElementData(getLocalPlayer(),"currentCol") outputChatBox(getElementData(col,"deadreason"),240,240,240,true) return end if itemName == "patrolstation" then local col = getElementData(getLocalPlayer(),"currentCol") setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) setElementData(getLocalPlayer(),"Empty Gas Canister",getElementData(getLocalPlayer(),"Empty Gas Canister")-1) setTimer ( function() setElementData(getLocalPlayer(),"Full Gas Canister",(getElementData(getLocalPlayer(),"Full Gas Canister") or 0)+1) triggerEvent ("displayClientInfo",getLocalPlayer(),"patrolstation","Voce encheu Empty Gas Canister!",240,240,240) end, 5000, 1 ) playSound("sounds/Refuel.mp3") disableMenu() return end if isToolbeltItem(itemName) then local col = getElementData(getLocalPlayer(),"currentCol") hideRightClickInventoryMenu() refreshInventory() triggerEvent("hideInventoryManual",localPlayer) triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() return end if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) hideRightClickInventoryMenu() refreshInventory() setElementData(getLocalPlayer(),"loot",false) setElementData(getLocalPlayer(),"currentCol",false) disableMenu() else startRollMessage2("Inventory", "Seu inventario esta cheio!", 240, 240, 240 ) end end end bindKey ( "mouse3", "down", onPlayerPressMiddleMouse ) bindKey ( "-", "down", onPlayerPressMiddleMouse ) function getMenuMarkedItem() for i,guiItem in ipairs(spalteGuiText) do if getElementData(guiItem,"markedMenuItem") then return getElementData(guiItem,"usedItem") end end end function getMenuMarkedItem() for id, value in pairs(theTableMenuScroll) do if id == numberMenuScroll then return value[5] end end end Edited January 30 by Lord Henry Código convertido de texto para Lua. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now