Jump to content

~Guh.?

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

~Guh.?'s Achievements

Vic

Vic (3/54)

0

Reputation

  1. locais screenW , screenH = guiGetScreenSize () local exibir_painel = função falsa PainelDX () dxDrawLine (( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , false ) dxDrawLine ( telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawLine (( telaW * 0,3807 ) - 1 , tela H * 0,7734 , telaW * 0,6208 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawLine ( telaW * 0,6208 , telaH * 0,7734 , telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawRectangle ( telaW * 0,3807 , telaH * 0,1615 , telaW * 0,2401 , telaH * 0,6120 , tocolor ( 3 , 0 , 0 , 153 ), falso ) dxDrawImage ( telaW * 0,4290 , telaH * 0,2227 , screenW * 0,1435 , screenH * 0.2747 , ": guieditor / images / examples / LavarMoney.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) dxDrawText ( "Lavagem de Dinheiro" , screenW * 0.4305 , screenH * 0,1693 , tela W * 0,5652 , tela H * 0,2005 , tocolor ( 255 , 255 , 255 , 255 ), 0,70 , "bankgothic" , "center" , "center" , false , false , false , false , false ) dxDrawText ( "O dinheiro sujo pode ser lavado 100 mil por PenDrive com Trojan" , screenW * 0,4173 , tela H * 0,5117 , tela W * 0,5798 , tela H * 0,5638 , tocolor ( 255 , 255 , 255 , 255 ), 0,50 , "bankgothic" , "center" , "center" , false , true , false , false , false ) dxDrawLine (( screenW * 0.4239 ) - 1 , ( screenH * 0.6237 ) - 1 , ( telaW * 0,4239 ) - 1 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine ( telaW * 0,5798 , ( telaH * 0,6237 ) - 1 , ( telaW * 0,4239 ) - 1 , ( telaH * 0,6237 ) - 1 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine (( telaW * 0,4239 ) - 1 , telaH * 0,7018 , telaW * 0,5798 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine ( telaW * 0,5798 , telaH * 0,7018 , screenW * 0.5798, (screenH * 0.6237) - 1, tocolor(255, 3, 3, 254), 1, false) dxDrawRectangle(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781, tocolor(11, 0, 0, 203), false) dxDrawText("Lavar", screenW * 0.4231, screenH * 0.6237, screenW * 0.5798, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.6040) - 1, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false) dxDrawLine(screenW * 0.6179, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false) dxDrawLine((screenW * 0.6040) - 1, screenH * 0.1953, screenW * 0.6179, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false) dxDrawLine(screenW * 0.6179, screenH * 0.1953, screenW * 0.6179, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false) dxDrawRectangle(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260, tocolor(0, 0, 0, 131), false) dxDrawText("X", screenW * 0.6032, screenH * 0.1693, screenW * 0.6179, screenH * 0.1953, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "center", "center", false, false, false, false, false) end addEvent("Exibir_Painel_Ao_Hitar_O_Marker", true) addEventHandler("Exibir_Painel_Ao_Hitar_O_Marker", root, function() if exibir_painel == false then addEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = true showCursor(true) else RemoveEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = false showCursor(false) end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end -- Modified version for DX Text function isCursorOverText(posX, posY, sizeX, sizeY) if ( not isCursorShowing( ) ) then return false end local cX, cY = getCursorPosition() local screenWidth, screenHeight = guiGetScreenSize() local cX, cY = (cX*screenWidth), (cY*screenHeight) return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) ) end addEventHandler("onClientClick", getRootElement(), function(button, state) if button == "left" and state == "down" then if exibir_painel == true then if isMouseInPosition(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260) then removeEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = false showCursor(false) end end end end) local Sujo = getElementData(source, "moneysujo") or 0 addEventHandler("onClientClick", getRootElement(), function(button, state) if button == "left" and state == "down" then if exibir_painel == true then if isMouseInPosition(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781) then if Sujo >= 100000 and "PenDrive Com Trojan" then setElementData(source, "moneysujo", -100000) givePlayerMoney(source, givePlayerMoney(source)+100000) end end end end end) Estou fazendo um script com Painel DX e estou tendo problema na parte de limpar o dinheiro pois não está funcionando eu clicko no botão de "Lavar" e não tira os 100k de dinheiro sujo para virar 100k limpo além disso para conseguir fazer essa lavagem com o dinheiro precisa está com um PenDrive com Trojan para cada lavagem de dinheiro, ou seja, cada pendrive lava 100k alguem pode me ajudar Imagem do painel: https://uploaddeimagens.com.br/imagens/NXxdneg
  2. Well, I'm setting up a shopping mall with a gym, driving school, market, etc. I'm facing a problem with the clothes shop with the SCRIPT below because the maker has a problem that I can't solve and that's why I'm asking for help in this shopping mall I'm doing his clothing store is on the 4th floor I put the maker in the place where I wanted it so that the character can pass over the maker to perform the function while it is working normal but in the same place where the maker is other floors below when I pass it ends up executing the function of changing clothes being that the maker is on the top floor it seems that the maker is extended infinitely down where you can only see him on the 4th floor I need the help of someone who can me to help -- Tables local theCategories = { [0]="Camisetas", [1]="Cabelo", [2]="Calças/bermudas", [3]="Tênis", [4]="Tattoos: Left Upper Arm", [5]="Tattoos: Left Lower Arm", [6]="Tattoos: Right Upper Arm", [7]="Tattoos: Right Lower Arm", [8]="Tattoos: Back", [9]="Tattoos: Left Chest", [10]="Tattoos: Right Chest", [11]="Tattoos: Stomach", [12]="Tattoos: Lower Back", [13]="Cordões", [14]="Relógios", [15]="Bandanas", [16]="Boné", [17]="Extras" } local theMarkers = { {1873.4399414063,-1320.1826171875,28.4921875} -- Grove street --[[ {1097.14661, -1433.43970, 15, 0, 0}, -- Dev one {2123.725, -1198.089, 23.207, 0, 0}, -- Glen Park {1467.643, -1119.731, 23.152, 0, 0}, -- Downtown]]-- } local x, y, z, int, dim = nil, nil, nil, nil, nil local pricesModel = {} local previousModel = nil -- GUI Window CJClothesWindow = guiCreateWindow(509,153,444,480,"Roupas do CJ",false) CJClothesLabel1 = guiCreateLabel(12,22,203,16,"Categorias:",false,CJClothesWindow) guiLabelSetHorizontalAlign(CJClothesLabel1,"center",false) guiSetFont(CJClothesLabel1,"default-bold-small") CJClothesCatoGrid = guiCreateGridList(9,41,214,320,false,CJClothesWindow) guiGridListSetSelectionMode(CJClothesCatoGrid,0) CJClothesItemGrid = guiCreateGridList(225,40,210,321,false,CJClothesWindow) guiGridListSetSelectionMode(CJClothesItemGrid,0) CJClothesLabel2 = guiCreateLabel(230,22,203,16,"Items:",false,CJClothesWindow) guiLabelSetHorizontalAlign(CJClothesLabel2,"center",false) guiSetFont(CJClothesLabel2,"default-bold-small") CJClothesLabel3 = guiCreateLabel(9,400,422,46,"Clique duas vezes em um item para alterar as roupas do CJ.\nSe você gostar da roupa cliquem em salvar, caso contrário clicando em guardar para voltar.\nEsta pele será salvo e definir quando usar a pele CJ.",false,CJClothesWindow) guiLabelSetHorizontalAlign(CJClothesLabel3,"center",false) CJClothesLabel4 = guiCreateLabel(15,452,414,20,"Total preço: $0",false,CJClothesWindow) guiLabelSetColor(CJClothesLabel4,48,128,20) guiLabelSetHorizontalAlign(CJClothesLabel4,"center",false) guiSetFont(CJClothesLabel4,"default-bold-small") CJClothesBuyButton = guiCreateButton(225,364,210,30,"Fechar e comprar a roupa",false,CJClothesWindow) CJClothesCancelButton = guiCreateButton(11,364,211,30,"Fechar e não salvar a roupa",false,CJClothesWindow) local column1 = guiGridListAddColumn( CJClothesCatoGrid, " Categorias:", 0.8 ) local column2 = guiGridListAddColumn( CJClothesItemGrid, " Nome:", 0.6 ) local column3 = guiGridListAddColumn( CJClothesItemGrid, " Preço:", 0.3 ) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(CJClothesWindow,false) local x,y = (screenW-windowW)/1,(screenH-windowH)/1 guiSetPosition(CJClothesWindow,x,y,false) guiWindowSetMovable (CJClothesWindow, true) guiWindowSetSizable (CJClothesWindow, false) guiSetVisible (CJClothesWindow, false) for i=0,17 do local categorie = theCategories[i] local row = guiGridListAddRow ( CJClothesCatoGrid ) guiGridListSetItemText ( CJClothesCatoGrid, row, 1, categorie, false, true ) guiGridListSetItemData ( CJClothesCatoGrid, row, 1, i ) end function createClothesJSONString ( returnType ) local clothesTable = {} local smtn = false for i=0,17 do local texture, model = getPedClothes ( localPlayer, i ) if ( texture ) then local theType, theIndex = getTypeIndexFromClothes ( texture, model ) clothesTable[theType] = theIndex smtn = true end end if ( smtn ) then if ( returnType == "JSON" ) then return "" .. toJSON( clothesTable ):gsub( " ", "" ) .. "" else return clothesTable end else return "NULL" end end function updatePlayerCJSkin ( CJClothesTable ) if ( CJClothesTable ) then if (CJClothesTable == "NULL") then resetPlayerSkin(localPlayer) return end for i=0,17 do local texture, model = getPedClothes ( localPlayer, i ) if (texture) then removePedClothes(localPlayer, i) break else break end end for int, index in pairs( CJClothesTable ) do local texture, model = getClothesByTypeIndex ( int, index ) if ( texture ) then addPedClothes ( source, texture, model, int ) end end end triggerServerEvent( "onChangeClothesCJ", localPlayer, CJClothesTable, createClothesJSONString ( "JSON" ) ) end function resetPlayerSkin(player) if (isElement(player)) then for clothesID = 0, 17 do if ( getPedClothes(player, clotheID)) then removePedClothes(player, clotheID) end end if (getPedClothes(player, 0)) then removePedClothes(player, 0) end if (getPedClothes(player, 1)) then removePedClothes(player, 1) end if (getPedClothes(player, 2)) then removePedClothes(player, 2) end if (getPedClothes(player, 3)) then removePedClothes(player, 3) end if (getPedClothes(player, 4)) then removePedClothes(player, 4) end if (getPedClothes(player, 5)) then removePedClothes(player, 5) end if (getPedClothes(player, 6)) then removePedClothes(player, 6) end if (getPedClothes(player, 7)) then removePedClothes(player, 7) end if (getPedClothes(player, 8)) then removePedClothes(player, 8) end if (getPedClothes(player, 9)) then removePedClothes(player, 9) end if (getPedClothes(player, 10)) then removePedClothes(player, 10) end if (getPedClothes(player, 11)) then removePedClothes(player, 11) end if (getPedClothes(player, 12)) then removePedClothes(player, 12) end if (getPedClothes(player, 13)) then removePedClothes(player, 13) end if (getPedClothes(player, 14)) then removePedClothes(player, 14) end if (getPedClothes(player, 15)) then removePedClothes(player, 15) end if (getPedClothes(player, 16)) then removePedClothes(player, 16) end if (getPedClothes(player, 17)) then removePedClothes(player, 17) end end end function onClientCJMarkerHit ( hitElement, matchingDimension ) if ( matchingDimension ) then if (not isElement(hitElement)) then return end if (isPedInVehicle(hitElement)) then return end if ( hitElement == localPlayer ) then if ( getElementModel ( localPlayer ) == 0 ) then local x1, y1, z1 = getElementPosition(source) local x2, y2, z2 = getElementPosition(hitElement) local maxZ = z1 + 2 if (z2 > maxZ) then return end fadeCamera( false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, true, 1.0, 0, 0, 0 ) toggleAllControls ( false, true, false ) local px, py, pz = getElementPosition( localPlayer ) x, y, z, int, dim = px, py, pz, getElementInterior( localPlayer ), getElementDimension( localPlayer ) pricesModel = {} previousModel = createClothesJSONString ( "table" ) setTimer( function () --if ( getElementInterior( localPlayer ) ~= 1 ) then -- setElementInterior( localPlayer, 1, 209.78, -33.73, 1001.92 ) --else setElementPosition( localPlayer, 1466.3372802734,-1855.7869873047,26.367027282715 ) --end setElementFrozen( localPlayer, true ) setElementDimension( localPlayer, math.random( 10,6543 ) ) setCameraMatrix( 1468.0489501953,-1852.9401855469,26.367027282715, 1466.3372802734,-1855.7869873047,26.367027282715, 0, 70 ) setTimer( function () setElementRotation( localPlayer, 0, 0, 328.98315429688 ) end, 1000, 2 ) setTimer( function () guiSetVisible ( CJClothesWindow, true ) showCursor( true ) end, 1000, 1 ) end, 1200, 1 ) else exports.GTIhud:dm( "Você precisa da skin do CJ antes de poder definir a roupa", 225, 0, 0 ) end end end end function recountTotalPrice () local totalPrice = 0 for i=0,17 do if ( pricesModel[i] == nil ) then -- Nothing else totalPrice = ( tonumber(totalPrice) + tonumber(pricesModel[i]) ) end end guiSetText( CJClothesLabel4, "Preço Total: R$"..totalPrice ) return totalPrice end for i=1,#theMarkers do local x, y, z, int, dim = theMarkers[i][1], theMarkers[i][2], theMarkers[i][3], theMarkers[i][4], theMarkers[i][5] local CJMarker = createMarker( x, y, z, "cylinder", 1, 255, 0, 0, 150) --local blip = createBlip( x, y, z, 45 ) setElementInterior( CJMarker, int ) setElementDimension( CJMarker, dim ) addEventHandler( "onClientMarkerHit", CJMarker, onClientCJMarkerHit ) end addEventHandler( "onClientGUIClick", CJClothesCancelButton, function () fadeCamera( false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, true, 1.0, 0, 0, 0 ) toggleAllControls ( true, true, true ) guiSetVisible ( CJClothesWindow, false ) showCursor( false ) updatePlayerCJSkin ( previousModel ) setElementFrozen( localPlayer, false ) setTimer( function () --if ( getElementInterior( localPlayer ) ~= int ) then -- setElementInterior( localPlayer, int, x, y, z ) --else setElementPosition( localPlayer, 1874.0081787109,-1317.1353759766,29.4921875 ) --end setElementDimension( localPlayer, 0 ) setCameraTarget ( localPlayer ) end, 1200, 1 ) end , false ) addEventHandler( "onClientGUIClick", CJClothesBuyButton, function () if (getPlayerMoney(localPlayer) >= tonumber( recountTotalPrice () ) ) then fadeCamera( false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, true, 1.0, 0, 0, 0 ) toggleAllControls ( true, true, true ) guiSetVisible ( CJClothesWindow, false ) showCursor( false ) updatePlayerCJSkin ( createClothesJSONString ( "table" ) ) triggerServerEvent( "onPlayerBougtSkin", localPlayer, recountTotalPrice () ) exports.GTIhud:dm( "Você comprou as roupas do CJ com sucesso!", 225, 0, 0 ) setElementFrozen( localPlayer, false ) setTimer( function () -- if ( getElementInterior( localPlayer ) ~= int ) then -- setElementInterior( localPlayer, int, x, y, z ) --else setElementPosition( localPlayer, 1874.0081787109,-1317.1353759766,29.4921875 ) --end setElementDimension( localPlayer, 0 ) setCameraTarget ( localPlayer ) end, 1200, 1 ) else exports.GTIhud:dm( "Você não tem dinheiro suficiente para todos estes itens!", 225, 0, 0 ) end end , false ) addEventHandler( "onClientGUIClick", CJClothesCatoGrid, function () guiGridListClear( CJClothesItemGrid ) local theRow, theColumn = guiGridListGetSelectedItem ( CJClothesCatoGrid ) if ( theRow == nil ) or ( theRow == -1 ) then return else local selectedCato = guiGridListGetItemData ( CJClothesCatoGrid, theRow, theColumn ) if ( selectedCato ) then local theTable = getClothesTableByType ( selectedCato ) for i=0,#theTable do local texture, model = getClothesByTypeIndex ( selectedCato, i ) local row = guiGridListAddRow ( CJClothesItemGrid ) guiGridListSetItemText ( CJClothesItemGrid, row, 1, texture.." - "..model, false, true ) guiGridListSetItemText ( CJClothesItemGrid, row, 2, "$"..theTable[i], false, true ) guiGridListSetItemData ( CJClothesItemGrid, row, 1, texture..","..model ) end end end end , false ) addEventHandler( "onClientGUIDoubleClick", CJClothesItemGrid, function () local theRow, theColumn = guiGridListGetSelectedItem ( CJClothesItemGrid ) if ( theRow == nil ) or ( theRow == -1 ) then return false else local selectedItem = guiGridListGetItemData ( CJClothesItemGrid, theRow, theColumn ) local thePrice = guiGridListGetItemText ( CJClothesItemGrid, theRow, 2 ) if ( selectedItem ) then local CJClothesTable = stringExplode( selectedItem, "," ) local texture, model = CJClothesTable[1], CJClothesTable[2] local theType, index = getTypeIndexFromClothes ( texture, model ) local gtexture, gmodel = getPedClothes ( localPlayer, theType ) if ( gtexture == texture ) and ( gmodel == model ) then removePedClothes ( localPlayer, theType, texture, model ) else pricesModel[theType] = tonumber( string.sub(thePrice, 2) ) recountTotalPrice () addPedClothes ( localPlayer, texture, model, theType ) end end end end , false ) function stringExplode(self, separator) Check("stringExplode", "string", self, "ensemble", "string", separator, "separator") if (#self == 0) then return {} end if (#separator == 0) then return { self } end return loadstring("return {\""..self:gsub(separator, "\",\"").."\"}")() end function Check(funcname, ...) local arg = {...} if (type(funcname) ~= "string") then error("Argument type mismatch at 'Check' ('funcname'). Expected 'string', got '"..type(funcname).."'.", 2) end if (#arg % 3 > 0) then error("Argument number mismatch at 'Check'. Expected #arg % 3 to be 0, but it is "..(#arg % 3)..".", 2) end for i=1, #arg-2, 3 do if (type(arg[i]) ~= "string" and type(arg[i]) ~= "table") then error("Argument type mismatch at 'Check' (arg #"..i.."). Expected 'string' or 'table', got '"..type(arg[i]).."'.", 2) elseif (type(arg[i+2]) ~= "string") then error("Argument type mismatch at 'Check' (arg #"..(i+2).."). Expected 'string', got '"..type(arg[i+2]).."'.", 2) end if (type(arg[i]) == "table") then local aType = type(arg[i+1]) for _, pType in next, arg[i] do if (aType == pType) then aType = nil break end end if (aType) then error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..table.concat(arg[i], "' or '").."', got '"..aType.."'.", 3) end elseif (type(arg[i+1]) ~= arg[i]) then error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..arg[i].."', got '"..type(arg[i+1]).."'.", 3) end end end
  3. Bom, estou montando um shopping com academia, auto escola, mercado, etc..Estou enfrentando um problema com a loja de roupo com o SCRIPT abaixo pois o maker esta com um problema que n consigo resolver e por isso que estou pedindo ajuda, nesse shopping que estou fazendo a loja de roupa dele fica no 4º andar coloquei o maker no local aonde eu queria para que o personagem possa passar encima do maker para executar a função no em tando esta funcionando normal só que no mesmo lugar onde estar o maker nos outros andares abaixo quando passo por la acaba executando a função de troca de roupa sendo que o maker estar no andar de cima parece que o maker esta estendido infinitamente para baixo onde só da pra ver ele no 4 andar preciso da ajuda de alguem q possa me ajudar -- Tables local theCategories = { [0]="Camisetas", [1]="Cabelo", [2]="Calças/bermudas", [3]="Tênis", [4]="Tattoos: Left Upper Arm", [5]="Tattoos: Left Lower Arm", [6]="Tattoos: Right Upper Arm", [7]="Tattoos: Right Lower Arm", [8]="Tattoos: Back", [9]="Tattoos: Left Chest", [10]="Tattoos: Right Chest", [11]="Tattoos: Stomach", [12]="Tattoos: Lower Back", [13]="Cordões", [14]="Relógios", [15]="Bandanas", [16]="Boné", [17]="Extras" } local theMarkers = { {1873.4399414063,-1320.1826171875,28.4921875} -- Grove street --[[ {1097.14661, -1433.43970, 15, 0, 0}, -- Dev one {2123.725, -1198.089, 23.207, 0, 0}, -- Glen Park {1467.643, -1119.731, 23.152, 0, 0}, -- Downtown]]-- } local x, y, z, int, dim = nil, nil, nil, nil, nil local pricesModel = {} local previousModel = nil -- GUI Window CJClothesWindow = guiCreateWindow(509,153,444,480,"Roupas do CJ",false) CJClothesLabel1 = guiCreateLabel(12,22,203,16,"Categorias:",false,CJClothesWindow) guiLabelSetHorizontalAlign(CJClothesLabel1,"center",false) guiSetFont(CJClothesLabel1,"default-bold-small") CJClothesCatoGrid = guiCreateGridList(9,41,214,320,false,CJClothesWindow) guiGridListSetSelectionMode(CJClothesCatoGrid,0) CJClothesItemGrid = guiCreateGridList(225,40,210,321,false,CJClothesWindow) guiGridListSetSelectionMode(CJClothesItemGrid,0) CJClothesLabel2 = guiCreateLabel(230,22,203,16,"Items:",false,CJClothesWindow) guiLabelSetHorizontalAlign(CJClothesLabel2,"center",false) guiSetFont(CJClothesLabel2,"default-bold-small") CJClothesLabel3 = guiCreateLabel(9,400,422,46,"Clique duas vezes em um item para alterar as roupas do CJ.\nSe você gostar da roupa cliquem em salvar, caso contrário clicando em guardar para voltar.\nEsta pele será salvo e definir quando usar a pele CJ.",false,CJClothesWindow) guiLabelSetHorizontalAlign(CJClothesLabel3,"center",false) CJClothesLabel4 = guiCreateLabel(15,452,414,20,"Total preço: $0",false,CJClothesWindow) guiLabelSetColor(CJClothesLabel4,48,128,20) guiLabelSetHorizontalAlign(CJClothesLabel4,"center",false) guiSetFont(CJClothesLabel4,"default-bold-small") CJClothesBuyButton = guiCreateButton(225,364,210,30,"Fechar e comprar a roupa",false,CJClothesWindow) CJClothesCancelButton = guiCreateButton(11,364,211,30,"Fechar e não salvar a roupa",false,CJClothesWindow) local column1 = guiGridListAddColumn( CJClothesCatoGrid, " Categorias:", 0.8 ) local column2 = guiGridListAddColumn( CJClothesItemGrid, " Nome:", 0.6 ) local column3 = guiGridListAddColumn( CJClothesItemGrid, " Preço:", 0.3 ) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(CJClothesWindow,false) local x,y = (screenW-windowW)/1,(screenH-windowH)/1 guiSetPosition(CJClothesWindow,x,y,false) guiWindowSetMovable (CJClothesWindow, true) guiWindowSetSizable (CJClothesWindow, false) guiSetVisible (CJClothesWindow, false) for i=0,17 do local categorie = theCategories local row = guiGridListAddRow ( CJClothesCatoGrid ) guiGridListSetItemText ( CJClothesCatoGrid, row, 1, categorie, false, true ) guiGridListSetItemData ( CJClothesCatoGrid, row, 1, i ) end function createClothesJSONString ( returnType ) local clothesTable = {} local smtn = false for i=0,17 do local texture, model = getPedClothes ( localPlayer, i ) if ( texture ) then local theType, theIndex = getTypeIndexFromClothes ( texture, model ) clothesTable[theType] = theIndex smtn = true end end if ( smtn ) then if ( returnType == "JSON" ) then return "" .. toJSON( clothesTable ):gsub( " ", "" ) .. "" else return clothesTable end else return "NULL" end end function updatePlayerCJSkin ( CJClothesTable ) if ( CJClothesTable ) then if (CJClothesTable == "NULL") then resetPlayerSkin(localPlayer) return end for i=0,17 do local texture, model = getPedClothes ( localPlayer, i ) if (texture) then removePedClothes(localPlayer, i) break else break end end for int, index in pairs( CJClothesTable ) do local texture, model = getClothesByTypeIndex ( int, index ) if ( texture ) then addPedClothes ( source, texture, model, int ) end end end triggerServerEvent( "onChangeClothesCJ", localPlayer, CJClothesTable, createClothesJSONString ( "JSON" ) ) end function resetPlayerSkin(player) if (isElement(player)) then for clothesID = 0, 17 do if ( getPedClothes(player, clotheID)) then removePedClothes(player, clotheID) end end if (getPedClothes(player, 0)) then removePedClothes(player, 0) end if (getPedClothes(player, 1)) then removePedClothes(player, 1) end if (getPedClothes(player, 2)) then removePedClothes(player, 2) end if (getPedClothes(player, 3)) then removePedClothes(player, 3) end if (getPedClothes(player, 4)) then removePedClothes(player, 4) end if (getPedClothes(player, 5)) then removePedClothes(player, 5) end if (getPedClothes(player, 6)) then removePedClothes(player, 6) end if (getPedClothes(player, 7)) then removePedClothes(player, 7) end if (getPedClothes(player, 8)) then removePedClothes(player, 8) end if (getPedClothes(player, 9)) then removePedClothes(player, 9) end if (getPedClothes(player, 10)) then removePedClothes(player, 10) end if (getPedClothes(player, 11)) then removePedClothes(player, 11) end if (getPedClothes(player, 12)) then removePedClothes(player, 12) end if (getPedClothes(player, 13)) then removePedClothes(player, 13) end if (getPedClothes(player, 14)) then removePedClothes(player, 14) end if (getPedClothes(player, 15)) then removePedClothes(player, 15) end if (getPedClothes(player, 16)) then removePedClothes(player, 16) end if (getPedClothes(player, 17)) then removePedClothes(player, 17) end end end function onClientCJMarkerHit ( hitElement, matchingDimension ) if ( matchingDimension ) then if (not isElement(hitElement)) then return end if (isPedInVehicle(hitElement)) then return end if ( hitElement == localPlayer ) then if ( getElementModel ( localPlayer ) == 0 ) then local x1, y1, z1 = getElementPosition(source) local x2, y2, z2 = getElementPosition(hitElement) local maxZ = z1 + 2 if (z2 > maxZ) then return end fadeCamera( false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, true, 1.0, 0, 0, 0 ) toggleAllControls ( false, true, false ) local px, py, pz = getElementPosition( localPlayer ) x, y, z, int, dim = px, py, pz, getElementInterior( localPlayer ), getElementDimension( localPlayer ) pricesModel = {} previousModel = createClothesJSONString ( "table" ) setTimer( function () --if ( getElementInterior( localPlayer ) ~= 1 ) then -- setElementInterior( localPlayer, 1, 209.78, -33.73, 1001.92 ) --else setElementPosition( localPlayer, 1466.3372802734,-1855.7869873047,26.367027282715 ) --end setElementFrozen( localPlayer, true ) setElementDimension( localPlayer, math.random( 10,6543 ) ) setCameraMatrix( 1468.0489501953,-1852.9401855469,26.367027282715, 1466.3372802734,-1855.7869873047,26.367027282715, 0, 70 ) setTimer( function () setElementRotation( localPlayer, 0, 0, 328.98315429688 ) end, 1000, 2 ) setTimer( function () guiSetVisible ( CJClothesWindow, true ) showCursor( true ) end, 1000, 1 ) end, 1200, 1 ) else exports.GTIhud:dm( "Você precisa da skin do CJ antes de poder definir a roupa", 225, 0, 0 ) end end end end function recountTotalPrice () local totalPrice = 0 for i=0,17 do if ( pricesModel == nil ) then -- Nothing else totalPrice = ( tonumber(totalPrice) + tonumber(pricesModel) ) end end guiSetText( CJClothesLabel4, "Preço Total: R$"..totalPrice ) return totalPrice end for i=1,#theMarkers do local x, y, z, int, dim = theMarkers[1], theMarkers[2], theMarkers[3], theMarkers[4], theMarkers[5] local CJMarker = createMarker( x, y, z, "cylinder", 1, 255, 0, 0, 150) --local blip = createBlip( x, y, z, 45 ) setElementInterior( CJMarker, int ) setElementDimension( CJMarker, dim ) addEventHandler( "onClientMarkerHit", CJMarker, onClientCJMarkerHit ) end addEventHandler( "onClientGUIClick", CJClothesCancelButton, function () fadeCamera( false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, true, 1.0, 0, 0, 0 ) toggleAllControls ( true, true, true ) guiSetVisible ( CJClothesWindow, false ) showCursor( false ) updatePlayerCJSkin ( previousModel ) setElementFrozen( localPlayer, false ) setTimer( function () --if ( getElementInterior( localPlayer ) ~= int ) then -- setElementInterior( localPlayer, int, x, y, z ) --else setElementPosition( localPlayer, 1874.0081787109,-1317.1353759766,29.4921875 ) --end setElementDimension( localPlayer, 0 ) setCameraTarget ( localPlayer ) end, 1200, 1 ) end , false ) addEventHandler( "onClientGUIClick", CJClothesBuyButton, function () if (getPlayerMoney(localPlayer) >= tonumber( recountTotalPrice () ) ) then fadeCamera( false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, true, 1.0, 0, 0, 0 ) toggleAllControls ( true, true, true ) guiSetVisible ( CJClothesWindow, false ) showCursor( false ) updatePlayerCJSkin ( createClothesJSONString ( "table" ) ) triggerServerEvent( "onPlayerBougtSkin", localPlayer, recountTotalPrice () ) exports.GTIhud:dm( "Você comprou as roupas do CJ com sucesso!", 225, 0, 0 ) setElementFrozen( localPlayer, false ) setTimer( function () -- if ( getElementInterior( localPlayer ) ~= int ) then -- setElementInterior( localPlayer, int, x, y, z ) --else setElementPosition( localPlayer, 1874.0081787109,-1317.1353759766,29.4921875 ) --end setElementDimension( localPlayer, 0 ) setCameraTarget ( localPlayer ) end, 1200, 1 ) else exports.GTIhud:dm( "Você não tem dinheiro suficiente para todos estes itens!", 225, 0, 0 ) end end , false ) addEventHandler( "onClientGUIClick", CJClothesCatoGrid, function () guiGridListClear( CJClothesItemGrid ) local theRow, theColumn = guiGridListGetSelectedItem ( CJClothesCatoGrid ) if ( theRow == nil ) or ( theRow == -1 ) then return else local selectedCato = guiGridListGetItemData ( CJClothesCatoGrid, theRow, theColumn ) if ( selectedCato ) then local theTable = getClothesTableByType ( selectedCato ) for i=0,#theTable do local texture, model = getClothesByTypeIndex ( selectedCato, i ) local row = guiGridListAddRow ( CJClothesItemGrid ) guiGridListSetItemText ( CJClothesItemGrid, row, 1, texture.." - "..model, false, true ) guiGridListSetItemText ( CJClothesItemGrid, row, 2, "$"..theTable, false, true ) guiGridListSetItemData ( CJClothesItemGrid, row, 1, texture..","..model ) end end end end , false ) addEventHandler( "onClientGUIDoubleClick", CJClothesItemGrid, function () local theRow, theColumn = guiGridListGetSelectedItem ( CJClothesItemGrid ) if ( theRow == nil ) or ( theRow == -1 ) then return false else local selectedItem = guiGridListGetItemData ( CJClothesItemGrid, theRow, theColumn ) local thePrice = guiGridListGetItemText ( CJClothesItemGrid, theRow, 2 ) if ( selectedItem ) then local CJClothesTable = stringExplode( selectedItem, "," ) local texture, model = CJClothesTable[1], CJClothesTable[2] local theType, index = getTypeIndexFromClothes ( texture, model ) local gtexture, gmodel = getPedClothes ( localPlayer, theType ) if ( gtexture == texture ) and ( gmodel == model ) then removePedClothes ( localPlayer, theType, texture, model ) else pricesModel[theType] = tonumber( string.sub(thePrice, 2) ) recountTotalPrice () addPedClothes ( localPlayer, texture, model, theType ) end end end end , false ) function stringExplode(self, separator) Check("stringExplode", "string", self, "ensemble", "string", separator, "separator") if (#self == 0) then return {} end if (#separator == 0) then return { self } end return loadstring("return {\""..self:gsub(separator, "\",\"").."\"}")() end function Check(funcname, ...) local arg = {...} if (type(funcname) ~= "string") then error("Argument type mismatch at 'Check' ('funcname'). Expected 'string', got '"..type(funcname).."'.", 2) end if (#arg % 3 > 0) then error("Argument number mismatch at 'Check'. Expected #arg % 3 to be 0, but it is "..(#arg % 3)..".", 2) end for i=1, #arg-2, 3 do if (type(arg) ~= "string" and type(arg) ~= "table") then error("Argument type mismatch at 'Check' (arg #"..i.."). Expected 'string' or 'table', got '"..type(arg).."'.", 2) elseif (type(arg[i+2]) ~= "string") then error("Argument type mismatch at 'Check' (arg #"..(i+2).."). Expected 'string', got '"..type(arg[i+2]).."'.", 2) end if (type(arg) == "table") then local aType = type(arg[i+1]) for _, pType in next, arg do if (aType == pType) then aType = nil break end end if (aType) then error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..table.concat(arg, "' or '").."', got '"..aType.."'.", 3) end elseif (type(arg[i+1]) ~= arg) then error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..arg.."', got '"..type(arg[i+1]).."'.", 3) end end end
×
×
  • Create New...