Jump to content

zMpyster

Members
  • Posts

    111
  • Joined

  • Last visited

Everything posted by zMpyster

  1. A foto que eu postei foi com a default-bold, já usei a sans tbm e continua com a impressão de desfoque
  2. edit = {} addEventHandler("onClientResourceStart", resourceRoot, function() edit[1] = guiCreateEdit(470, 217, 45, 21, "", false) edit[2] = guiCreateEdit(470, 246, 45, 21, "", false) edit[3] = guiCreateEdit(470, 275, 45, 21, "", false) edit[4] = guiCreateEdit(470, 306, 45, 21, "", false) edit[5] = guiCreateEdit(470, 337, 45, 21, "", false) edit[6] = guiCreateEdit(470, 395, 45, 21, "", false) edit[7] = guiCreateEdit(470, 516, 45, 21, "", false) edit[8] = guiCreateEdit(470, 366, 45, 21, "", false) edit[9] = guiCreateEdit(470, 426, 45, 21, "", false) edit[10] = guiCreateEdit(470, 455, 45, 21, "", false) edit[11] = guiCreateEdit(470, 484, 45, 21, "", false) edit[12] = guiCreateEdit(642, 217, 45, 21, "", false) edit[13] = guiCreateEdit(642, 275, 45, 21, "", false) edit[14] = guiCreateEdit(642, 306, 45, 21, "", false) edit[15] = guiCreateEdit(642, 246, 45, 21, "", false) edit[16] = guiCreateEdit(642, 335, 45, 21, "", false) edit[17] = guiCreateEdit(799, 217, 45, 21, "", false) edit[18] = guiCreateEdit(642, 365, 45, 21, "", false) edit[19] = guiCreateEdit(642, 394, 45, 21, "", false) edit[20] = guiCreateEdit(799, 248, 45, 21, "", false) edit[21] = guiCreateEdit(642, 426, 45, 21, "", false) edit[22] = guiCreateEdit(642, 456, 45, 21, "", false) edit[23] = guiCreateEdit(642, 485, 45, 21, "", false) edit[24] = guiCreateEdit(799, 275, 45, 21, "", false) edit[25] = guiCreateEdit(642, 514, 45, 21, "", false) edit[26] = guiCreateEdit(799, 304, 45, 21, "", false) edit[27] = guiCreateEdit(799, 333, 45, 21, "", false) edit[28] = guiCreateEdit(799, 365, 45, 21, "", false) edit[29] = guiCreateEdit(799, 394, 45, 21, "", false) edit[30] = guiCreateEdit(799, 426, 45, 21, "", false) edit[31] = guiCreateEdit(799, 457, 45, 21, "", false) edit[32] = guiCreateEdit(798, 485, 45, 21, "", false) edit[33] = guiCreateEdit(880, 298, 55, 27, "", false) edit[34] = guiCreateEdit(954, 298, 55, 27, "", false) Visible(false) end ) function Visible(confg) for i=1, 34 do guiSetVisible(edit[i], confg) guiEditSetMaxLength ( edit[i], 4 ) end end function painelRemoverMultas() dxDrawRectangle(x*331, y*143, x*705, y*482, tocolor(0, 0, 0, 147), false) dxDrawRectangle(x*432, y*143, x*512, y*34, tocolor(255, 255, 255, 147), false) Texto("PAGAR MULTAS", 432, 143, 944, 177, tocolor(255, 255, 255, 255), 1.80, "default", "center", "center", false, false, false, false, false) if getElementData(localPlayer, "tomoumulta".. 445) then Texto("Sandero: ".. getElementData(localPlayer, "tomoumulta".. 445), 368, 219, 462, 238, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Sandero: 0", 368, 219, 462, 238, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 602) then Texto("Porsche 911: ".. getElementData(localPlayer, "tomoumulta".. 602), 358, 246, 452, 265, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Porsche 911: 0", 358, 246, 452, 265, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 536) then Texto("SLK 350: ".. getElementData(localPlayer, "tomoumulta".. 536), 375, 277, 460, 296, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("SLK 350: 0", 375, 277, 460, 296, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 483) then Texto("Kombi: ".. getElementData(localPlayer, "tomoumulta".. 483), 393, 306, 456, 325, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Kombi: 0", 393, 306, 456, 325, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 542) then Texto("Corvette: ".. getElementData(localPlayer, "tomoumulta".. 542), 383, 337, 452, 356, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Corvette: 0", 383, 337, 452, 356, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 419) then Texto("Camaro SS: ".. getElementData(localPlayer, "tomoumulta".. 419), 371, 426, 452, 445, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Camaro SS: 0", 371, 426, 452, 445, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 492) then Texto("Honda Fit: ".. getElementData(localPlayer, "tomoumulta".. 492), 377, 515, 453, 537, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Honda Fit: 0", 377, 515, 453, 537, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 589) then Texto("BMW M235I: ".. getElementData(localPlayer, "tomoumulta".. 589), 361, 368, 456, 387, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("BMW M235I: 0", 361, 368, 456, 387, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 507) then Texto("Sonata: ".. getElementData(localPlayer, "tomoumulta".. 507), 393, 397, 453, 416, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Sonata: 0", 393, 397, 453, 416, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 466) then Texto("Civic Ferio: ".. getElementData(localPlayer, "tomoumulta".. 466), 379, 455, 452, 474, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Civic Ferio: 0", 379, 455, 452, 474, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 604) then Texto("Uno-S: ".. getElementData(localPlayer, "tomoumulta".. 604), 398, 484, 453, 505, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Uno-S: 0", 398, 484, 453, 505, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end Texto("VEÍCULO | MULTAS", 348, 186, 525, 201, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) Texto("VEÍCULO | MULTAS", 515, 186, 692, 201, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) if getElementData(localPlayer, "tomoumulta".. 494) then Texto("Ferrari FF: ".. getElementData(localPlayer, "tomoumulta".. 494), 542, 217, 636, 236, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Ferrari FF: 0", 542, 217, 636, 236, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 502) then Texto("GranTurismo: ".. getElementData(localPlayer, "tomoumulta".. 502), 535, 246, 629, 265, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("GranTurismo: 0", 535, 246, 629, 265, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 411) then Texto("Zonda: ".. getElementData(localPlayer, "tomoumulta".. 411), 564, 306, 629, 325, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Zonda: 0", 564, 306, 629, 325, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 404) then Texto("Logan: ".. getElementData(localPlayer, "tomoumulta".. 404), 569, 425, 622, 447, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Logan: 0", 569, 425, 622, 447, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 500) then Texto("Jipe: ".. getElementData(localPlayer, "tomoumulta".. 500), 579, 394, 624, 413, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Jipe: 0", 579, 394, 624, 413, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 579) then Texto("Palio EX: ".. getElementData(localPlayer, "tomoumulta".. 579), 558, 275, 629, 296, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Palio EX: 0", 558, 275, 629, 296, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 603) then Texto("Gallardo: ".. getElementData(localPlayer, "tomoumulta".. 603), 544, 456, 638, 475, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Gallardo: 0", 544, 456, 638, 475, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 551) then Texto("Fusion: ".. getElementData(localPlayer, "tomoumulta".. 551), 567, 365, 624, 384, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Fusion: 0", 567, 365, 624, 384, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 559) then Texto("Audi TT: ".. getElementData(localPlayer, "tomoumulta".. 559), 558, 335, 624, 355, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Audi TT: 0", 558, 335, 624, 355, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 600) then Texto("Montana: ".. getElementData(localPlayer, "tomoumulta".. 600), 554, 484, 624, 504, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Montana: 0", 554, 484, 624, 504, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 534) then Texto("Focus: ".. getElementData(localPlayer, "tomoumulta".. 534), 735, 217, 787, 236, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Focus: 0", 735, 217, 787, 236, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 580) then Texto("Fox: ".. getElementData(localPlayer, "tomoumulta".. 580), 745, 275, 788, 295, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Fox: 0", 745, 275, 788, 295, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 426) then Texto("Santana: ".. getElementData(localPlayer, "tomoumulta".. 426), 555, 514, 624, 533, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Santana: 0", 555, 514, 624, 533, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 405) then Texto("Vectra GT: ".. getElementData(localPlayer, "tomoumulta".. 405), 711, 246, 789, 265, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Vectra GT: 0", 711, 246, 789, 265, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end Texto("VEÍCULO | MULTAS", 677, 187, 854, 202, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) if getElementData(localPlayer, "tomoumulta".. 549) then Texto("Golf Sapao: ".. getElementData(localPlayer, "tomoumulta".. 549), 708, 304, 788, 324, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Golf Sapao: 0", 708, 304, 788, 324, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 421) then Texto("Siena: ".. getElementData(localPlayer, "tomoumulta".. 421), 737, 364, 789, 384, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Siena: 0", 737, 364, 789, 384, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 558) then Texto("Maverick GT: ".. getElementData(localPlayer, "tomoumulta".. 558), 703, 334, 788, 354, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else Texto("Maverick GT: 0", 703, 334, 788, 354, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 529) then Texto("Duster: ".. getElementData(localPlayer, "tomoumulta".. 529), 736, 394, 788, 414, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) else Texto("Duster: 0", 736, 394, 788, 414, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 477) then Texto("Diablo: ".. getElementData(localPlayer, "tomoumulta".. 477), 737, 425, 789, 445, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) else Texto("Diablo: 0", 737, 425, 789, 445, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 540) then Texto("Punto: ".. getElementData(localPlayer, "tomoumulta".. 540), 737, 456, 789, 476, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) else Texto("Punto: 0", 737, 456, 789, 476, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) end if getElementData(localPlayer, "tomoumulta".. 535) then Texto("Mustang GT: ".. getElementData(localPlayer, "tomoumulta".. 535), 705, 486, 793, 506, tocolor(255, 255, 255, 255), 1.000, "default", "center", "center", false, false, false, false, false) else Texto("Mustang GT: 0", 705, 486, 793, 506, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end Texto("SE NÃO TIVER O VEÍCULO, DIGITE O ID DELE AQUI E A QUANTIDADE DE MULTAS A SEREM PAGAS", 858, 212, 1030, 277, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, true, false, false, false) dxDrawLine(x*853, y*217, x*853, y*503, tocolor(255, 255, 255, 255), x*5, false) dxDrawRectangle(x*430, y*563, x*176, y*43, tocolor(255, 255, 255, 147), false) Texto("PAGAR", 430, 563, 608, 607, tocolor(255, 255, 255, 255), 1.40, "default-bold", "center", "center", false, true, false, false, false) dxDrawRectangle(x*753, y*561, x*176, y*43, tocolor(255, 255, 255, 147), false) Texto("VOLTAR", 753, 560, 931, 604, tocolor(255, 255, 255, 255), 1.40, "default-bold", "center", "center", false, true, false, false, false) Texto("ID", 877, 279, 935, 298, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) Texto("MULTAS", 954, 279, 1012, 298, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) end function Texto (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) dxDrawText(a, x*b, y*c, x*d, y*e, f, x*g, h, i, j, k, l, m, n, o) end
  3. olá gente fiz esse painel DX e ele funciona tudo certo só que tem um problema, se repararem ele está meio que desfocado, alguma sugestão?
  4. Basicamente esses tableVeh, era o valor de dentro e o "i" o index, ex tableVeh = { [1] = {valor1, valor2, valor3...} } tableVeh[1][1] -- Vai recuperar o valor1 do index1 da tabela tableVeh Isso seria bem útil para verificar o veículo assim ficando muito mais fácil verificar se ele é da tabela ou n, ai dps u veh = {} for i=1, 9 do veh[i] -- Isso vai fazer com que cada veículo fique "salvo" em cada número, o que tinha o index1 fica "salvo" em veh[1], e assim vai... end
  5. money = {} function verificarPag(player) local timer = getRealTime() local accName = getAccountName ( getPlayerAccount ( player )) if isObjectInACLGroup ("user."..accName, aclGetGroup("Mr")) then if timer.hour == 7 then --exports.Mr_Dxmessages:outputDx(player, "Seu pagamento está liberado , até as 08 horas! receba no /receber", "warning") money[player] = createPickup (1542, -1684, 14, 3, 1274, 0 ) else exports.Mr_Dxmessages:outputDx(player, "Você ainda não pode receber, somente as 08 horas!", "error") end end end addCommandHandler("receber", verificarPag) function receber (player) if source == money[player] then local timer = getRealTime() local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Mr") ) then if timer.hour == 7 then exports.Mr_Dxmessages:outputDx(player, "Você recebeu seu pagamento $500 ", "success") givePlayerMoney(player, 500) destroyElement(money[player]) end end end --addCommandHandler("receber", receber) addEventHandler ( "onPickupHit", resourceRoot, receber ) Tente assim. obs: não testei, qualquer erro me fale
  6. tableVeh = { [1] = {481, 1505.42102, -1753.69446, 13.54688}, [2] = {481, 1505.42102 +1, -1753.69446, 13.54688}, [3] = {481, 1505.42102 +2, -1753.69446, 13.54688}, [4] = {481, 1505.42102 +3, -1753.69446, 13.54688}, [5] = {481, 1505.42102 +4, -1753.69446, 13.54688}, [6] = {481, 1505.42102 +5, -1753.69446, 13.54688}, [7] = {481, 1505.42102 +6, -1753.69446, 13.54688}, [8] = {481, 1505.42102 +7, -1753.69446, 13.54688}, [9] = {481, 1505.42102 +8, -1753.69446, 13.54688}, [10] = {481, 1505.42102 +9, -1753.69446, 13.54688}, } addEventHandler("onResourceStart", resourceRoot, function() for i=1, 10 do veh[i] = createVehicle(tableVeh[i][1], tableVeh[i][2], tableVeh[i][3], tableVeh[i][4]) local rx, ry, rz = getElementRotation(veh[i]) setVehicleRespawnPosition(tableVeh[i][2], tableVeh[i][3], tableVeh[i][4], rx, ry, rz) addEventHandler("onVehicleStartEnter", veh[i], isTempOwner) end end ) timer = {} function isTempOwner(thePlayer) if not table.thePlayer then exports.dxmsgs:outputDx(thePlayer, "Você precisa alugar uma bike para poder usá-la", "error") cancelEvent() else for i=1, 10 do if source == veh[i] then playerAndI = getPlayerName(thePlayer) .."".. i timer[playerAndI] = setTimer ( function() respawnVehicle(veh[i]) if table.thePlayer then table.thePlayer = nil end end, 60000, 1) end end end end Não testei.
  7. Aé né, acabei me esquecendo, obrigado pela correção
  8. function plantDestroyIfPlayerQuit () newIndex = getPlayerName(source) .."".. indexPl[source] if plants[newIndex] and isElement(plants[newIndex] ) and getElementModel(plants[newIndex] ) == 862 then local numero = tonumber(indexPl[source]) for i=1,numero do destroyElement ( plants[newIndex] ) indexPl[source] = indexPl[source] -1 newIndex = getPlayerName(source) .."".. indexPl[source] end end end addEventHandler ("onPlayerQuit", getRootElement(), plantDestroyIfPlayerQuit) Se essa for sua ideia, tente assim.
  9. recomendo que quando for fazer função "onMarkerHit" use o resourceRoot ex: function saidafun(hitElement) if source == Sair then setElementDimension(hitElement, 0) setElementInterior(hitElement, 0) setElementPosition(hitElement, 902.76819, -1398.39978, 13.19219 -1) end end addEventHandler("onMarkerHit", resourceRoot, saidafun) Isso irá ajudar a n bugar markers entre scripts, exemplo, se vc tiver outro script com a marker chamada Sair, poderá bugar e vc ir parar aonde essa marker leva de vez a outra marker Sair.
  10. Você quer destruir as plantas quando ele sair, ou salvar na conta do player?
  11. Aé, acabei me esquecendo, quando coloca "and" automaticamente o valor vira o ultimo, ou seja dessa forma não mudou nada o problema local plants = {} local plants1 = {} local indexPl = {} function iniciarFarm8 ( client, x, y, z ) if not indexPl[client] then indexPl[client] = 1 else indexPl[client] = indexPl[client] + 1 end newIndex = getPlayerName(client) .."".. indexPl[client] plants[newIndex] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) newIndex = getPlayerName(thePlayer) .."".. indexPl[thePlayer] if plants[newIndex] and isElement(plants[newIndex] ) and getElementModel(plants[newIndex] ) == 862 then local numero = tonumber(indexPl[thePlayer]) for i=1,numero do destroyElement ( plants[newIndex] ) indexPl[thePlayer] = indexPl[thePlayer] -1 newIndex = getPlayerName(thePlayer) .."".. indexPl[thePlayer] end end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) Tente dessa forma, o ruim mesmo, é que eu não tenho como testar, ai tenho que ficar mandando sempre kk
  12. Sobre a função createElement, nunca tinha lido sobre ela, quando o resource for restartado, o setElementData, deixaria de existir certo, sendo assim de qualquer forma precisaria usar o setAccountData ou não?
  13. Olá gente, gostaria de saber se de alguma forma tem como salvar algo literalmente no server, ou se alguém tem algum ideia pra me dar, eu to em mente em fazer um script, onde um player será o dono de todos os postos da cidade e quando algum player comprar gasolina vai 80% do preço da gasolina pra ele, só que, queria algo, tipo um banco, onde armazenava todo o dinheiro que o posto arrecadasse, ou seja se usasse setElementData(dono...), não iria funcionar, pois no mesmo momento que o player saísse do server, pararia de ganhar o dinheiro das vendas de gasolina, será que tem alguma forma de salvar isso no server, pra quando a resource for stoppada ou restartada, salvasse automaticamente!
  14. local plants = {} local plants1 = {} local indexPl = {} function iniciarFarm8 ( client, x, y, z ) if not indexPl[client] then indexPl[client] = 1 else indexPl[client] = indexPl[client] + 1 end plants[client and indexPl[client]] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) if plants[thePlayer and indexPl[thePlayer]] and isElement(plants[thePlayer and indexPl[thePlayer]] ) and getElementModel(plants[thePlayer and indexPl[thePlayer]] ) == 862 then local numero = tonumber(indexPl[thePlayer]) for i=1,numero do destroyElement ( plants[thePlayer and indexPl[thePlayer]] ) indexPl[thePlayer] = indexPl[thePlayer] -1 end end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) Não testei, se tiver algum erro me fale
  15. plantsPoints = 0 local retanguloParaPlantio = createColRectangle ( 209.52605, 1906.70947, 155, 155 ) hillRadar = createRadarArea ( 209.52605, 1906.70947, 155, 155, 0, 255, 0, 175 ) function plant () local block, anim = getPedAnimation( localPlayer ) if block and anim then if block == "medic" and anim == "CPR" then outputChatBox (" voçê deve esperar 6 sec para plantar novamente " ) end return end local x, y, z = getElementPosition ( localPlayer ) triggerServerEvent ("iniciaJob8", localPlayer, localPlayer, x, y, z ) setTimer(function() plantsPoints = plantsPoints+1 outputChatBox( "Foi plantado "..(plantsPoints).."/2" ) if plantsPoints >= 2 then if plantsPoints >= 2 then outputChatBox ("voçê plantou todos") plantsPoints = 0 destroyElement ( hillRadar ) triggerServerEvent ( "onDestroyElement", localPlayer, localPlayer) end end end, 6500, 1) end addCommandHandler ( "d", plant ) addEventHandler("onClientColShapeLeave", retanguloParaPlantio, function ( theElement, matchingDimension ) if ( theElement == localPlayer ) then outputChatBox( "nop Function." ) removeCommandHandler ( "d", plant ) end end ) local plants = {} local plants1 = {} local indexPl = {} function iniciarFarm8 ( client, x, y, z ) if not indexPl[client] then indexPl[client] = 1 end indexPl[client] = indexPl[client] + 1 plants[indexPl[client]] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) if plants[indexPl[client]] and isElement(plants[indexPl[client]] ) and getElementModel(plants[indexPl[client]] ) == 862 then destroyElement ( plants[indexPl[client]] ) end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) Ainda ta com alguns bugs, más, ai vc conserta function plantDestroy ( thePlayer ) if plants[indexPl[thePlayer]] and isElement(plants[indexPl[thePlayer]] ) and getElementModel(plants[indexPl[thePlayer]] ) == 862 then local numero = tonumber(indexPl[thePlayer]) for i=1,numero do destroyElement ( plants[indexPl[thePlayer]] ) indexPl[thePlayer] = indexPl[thePlayer] -1 end end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) Aqui está pra destruir todas as plantas
  16. Use o debugscript, e fale o erro, fica ruim de resolve-lo sem saber aonde é
  17. Eu não sei nem como está removendo a ultima, o código de destruir o elemento esta com "plant", sendo que o que foi criado foi "plants", tenta mudar isso.
  18. triggerServerEvent ("iniciaJob8", localPlayer, localPlayer, x, y, z ) triggerServerEvent ( "onDestroyElement", localPlayer, localPlayer ) Coloca esses trigger no lugar para ver
  19. O erro ta sendo no trigger, recomendo que mande essa parte
  20. tente usar: addEventHandler("onElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" then if(p_lights[source] == 1) then if isTimer(p_timer[source]) then killTimer(p_timer[source]) end p_timer[source] = nil end end end)
  21. local plants = {} local plants1 = {} local indexPl = {} function iniciarFarm8 ( client, x, y, z ) if not indexPl[client] then indexPl[client] = 1 indexPl[client] = indexPl[client] + 1 plants[client][indexPl[client]] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) if plant[thePlayer][indexPl[thePlayer]] and isElement(plant[thePlayer][indexPl[thePlayer]]) and getElementModel( plant[thePlayer][indexPl[thePlayer]] ) == 862 then destroyElement ( plant[thePlayer][indexPl[thePlayer]] ) end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) Tenta assim, não testei o mod, por isso não sei se tem algum erro.
  22. Use desta forma local plants = {} local plants1 = {} function iniciarFarm8 ( client, x, y, z ) if plants[client] then plants1[client] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) else plants[client] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) edit: Não se esqueça de quando usar o triggeClientEvent ou triggerEvent, de colocar todas as variáveis que se pede (client, x, y, z)
  23. Você esta usando meu exemplo da parte de cima? se estiver faça dessa forma function plantDestroy ( thePlayer ) if plants[thePlayer] and isElement(plants[thePlayer]) and getElementModel( plants[thePlayer ) == 862 then destroyElement ( plants[thePlayer ) end if plants1[thePlayer] and isElement(plants1[thePlayer]) and getElementModel( plants1[thePlayer ) == 862 then destroyElement ( plants1[thePlayer ) end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy)
  24. Teste dessa forma function plantDestroy ( thePlayer ) if plant[thePlayer] and isElement(plant[thePlayer]) and getElementModel( plant[thePlayer ) == 862 then destroyElement ( plant[thePlayer ) end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy)
×
×
  • Create New...