Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 19/09/19 in Posts

  1. Why bother, he's asking for help. Nothing to shame him for.
    1 point
  2. local rnd = math.random(1, #cells[dim]) "attempt to get length of field '?' (a nil value)" means you've tried to get the length (# operator) of a nil value (cells[dim]), which means there is no value in the cells table with the index corresponding to the value of dim. Your if-check sets the value of dim to the value of defaultCells, 174, but cells[174] also doesn't exist. Only cells[10] exists. cells = { --[Int ID] = {{Cellák pos}} [10] = {215.36199951172, 108.91190338135, 1000.9522705078, 180}, [10] = {219.84390258789, 108.5353012085, 1000.9569702148, 180}, [10] = {223.37170410156, 107.92459869385, 1000.8811035156, 180}, [10] = {227.17649841309, 107.85209655762, 1000.6198120117, 180}, } By the way, you can't have multiple values under one index. The table above, after construction, is equivalent to cells = { [10] = {227.17649841309, 107.85209655762, 1000.6198120117, 180} } that is, every line starting with [10] = overrides the previous line starting with [10] = You probably wanted something like cells = { --[Int ID] = { [Dim ID] = { {Cellák pos}, {Cellák pos}, ... }, } [10] = { -- in interior 10 [174] = { -- in dimension 174 {215.36199951172, 108.91190338135, 1000.9522705078, 180}, -- first cell in int 10 dim 174 {219.84390258789, 108.5353012085, 1000.9569702148, 180}, -- second cell in int 10 dim 174 {223.37170410156, 107.92459869385, 1000.8811035156, 180}, -- third cell in int 10 dim 174 {227.17649841309, 107.85209655762, 1000.6198120117, 180}, -- fourth cell in int 10 dim 174 }, }, } -- ... local int = getElementInterior(player) if int == 0 or not cells[int] then -- if interior is 0 or there are no cells in the interior int = defaultInt -- set int to default (10) end local dim = getElementDimension(player) if not cells[int][dim] then -- if there are no cells in that interior and dimension dim = defaultCells -- set dimension to default (174) end local rnd = math.random(1, #cells[int][dim]) -- pick a random cell from 1 to however many there are for that interior and dimension local randomCell = cells[int][dim][rnd] -- index the cells table for the random cell -- ...
    1 point
  3. function verificarpeso () peso_atual = var1 --variavel que tem o peso atual da mochila peso_max = var2 -- variavel que tem o peso maximo peso_item = var3 -- peso do item if ((peso_atual + peso_item) <= peso_max) then --Se o peso atual + peso do item for menor OU IGUAL ao peso maximo então --compra end end Na real nem precisa ser uma function é só fazer a verificação no script antes de comprar if ((pesoatual + peso_item) <= peso_max) then --Compra end
    1 point
  4. هو ماقال كودك فيه خطأ او مايشتغل , مجرد تحقق ماله داعي شاله او ماشاله بيأثر كثير لكن الأفضل يشيله
    1 point
  5. Aonde tá a dificuldade de fazer uma depuração e testar os resultados... local function initializeOnVehicleEnter (p, s) --if p and s == 0 and pizzaSkins[getElementModel(p)] and pizzaVehicles[getElementModel(source)] then if getElementData ( p, "Emprego" ) == "Transportador" then if isElementWithinMarker( p, MarkerSafeTransportador) then local sourcePos = {getElementPosition(p)} local playerZone = getZoneName (sourcePos[1], sourcePos[2], sourcePos[3], true) outputChatBox("playerZone: "..tostring(playerZone), p) outputChatBox("locations[playerZone]: "..tostring(locations[playerZone]), p) if locations[playerZone] then if triggerClientEvent (p, "requestTransportadorjobStart", p, locations[playerZone]) then outputChatBox("Evento 'requestTransportadorjobStart' chamado com sucesso", p) end exports.Scripts_Dxmessages:outputDx( p, "Você Pegou os Malotes, Siga o Checkpoint para Entregar!", "info") --outputChatBox ("* PIZZA * Dica:#FFFFFF Utilize o Botão esquerdo do Mouse para Entregar a Pizza!", p, 255, 50, 50, true) end sourcePos = nil playerZone = nil else outputChatBox("Você não esta na marker!", p) end else outputChatBox("Você não é Transportador!", p) end end
    1 point
  6. ما شاء الله تنسيق رائع ومود جميل لكن بيكون افضل لو تعطينا صور ضض
    1 point
  7. re-upload please theme IA please
    1 point
×
×
  • Create New...