Aruna Posted October 1, 2014 Share Posted October 1, 2014 (edited) Hola, le queria contar el problema que me tira este script, Cuando uno se acerca alguna gasolinera del servidor no aparese los carteles o mensajes de que precionen "J" "-" para abrir o recargar gasolina, pienso que los patrol estan mal configurado. Este Vendria siendo el script completo. --[[ #---------------------------------------------------------------# ----* DayZ MTA Script menu_client.lua *---- ----* Script *---- ----* New additions and functions by: Unknown *---- #---------------------------------------------------------------# ]] local theTableMenuScroll = {} function createScrollMenuMessage(text, r, g, b, data) table.insert(theTableMenuScroll,{text,r,g,b,data}) end function showClientMenuItem(arg1,arg2,arg3,arg4) theTableMenuScroll = {} setElementData(getLocalPlayer(),"usedItem",false) numberMenuScroll = 1 if arg1 == "Take" then createScrollMenuMessage("Take "..arg2,255,255,255,arg2) setElementData(getLocalPlayer(),"usedItem",true) end if arg1 == "stop" then disableMenu() refreshLoot(false) end if arg1 == "Helicrashsite" then createScrollMenuMessage("Gear Helicrash",255,255,255,"helicrashsite") setElementData(getLocalPlayer(),"usedItem",true) end if arg1 == "Hospitalbox" then createScrollMenuMessage("Gear Hospitalbox",255,255,255,"hospitalbox") setElementData(getLocalPlayer(),"usedItem",true) end if arg1 == "Vehicle" then createScrollMenuMessage("Gear ("..arg2..")",255,255,255,"vehicle") setElementData(getLocalPlayer(),"usedItem",true) if getElementData(getElementData(arg3,"parent"),"tent") then createScrollMenuMessage("Remove Tent",255,255,255,"tent") return end if getElementHealth(arg3) <= 999 and getElementData(getLocalPlayer(),"Toolbox") >= 1 then createScrollMenuMessage("Repair ("..arg2..")",255,255,255,"repairvehicle") setElementData(getLocalPlayer(),"usedItem",true) end if getElementData(getLocalPlayer(),"Toolbox") >= 1 then createScrollMenuMessage("Remove Tire ("..arg2..")",255,255,255,"removetire") setElementData(localPlayer,"usedItem",true) end if getElementData(getLocalPlayer(),"Toolbox") >= 1 then createScrollMenuMessage("Remove Engine ("..arg2..")",255,255,255,"removeengine") setElementData(localPlayer,"usedItem",true) end end if arg1 == "Player" then if 0 < getElementData(arg2, "bleeding") and 1 <= getElementData(getLocalPlayer(), "Bandage") then number = number + 1 guiSetVisible(spalteGuiImage[number], true) guiSetText(spalteGuiText[number], "Give Bandage") guiLabelSetColor(spalteGuiText[1], 50, 255, 50) setElementData(spalteGuiText[1], "markedMenuItem", true) setElementData(spalteGuiText[number], "usedItem", "bandage") end if getElementData(arg2, "blood") < 11900 and 1 <= getElementData(getLocalPlayer(), "Blood Bag") then number = number + 1 guiSetVisible(spalteGuiImage[number], true) guiSetText(spalteGuiText[number], "Administer Blood Bag") setElementData(spalteGuiText[number], "usedItem", "giveblood") if number == 1 then guiLabelSetColor(spalteGuiText[number], 50, 255, 50) setElementData(spalteGuiText[number], "markedMenuItem", true) end end end if arg1 == "Dead" then createScrollMenuMessage("Gear ("..arg2..")",255,255,255,"dead") createScrollMenuMessage("Check Body",255,255,255,"deadreason") setElementData(getLocalPlayer(),"usedItem",true) if getElementData(getLocalPlayer(),"Shovel") >= 1 then createScrollMenuMessage("Hide Body",255,255,255,"hidebody") setElementData(getLocalPlayer(),"usedItem",true) end end if arg1 == "Fireplace" then if getElementData(getLocalPlayer(),"Raw Meat") >= 1 then createScrollMenuMessage("Cook Meat",255,255,255,"fireplace") setElementData(getLocalPlayer(),"usedItem",true) end end if arg1 == "patrol" then if getElementData(getLocalPlayer(),"Jerry Can (Empty)") >= 1 then createScrollMenuMessage("Refill Jerry Can (Empty)",255,255,255,"patrolstation") --setElementData(getLocalPlayer(),"usedItem",true) setElementData(getLocalPlayer(), "usedItem", "patrolstation") end end if arg1 == "Wirefence" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then createScrollMenuMessage("Remove Wire Fence",255,255,255,"wirefence") --setElementData(getLocalPlayer(),"usedItem",true) setElementData(getLocalPlayer(), "usedItem", "wirefence") end end if arg1 == "Bottle" then if getElementData(getLocalPlayer(),"Empty Water Bottle") >= 1 then createScrollMenuMessage("Refill Empty Water Bottle",255,255,255,"bottle") setElementData(getLocalPlayer(),"usedItem",true) end end if arg1 == "Gear" then createScrollMenuMessage("Gear",255,255,255,"itemloot") --setElementData(getLocalPlayer(),"usedItem",true) setElementData(getLocalPlayer(), "usedItem", "itemloot") end numberMenuScroll = 1 end addEvent("showClientMenuItem",true) addEventHandler("showClientMenuItem",getLocalPlayer(),showClientMenuItem) function startScrollMenu(key,keyState,arg) if getElementData(getLocalPlayer(),"usedItem") 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",startScrollMenu,"up") bindKey("mouse_wheel_down","down",startScrollMenu,"down") function disableMenu() theTableMenuScroll = {} setElementData(getLocalPlayer(),"usedItem",false) setNewbieInfo (false,"","") end addEvent("disableMenu",true) addEventHandler("disableMenu",getLocalPlayer(),disableMenu) 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 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 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 if getElementData(source,"patrolstation") then showClientMenuItem("patrol") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true,"Jerry Can (Empty)","Press '-' or 'middle-mouse' to refill a jerry can! \nREQUIRED: Jerry Can (Empty)",source) return end if getElementData(source,"bottlestation") then showClientMenuItem("Bottle Station") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true,"Water Bottle","Press '-' or 'middle-mouse' to refill a water bottle ! \nREQUIRED: Empty Water Bottle",source) return end if getElementData(source,"wirefence") then showClientMenuItem("Wirefence") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true,"Wirefence","Press '-' or 'middle-mouse' to remove the fence! \nREQUIRED: Toolbox",source) return end if getElementData(source,"fireplace") then showClientMenuItem("Fire Place") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true,"Fire Place","Press '-' or 'middle-mouse' to cook meat! \nREQUIRED: 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,"Gear","Press J to access the gear menu!",source) return end if getElementData(source,"item") then showClientMenuItem("Take",getElementData(source,"item")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true,"Item pickup","Press '-' or 'middle-mouse' to pick this item up!",source) return end if getElementData(source,"helicrash") then showClientMenuItem("Helicrash","helicrash") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear (Helicrash)") setNewbieInfo(true,"Gear Helicrash","Press J to access the gear menu!",source) return end if getElementData(source,"hospitalbox") then showClientMenuItem("Hospitalbox","hospitalbox") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear (Hospitalbox)") setNewbieInfo(true,"Gear Hospitalbox","Press J to access the gear menu!",source) return end if getElementData(source,"vehicle") then if not getElementData(source,"deadVehicle") then showClientMenuItem("Vehicle",(getVehicleName(getElementData(source,"parent")) or "Tent"),getElementData(source,"parent")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..(getVehicleName(getElementData(source,"parent")) or "Tent")..")") setNewbieInfo(true,"Gear","Press J to acess the gear menu!",source) return end end if getElementData(source,"itemloot") then showClientMenuItem("Gear") setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setElementData(getLocalPlayer(),"currentCol",source) setNewbieInfo(true,"Gear","Press J to access the gear menu!",source) return Edited October 2, 2014 by Guest Link to comment
Tomas Posted October 1, 2014 Share Posted October 1, 2014 Ningún debug? Extrema paja de buscar el error. Link to comment
Bc# Posted October 1, 2014 Share Posted October 1, 2014 Esas 500 lineas las puedes resumir a 100 usando tablas, así es mucho mas fácil detectar errores. Link to comment
Aruna Posted October 2, 2014 Author Share Posted October 2, 2014 jaja me re olvide de las imagenes XDD Link to comment
Recommended Posts