Search the Community

Showing results for tags 'scripts'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 48 results

  1. Hi Guys, I have a question... I have this resource I want to use in my server. It is a car dealership, but what happens is, every car that a player buys disappear when the server or the resource is restarted. I was hoping that someone could help me with this. or at least give me a clue on how to prevent this to happen again. Thanks
  2. Hola hago este mensaje para ver si alguien me puede ayudar pasandome o vendiendome un resource de creacion de bases para un servidor de DayZ de mta desde ya muchas gracias
  3. QUERIA SABER SE TEM COMO MUDAR AS PROPRIEDADES DE UMA ARMA NO MTA POR EXEMPLO.: COLOCAR AS MESMA FUNÇÕES DA M4 ATIRAR, MODO DE ANDAR, MIRAR ETC... NO LANÇA CHAMAS OU RPG OU BASTÃO OU EM OUTRA ARMA ! I WANTED TO KNOW IF YOU HAVE TO CHANGE THE PROPERTIES OF A WEAPON IN THE MTA FOR EXAMPLE: PUT THE SAME FUNCTIONS OF THE M4 SHOOT, WAY OF MOVING, AIMING ETC ... IN FLAME OR RPG OR BAT OR OTHER WEAPON!
  4. function centerWindow ( center_window ) local sx, sy = guiGetScreenSize ( ) local windowW, windowH = guiGetSize ( center_window, false ) local x, y = ( sx - windowW ) / 2, ( sy - windowH ) / 2 guiSetPosition ( center_window, x, y, false ) end dblip = createMarker(1640, -1092, 24,"cylinder",0.1,0,0,0,205) createBlipAttachedTo(dblip, 24) local customCarNames = -- Aqui voce coloca o nome e id dos veiculos ! { [426] = 'Carro 1'; [517] = 'Carro 2'; [400] = 'Carro 3'; [580] = 'Carro 4'; [439] = 'Carro 5'; [436] = 'Carro 6'; [526] = 'Carro 7'; [496] = 'Carro 8'; [546] = 'Carro 9'; [527] = 'Carro 10'; [516] = 'Carro 11'; [554] = 'Carro 12'; [579] = 'Carro 13'; [424] = 'Carro 14'; [487] = 'Helicoptero'; [586] = 'Moto 1'; [581] = 'Moto 2'; [471] = 'Moto 3'; [462] = 'Moto 4'; [468] = 'Moto 5'; [521] = 'Moto 6'; ---------- Caso queira adicionar mais copie essa linha e cole abaixo e mude id e nome } setTimer ( function () local theCol = getElementData(root, "BlockExportCol") function isInColExport () if isElement(theCol) and isElementWithinColShape(localPlayer,theCol) then return true else return false end end function ClientExplosionCFunction() if isInColExport () then cancelEvent () end end addEventHandler("onClientExplosion", root, ClientExplosionCFunction) end , 1000, 1 ) local screX, screY = guiGetScreenSize() Window_VS = guiCreateWindow(373, 219, 557, 303,"Aqui você visualiza seus veiculos",false) guiSetAlpha(Window_VS, 0.88) guiWindowSetSizable(Window_VS, false) guiSetVisible(Window_VS, false) centerWindow(Window_VS) Grid_VS = guiCreateGridList(10, 28, 361, 235, false, Window_VS) guiGridListSetSelectionMode(Grid_VS, 1) guiGridListAddColumn(Grid_VS, "Nome", 0.4) guiGridListAddColumn(Grid_VS, "Preço", 0.3) guiGridListAddColumn(Grid_VS, "HP Auto", 0.2) Button_VS_sn_s = guiCreateStaticImage(381, 28, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_sn_o = guiCreateStaticImage(381, 28, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_sn = guiCreateLabel(381, 28, 166, 25, "Spawnar", false, Window_VS) guiSetFont(Button_VS_sn, "default-bold-small") guiLabelSetColor(Button_VS_sn, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_sn, "center") guiLabelSetHorizontalAlign(Button_VS_sn, "center") Button_VS_dy_s = guiCreateStaticImage(381, 63, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_dy_o = guiCreateStaticImage(381, 63, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_dy = guiCreateLabel(381, 63, 166, 25, "Remover", false, Window_VS) guiSetFont(Button_VS_dy, "default-bold-small") guiLabelSetColor(Button_VS_dy, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_dy, "center") guiLabelSetHorizontalAlign(Button_VS_dy, "center") Button_VS_Warp_s = guiCreateStaticImage(381, 98, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_Warp_o = guiCreateStaticImage(381, 98, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_Warp = guiCreateLabel(381, 98, 166, 25, "Enviar para o patio 200$", false, Window_VS) guiSetFont(Button_VS_Warp, "default-bold-small") guiLabelSetColor(Button_VS_Warp, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Warp, "center") guiLabelSetHorizontalAlign(Button_VS_Warp, "center") Button_VS_lk_s = guiCreateStaticImage(381, 133, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_lk_o = guiCreateStaticImage(381, 133, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_lk = guiCreateLabel(381, 133, 166, 25, "Aberto - Fechado", false, Window_VS) guiSetFont(Button_VS_lk, "default-bold-small") guiLabelSetColor(Button_VS_lk, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_lk, "center") guiLabelSetHorizontalAlign(Button_VS_lk, "center") Button_VS_sl_s = guiCreateStaticImage(381, 168, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_sl_o = guiCreateStaticImage(381, 168, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_sl = guiCreateLabel(381, 168, 166, 25, "Vender Veiculo", false, Window_VS) guiSetFont(Button_VS_sl, "default-bold-small") guiLabelSetColor(Button_VS_sl, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_sl, "center") guiLabelSetHorizontalAlign(Button_VS_sl, "center") Button_VS_give_s = guiCreateStaticImage(381, 203, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_give_o = guiCreateStaticImage(381, 203, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_give = guiCreateLabel(381, 203, 166, 25, "Vender Para o Jogador", false, Window_VS) guiSetFont(Button_VS_give, "default-bold-small") guiLabelSetColor(Button_VS_give, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_give, "center") guiLabelSetHorizontalAlign(Button_VS_give, "center") Button_VS_Warp_info = guiCreateLabel(381, 238, 166, 25, "", false) guiSetFont(Button_VS_Warp_info, "default-bold-small") guiLabelSetColor(Button_VS_Warp_info, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Warp_info, "center") guiLabelSetHorizontalAlign(Button_VS_Warp_info, "center") Button_VS_Localizar_s = guiCreateStaticImage(381, 238, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_Localizar_o = guiCreateStaticImage(381, 238, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_Localizar = guiCreateLabel(381, 238, 166, 25, "Localizar/Des", false, Window_VS) guiSetFont(Button_VS_Localizar, "default-bold-small") guiLabelSetColor(Button_VS_Localizar, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Localizar, "center") guiLabelSetHorizontalAlign(Button_VS_Localizar, "center") Button_VS_Localizar_info = guiCreateLabel(381, 238, 166, 25, "", false) guiSetFont(Button_VS_Localizar_info, "default-bold-small") guiLabelSetColor(Button_VS_Localizar_info, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Localizar_info, "center") guiLabelSetHorizontalAlign(Button_VS_Localizar_info, "center") adLabel = guiCreateLabel(130, 269, 296, 24, "Concessionaria BME", false, Window_VS) -------------- Nome do seu servidor guiSetFont(adLabel, "default-bold-small") guiLabelSetHorizontalAlign(adLabel, "center", false) guiLabelSetVerticalAlign(adLabel, "center") guiSetVisible(Button_VS_sn_o,false)-- guiSetVisible(Button_VS_Warp_o,false) guiSetVisible(Button_VS_dy_o,false) guiSetVisible(Button_VS_Warp_info,false) guiSetVisible(Button_VS_Fix_o,false) guiSetVisible(Button_VS_Fix_info,false) guiSetVisible(Button_VS_lk_o,false) guiSetVisible(Button_VS_sl_o,false) guiSetVisible(Button_VS_give_o,false) --Button_VS_Warp_info --Button_VS_Fix_info Window_CHK = guiCreateWindow(screX/2-155,screY/2-60,310,120,"Vender Veiculo!",false) guiSetVisible(Window_CHK, false) guiSetProperty(Window_CHK, "AlwaysOnTop", "true") guiWindowSetSizable(Window_CHK, false) Label_CHK = guiCreateLabel(21,28,266,36,"",false,Window_CHK) guiLabelSetColor(Label_CHK, 38, 122, 216) guiLabelSetHorizontalAlign(Label_CHK,"center",true) Button_CHK_Y = guiCreateButton(17,73,129,36,"Deseja Vender?",false,Window_CHK) Button_CHK_N = guiCreateButton(161,73,129,36,"Cancelar",false,Window_CHK) function updateGridList() local data = getElementData(localPlayer, "VehicleInfo") if data then local rw, cl = guiGridListGetSelectedItem(Grid_VS) guiGridListClear(Grid_VS) for i, data in ipairs (data) do local carName = customCarNames[ data['Model'] ] or getVehicleNameFromModel(data["Model"]) local ID = data["ID"] local Cost = data["Cost"] local HP = math.floor(data["HP"]) local PreCost = math.ceil(Cost*.9*HP/100/10) local row = guiGridListAddRow(Grid_VS) guiGridListSetItemText(Grid_VS, row, 1, carName, false, true) guiGridListSetItemData(Grid_VS, row, 1, ID) guiGridListSetItemText(Grid_VS, row, 2, PreCost, false, true) guiGridListSetItemText(Grid_VS, row, 3, HP.." HP", false, true) end guiGridListSetSelectedItem(Grid_VS, rw, cl) end end bindKey("F6", "down", function() if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then if getElementData(localPlayer, "MissionWarProtection") and getElementData(localPlayer, "MissionProtection")then return end guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) showCursor(guiGetVisible(Window_VS)) end end) triggerServerEvent("onOpenGui", localPlayer) addEventHandler("onClientElementDataChange", root, function(dd) if getElementType(source) == "player" and source == localPlayer and dd == "VehicleInfo" then local data = getElementData(source, dd) if data then updateGridList() end end end) function WINDOW_CLICK_VEHICLE (button, state, absoluteX, absoluteY) local id = guiGridListGetSelectedItem(Grid_VS) local ID = guiGridListGetItemData(Grid_VS, id, 1) if source == Button_VS_close then guiSetVisible(Window_VS, false) showCursor(false) end if (source == Grid_VS) then if id == -1 and idd then guiGridListSetSelectedItem(Grid_VS, idd, 1) return false else idd = guiGridListGetSelectedItem(Grid_VS) end elseif id == -1 then elseif (source == Button_VS_sn) then if not isInColExport () then triggerServerEvent("SpawnMyVehicle", localPlayer, ID) end elseif (source == Button_VS_dy) then triggerServerEvent("DestroyMyVehicle", localPlayer, ID) elseif (source == Button_VS_lt) then triggerServerEvent("LightsMyVehicle", localPlayer, ID) elseif (source == Button_VS_Localizar) then triggerServerEvent("BlipMyVehicle", localPlayer, ID) elseif (source == Button_VS_lk) then triggerServerEvent("LockMyVehicle", localPlayer, ID) elseif (source == Button_VS_sl) then guiSetVisible(Window_CHK, true) local carName = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 1) local carprice = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 2) guiSetText(Label_CHK, 'Você deseja realmente vender seu "'..carName..'" por $'..carprice) elseif source == Button_VS_give then createPlayersList(id) elseif source == Button_CHK_Y then triggerServerEvent("SellMyVehicle", localPlayer, ID) guiSetVisible(Window_VS, false) guiSetVisible(Window_CHK, false) showCursor(false) elseif source == Button_CHK_N then guiSetVisible (Window_CHK, false) elseif source == Button_VS_Spc then if getElementInterior(localPlayer) == 0 then if getElementData(localPlayer,"Stats") < 2 then SpecVehicle(ID) end end elseif source == Button_VS_Fix then triggerServerEvent("FixMyVehicle", localPlayer, ID) elseif source == Button_VS_Warp then if not isInColExport () then triggerServerEvent("WarpMyVehicle", localPlayer, ID) end elseif source == Button_PLS_Y then local row = guiGridListGetSelectedItem ( playerList_PLS ) if row and row ~= -1 then -- if guiGridListGetItemText ( playerList_PLS, row, 1 ) == getPlayerName ( localPlayer ) then -- return true -- end if (tonumber(guiGetText (edit_PLS_price)) or 0) >= 0 then outputMessage ( "#c1c1c1Esperar uma resposta do jogador.", 10, 250, 10,true ) invitations_send = true triggerServerEvent ( 'inviteToBuyCarSended', localPlayer, guiGridListGetItemText ( playerList_PLS, row, 1 ), guiGetText (edit_PLS_price) or 0, guiGridListGetItemText(Grid_VS, id, 1), guiGridListGetItemData(Grid_VS, id, 1) ) destroyElement ( Window_PLS ) end end elseif source == Button_PLS_N then destroyElement ( Window_PLS) end end addEventHandler("onClientGUIClick", resourceRoot, WINDOW_CLICK_VEHICLE) function invitationsClickVehicle () if source == Button_ABC_Y then showCursor ( false ) destroyElement ( Window_ABC ) if getPlayerMoney () >= ( tonumber(inv_price) or 0 ) then triggerServerEvent ("invitationBuyCarAccepted",localPlayer, inv_player, inv_acc, inv_price, inv_veh_name, inv_veh_id) else triggerServerEvent ("invitationBuyCarNotAccepted",localPlayer, inv_player ) end if #listOfInvitations > 0 then createAcceptBuyCarWindow (listOfInvitations[1][1],listOfInvitations[1][2],listOfInvitations[1][3],listOfInvitations[1][4] ) table.remove (listOfInvitations,1) end elseif source == Button_ABC_N then showCursor ( false ) triggerServerEvent ("invitationBuyCarNotAccepted",localPlayer, inv_player ) destroyElement ( Window_ABC ) if #listOfInvitations > 0 then createAcceptBuyCarWindow (listOfInvitations[1][1],listOfInvitations[1][2],listOfInvitations[1][3],listOfInvitations[1][4] ) table.remove (listOfInvitations,1) end end end addEventHandler("onClientGUIClick", resourceRoot, invitationsClickVehicle) function createPlayersList (row_id) showCursor ( true ) Window_PLS = guiCreateWindow(screX/2-155,screY/2-220,310,420,"Venda de carros!",false) guiSetVisible(Window_PLS, true) guiSetProperty(Window_PLS, "AlwaysOnTop", "true") guiWindowSetSizable(Window_PLS, false) Label_PLS_info = guiCreateLabel(21,28,266,36,"Digite o preço dos carros:",false,Window_PLS) edit_PLS_price = guiCreateEdit ( 110,58,90,36, guiGridListGetItemText(Grid_VS, row_id, 2) or 0, false, Window_PLS ) guiLabelSetColor(Label_PLS_info, 38, 122, 216) guiLabelSetHorizontalAlign(Label_PLS_info,"center",true) Button_PLS_Y = guiCreateButton(17,379,129,36,"Vender",false,Window_PLS) Button_PLS_N = guiCreateButton(161,379,129,36,"Fechar",false,Window_PLS) addEventHandler("onClientGUIChanged", edit_PLS_price, function(element) guiSetText ( edit_PLS_price, string.gsub (guiGetText( edit_PLS_price ), "%a", "") ) end) playerList_PLS = guiCreateGridList ( 21, 100, 268, 265, false, Window_PLS ) local column = guiGridListAddColumn( playerList_PLS, "Jogadores", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList_PLS ) guiGridListSetItemText ( playerList_PLS, row, column, getPlayerName ( player ), false, false ) end end end --createPlayersList () listOfInvitations = {} inv_player, inv_acc, inv_price, inv_veh_name, inv_veh_id = nil, nil, nil, nil, nil addEvent("recieveInviteToBuyCar", true) addEventHandler("recieveInviteToBuyCar", root, function(player, acc, price, veh_name, veh_id) if player and price and acc and veh_name and veh_id then if getPlayerFromName ( player ) then if not isElement ( Window_ABC ) then createAcceptBuyCarWindow (player,acc,price, veh_name, veh_id) else table.insert ( listOfInvitations, {player,acc,price, veh_name, veh_id}) end else outputMessage ( "#c1c1c1Jogador não pode ser encontrado", source, 250, 10, 10,true) end end end) addEvent("cleanCarInvitations", true) addEventHandler("cleanCarInvitations", root, function() invitations_send = false end) function createAcceptBuyCarWindow(player,acc,price, veh_name, veh_id) showCursor ( true ) inv_player, inv_acc, inv_price, inv_veh_name, inv_veh_id = player,acc,price, veh_name, veh_id Window_ABC = guiCreateWindow(screX/2-155,screY/2-220,410,100,"Venda de carros",false) guiSetVisible(Window_ABC, true) guiSetProperty(Window_ABC, "AlwaysOnTop", "true") guiWindowSetSizable(Window_ABC, false) Label_ABC_info = guiCreateLabel(10,28,390,36,player.." Te ofereceu o "..veh_name.." por "..price.."$ (o seu dinheiro: "..getPlayerMoney() .."$)",false,Window_ABC) guiLabelSetColor(Label_ABC_info, 38, 216, 38) guiLabelSetHorizontalAlign(Label_ABC_info,"center",true) Button_ABC_Y = guiCreateButton(17,70,129,36,"Comprar",false,Window_ABC) Button_ABC_N = guiCreateButton(264,70,129,36,"Cancelar",false,Window_ABC) end function SpecVehicle(id) if spc then removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false return end for i, vehicle in ipairs(getElementsByType("vehicle")) do if getElementData(vehicle, "Owner") == localPlayer and getElementData(vehicle, "ID") == id then cVeh = vehicle spc = true addEventHandler("onClientPreRender", root, Sp) guiSetVisible(Window_VS, false) showCursor(false) break end end end function Sp() if isElement(cVeh) then local x, y, z = getElementPosition(cVeh) setElementFrozen(localPlayer, true) setCameraMatrix(x, y-1, z+15, x, y, z) else removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false end end ShopMarkersTable = {} local ShopTable = { --------- Os mesmos ids dos carros motos e etc la de cima só que lembre de mudar em todas as lojas !!! [1] = {ID = {{426, 50000} ,{517, 35000} ,{400, 10500} ,{580, 80000} ,{439, 150000} ,{436, 180000} ,{526, 550000} ,{496, 405867} ,{527, 210500} ,{516, 6000000} ,{554, 350000} ,{579, 500000} ,{424, 670000} ,{487, 729800} ,{471, 8000000} ,{581, 150000} ,{586, 110000} ,{462, 10000} ,{468, 80000} ,{521, 874600} ------- Caso queira adicionar mais copie e cole essa linha abaixo aqui e nas outras lojas }, vPosX = 891.90173, vPosY = -1659.36389, vPosZ = 13.54688, PosX = 944.48138, PosY = -1673.71313, PosZ = 12.5, CamX = 877.34576, CamY =-1660.45728, CamZ = 15, lookAtX = 2133.3, lookAtY = -1168, lookAtZ = 28}, } VehicleShop_Window = guiCreateWindow(screX-350,screY-450, 343, 436, "Concessionaria BME", false) guiSetVisible(VehicleShop_Window, false) guiWindowSetSizable(VehicleShop_Window , false) guiSetAlpha(VehicleShop_Window, 0.8) carGrid = guiCreateGridList(9, 20, 324, 329, false, VehicleShop_Window) guiGridListSetSelectionMode(carGrid, 0) carColumn = guiGridListAddColumn(carGrid, "Nome", 0.5) costColumn = guiGridListAddColumn(carGrid, "Preço", 0.4) carButton_s = guiCreateStaticImage(14, 355, 86, 56, "images/button_standard.png", false, VehicleShop_Window) carButton_o = guiCreateStaticImage(14, 355, 86, 56, "images/button_mouse.png", false, VehicleShop_Window) carButton = guiCreateLabel(14, 355, 86, 56, "Comprar", false, VehicleShop_Window) guiSetFont(carButton, "default-bold-small") guiLabelSetColor(carButton, 255, 255, 255) guiLabelSetVerticalAlign(carButton, "center") guiLabelSetHorizontalAlign(carButton, "center") carColorButton_s = guiCreateStaticImage(128, 355, 86, 56, "images/button_standard.png", false, VehicleShop_Window) carColorButton_o = guiCreateStaticImage(128, 355, 86, 56, "images/button_mouse.png", false, VehicleShop_Window) carColorButton = guiCreateLabel(128, 355, 86, 56, "Pintar", false, VehicleShop_Window) guiSetFont(carColorButton, "default-bold-small") guiLabelSetColor(carColorButton, 255, 255, 255) guiLabelSetVerticalAlign(carColorButton, "center") guiLabelSetHorizontalAlign(carColorButton, "center") closeButton_s = guiCreateStaticImage(237, 355, 86, 56, "images/button_standard.png", false, VehicleShop_Window) closeButton_o = guiCreateStaticImage(237, 355, 86, 56, "images/button_mouse.png", false, VehicleShop_Window) closeButton = guiCreateLabel(237, 355, 86, 56, "Sair", false, VehicleShop_Window) guiSetFont(closeButton, "default-bold-small") guiLabelSetColor(closeButton, 255, 255, 255) guiLabelSetVerticalAlign(closeButton, "center") guiLabelSetHorizontalAlign(closeButton, "center") guiSetVisible(carButton_o,false) guiSetVisible(closeButton_o,false) guiSetVisible(carColorButton_o,false) addEventHandler( "onClientMouseLeave", root, function() if source == Button_VS_sn then guiSetVisible(Button_VS_sn_s,true) guiSetVisible(Button_VS_sn_o,false) elseif source == Button_VS_Warp then guiSetVisible(Button_VS_Warp_s,true) guiSetVisible(Button_VS_Warp_o,false) guiSetVisible(Button_VS_Warp_info,false) elseif source == Button_VS_dy then guiSetVisible(Button_VS_dy_s,true) guiSetVisible(Button_VS_dy_o,false) elseif source == Button_VS_Fix then guiSetVisible(Button_VS_Fix_s,true)--Button_VS_Fix_info guiSetVisible(Button_VS_Fix_o,false) guiSetVisible(Button_VS_Fix_info,false) elseif source == Button_VS_lk then guiSetVisible(Button_VS_lk_s,true) guiSetVisible(Button_VS_lk_o,false) elseif source == Button_VS_sl then guiSetVisible(Button_VS_sl_s,true) guiSetVisible(Button_VS_sl_o,false) elseif source == Button_VS_give then guiSetVisible(Button_VS_give_s,true) guiSetVisible(Button_VS_give_o,false) elseif source == carButton then guiSetVisible(carButton_s,true) guiSetVisible(carButton_o,false) elseif source == closeButton then guiSetVisible(closeButton_s,true) guiSetVisible(closeButton_o,false) elseif source == carColorButton then guiSetVisible(carColorButton_s,true) guiSetVisible(carColorButton_o,false) end end) addEventHandler( "onClientMouseEnter", root, function() if source == Button_VS_sn then guiSetVisible(Button_VS_sn_s,false) guiSetVisible(Button_VS_sn_o,true) elseif source == Button_VS_Warp then guiSetVisible(Button_VS_Warp_s,false) guiSetVisible(Button_VS_Warp_o,true) guiSetVisible(Button_VS_Warp_info,true) elseif source == Button_VS_dy then guiSetVisible(Button_VS_dy_s,false) guiSetVisible(Button_VS_dy_o,true) elseif source == Button_VS_Fix then guiSetVisible(Button_VS_Fix_s,false)--Button_VS_Fix_info guiSetVisible(Button_VS_Fix_o,true) guiSetVisible(Button_VS_Fix_info,true) elseif source == Button_VS_lk then guiSetVisible(Button_VS_lk_s,false) guiSetVisible(Button_VS_lk_o,true) elseif source == Button_VS_sl then guiSetVisible(Button_VS_sl_s,false) guiSetVisible(Button_VS_sl_o,true) elseif source == Button_VS_give then guiSetVisible(Button_VS_give_s,false) guiSetVisible(Button_VS_give_o,true) elseif source == Button_VS_give then guiSetVisible(Button_VS_give_s,false) guiSetVisible(Button_VS_give_o,true) elseif source == carButton then guiSetVisible(carButton_s,false) guiSetVisible(carButton_o,true) elseif source == closeButton then guiSetVisible(closeButton_s,false) guiSetVisible(closeButton_o,true) elseif source == carColorButton then guiSetVisible(carColorButton_s,false) guiSetVisible(carColorButton_o,true) end end) for i, M in ipairs(ShopTable) do ShopMarker = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 2, 38, 122, 216) ShopMarkerShader = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 2, 38, 122, 216) ShopMarkersTable[ShopMarker] = true setElementData ( ShopMarker, "shopID", i ) setElementID(ShopMarker, tostring(i)) createBlipAttachedTo(ShopMarker, 55, 2, 255, 255, 255, 255, 0, 400) end function getVehicleModelFromNewName (name) for i,v in pairs ( customCarNames ) do if v == name then return i end end return false end addEventHandler("onClientGUIClick", resourceRoot, function() if (source == carGrid) then local carName = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 1) local carprice = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 2) if guiGridListGetSelectedItem(carGrid) ~= -1 then guiSetText ( gui, CarName, carName) guiSetText ( gui, CarPrice, "$"..carprice) local carID = getVehicleModelFromNewName(carName) or getVehicleModelFromName(carName) if isElement(veh) then setElementModel(veh, carID) return end veh = createVehicle(carID, ShopTable["vPosX"], ShopTable["vPosY"], ShopTable["vPosZ"]) setVehicleDamageProof(veh, true) setElementFrozen(veh, true) setVehicleColor(veh, r1, g1, b1, r2, g2, b2) timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0) else guiSetText(CarName, "Noun") guiSetText(CarPrice, "Noun") r1, g1, b1, r2, g2, b2 = math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255) if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end end elseif (source == carColorButton) then openColorPicker() elseif (source == carButton) then if guiGridListGetSelectedItem(carGrid) then local carName = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 1) local carID = getVehicleModelFromNewName(carName) or getVehicleModelFromName(carName) local carCost = guiGridListGetItemText (carGrid, guiGridListGetSelectedItem(carGrid), 2) local r1, g1, b1, r2, g2, b2 = getVehicleColor(veh, true) triggerServerEvent("onBuyNewVehicle", localPlayer, carID, carCost, r1, g1, b1, r2, g2, b2) outputMessage("#c1c1c1Você acabou de comprar um: #00FF66"..carName, 38, 122, 216, true) guiSetVisible(VehicleShop_Window, false) showCursor(false) setElementFrozen(localPlayer, false) fadeCamera(false, 1.0) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end end elseif (source == closeButton) then if guiGetVisible(VehicleShop_Window) then guiSetVisible(VehicleShop_Window, false) showCursor(false) setElementFrozen(localPlayer, false) fadeCamera(false, 1.0) setElementData ( localPlayer, "atVehShop", false) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end end end end) function openColorPicker() if (colorPicker.isSelectOpen) or not isElement(veh) then return end colorPicker.openSelect(colors) end function closedColorPicker() end function updateColor() if (not colorPicker.isSelectOpen) then return end local r, g, b = colorPicker.updateTempColors() if (veh and isElement(veh)) then r1, g1, b1, r2, g2, b2 = getVehicleColor(veh, true) if (guiCheckBoxGetSelected(checkColor1)) then r1, g1, b1 = r, g, b end if (guiCheckBoxGetSelected(checkColor2)) then r2, g2, b2 = r, g, b end setVehicleColor(veh, r1, g1, b1, r2, g2, b2) end end addEventHandler("onClientRender", root, updateColor) --[[addCommandHandler("xx", function() local x, y, z, lx, ly, lz = getCameraMatrix() setCameraMatrix(x, y, z, lx, ly, lz) outputChatBox(x..", "..y..", "..z..", "..lx..", "..ly..", "..z) end)]] addEventHandler("onClientMarkerHit", resourceRoot, function(player) if getElementType(player) ~= "player" or player ~= localPlayer or isPedInVehicle(player) then return end if ShopMarkersTable[source] then i = tonumber(getElementID(source)) guiGridListClear(carGrid) for i, v in ipairs(ShopTable["ID"]) do local carName = customCarNames[ v[1] ] or getVehicleNameFromModel(v[1]) local row = guiGridListAddRow(carGrid) guiGridListSetItemText(carGrid, row, 1, carName, false, true) guiGridListSetItemText(carGrid, row, 2, tostring(v[2]), false, true) end setCameraMatrix(ShopTable["CamX"], ShopTable["CamY"], ShopTable["CamZ"], ShopTable["lookAtX"], ShopTable["lookAtY"], ShopTable["lookAtZ"]) guiSetVisible(VehicleShop_Window, true) showCursor(true) setElementData ( player, "atVehShop", getElementData ( source, "shopID")) guiGridListSetSelectedItem(carGrid, 0, 1) setTimer(function() setElementFrozen(localPlayer, true) local carName = guiGridListGetItemText(carGrid, 0, 1) local carID = getVehicleModelFromNewName(carName) or getVehicleModelFromName(carName) local x, y, z = ShopTable["vPosX"], ShopTable["vPosY"], ShopTable["vPosZ"] if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end r1, g1, b1, r2, g2, b2 = math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255) veh = createVehicle(carID, x, y, z) setVehicleDamageProof(veh, true) setElementFrozen(veh, true) setVehicleColor(veh, r1, g1, b1, r2, g2, b2) timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0) end, 100, 1) end end) addEventHandler("onClientRender", getRootElement(), function() local x2, y2, z2 = getElementPosition(localPlayer) for index, car in pairs(getElementsByType('vehicle')) do if(getElementData(car,'ownercar')) then local x, y, z = getElementPosition(car) z = z+1 local sx, sy = getScreenFromWorldPosition(x, y, z) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 20) then local fontbig = 2-(distance/10) local owner = getElementData(car, "ownercar") if(owner) then dxDrawBorderedCarText(" ", sx, sy, sx, sy, tocolor(255, 255, 255, 255), fontbig, "default-bold", "center") end end end end end for i, v in ipairs ( ShopTable ) do local sx, sy = getScreenFromWorldPosition(v.PosX, v.PosY, v.PosZ+1) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D ( x2, y2, z2,v.PosX, v.PosY, v.PosZ ) if distance < 30 then local fontbig = 3-(distance/10) --dxDrawBorderedCarText("", sx, sy, sx, sy, tocolor(212, 179, 17, 200), fontbig, "default-bold", "center") end end end end) function dxDrawBorderedCarText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end function outputMessage (text, r, g, b) return exports["scr-Lib"]:outputMessage(text, r, g, b); end
  5. Boa tarde gente, estou com um problema muito chato! Quando entro em algum servidor, funciona tudo normalmente, porém na maioria das vezes eu não consigo usar algumas funções do jogo/servidor, por exemplo o celular pois não aparece os escritos dos menus no jogo, apenas o layout... alguém já passou por isso? sabe como resolver? segue algumas fotos: https://ibb.co/2q7BBPM https://ibb.co/qmrGvQB https://ibb.co/2q7BBPM https://ibb.co/qmrGvQB Good afternoon guys, I have a very annoying problem! When I enter a server, everything works normally, but most of the time I am unable to use some functions of the game/server, for example: the cellphone because the menu scripts do not appear in the game, only the layout... someone has already gone through that? know how to solve? Here are some pictures:
  6. This is the dumbest question I've ever asked on this forum, but I have problem even not only with this. So, how can I add scripts from different folders in my meta.xml? And in these scripts, how can I load xml files from different folders, too? Any idea? If yes, please, show me example I know, that I would use xml = xmlLoadFile("filename.xml") But how to load xml in different folders? Same <script src="script.Lua" type="server"/> But how to tell MTA to load script from different folder?
  7. local g = 0 function giveGold() local g = g+1 end addCommandHandler("giveG", giveGold) function showGold(source) outputChatBox(tostring(g), 255, 255, 0) end addCommandHandler("showG", showGold) I mean, I want the "showG" command to show the Player amount of gold, and the "giveG" command wants it to add the Player amount of gold. It is on the client side. PLS HELP
  8. ola, estou desenvolvendo um sistema de garagem ligado com a concessionaria, porem, estou tendo problema na parte de vender os carros, junto ao inventario de carros. ultilizei o debugscript 3 e o seguinte erro aparece: ERROR: [DevMods]\Eagle-Concessionaria\Inventario_C.Lua:188:attempt to call global 'triggerClientEvent' (a nill value). gostaria que me ajuda-sem, pois ja fiz de tudo e nao resolveu. aqui esta o codigo. function Vender_Carro ( _,state ) local id = DGS:dgsGridListGetSelectedItem(Invetario_Car) local NickPlayer = getElementData(Nick_Jogador, "text") local PrecoVeh = tonumber(getElementData(Preco_Car, "text")) if isEventHandlerAdded("onClientRender", getRootElement(), Dx_Vender) then if state == "down" then if isCursorOnElement ( x*693, y*418, x*149, y*40 ) then showCursor(false) removeEventHandler("onClientRender", root, Dx_Vender) end if (id ~= -1) then if isCursorOnElement ( x*525, y*418, x*149, y*40 ) then if (NickPlayer ~= "") then if type(PrecoVeh) == "number" then if PrecoVeh >= 500 then VeiculoName = DGS:dgsGridListGetItemText(Invetario_Car, id, 1) VeiculoID = DGS:dgsGridListGetItemData(Invetario_Car, id, 1) playSoundFrontEnd ( 4 ) showCursor(false) triggerServerEvent("EGL:Vender_Veh", root, localPlayer, NickPlayer, PrecoVeh, VeiculoName, VeiculoID ) removeEventHandler("onClientRender", root, Dx_Vender) else playSoundFrontEnd ( 6 ) triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] Valor Minimo e De 2500 Reais!", "info") end else playSoundFrontEnd ( 6 ) triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] O Comprador Não Possui Dinheiro Suficiente!", "info") end else playSoundFrontEnd ( 6 ) triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] Coloque o Nick da Pessoa que Deseja Você Queira Vender o Veiculo!", "info") end end else triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] Nenhum Veiculo Selecionado!", "info") end end end end addEventHandler ( "onClientClick", root, Vender_Carro )
  9. --[[ ################################################ # # # Script Criado Por # # FACEBOOK.COM/AIRNEWSCR # # # # # ################################################ --]] removeWorldModel ( 1412, 30, 207.5, -248.69999694824, 1.57813 ) -- Cercas removeWorldModel ( 781, 3, 196.66397, -268.06937, 1.57813 ) -- Arvore removeWorldModel ( 13437, 50, 195.24310, -236.23383, 1.36875 ) -- Arvore MecanicoPickup = createPickup ( 196.97218, -232.41890, 1.55537, 3, 1210) MarkerMecanico = createMarker ( 196.97218, -232.41890, 1.55537, "cylinder", 1.2, 255, 255, 255, 0 ) attachElements ( MarkerMecanico, MecanicoPickup, 0, 0, -1 ) BlipMecanico = createBlipAttachedTo ( MarkerMecanico, 42 ) setBlipVisibleDistance ( BlipMecanico, 150 ) function CancelarSumirPickup ( player ) cancelEvent() end addEventHandler ( "onPickupHit", MecanicoPickup, CancelarSumirPickup ) -------------------------------------------------------------------- ValorPorReparar = 500 LetraParaMarkers = "k" cmd1 = "reparar" -- /Reparar nick - Para Reparar o Veiculo de um Jogador cmd2 = "recusar" -- /Recusar - Para Recusar o Reparo do Mecanico cmd3 = "aceitar" -- /Aceitar - Para Aceitar o Reparo do Mecanico cmd4 = "mecanico" -- /Mecanicos - Para Chamar os Mecanicos Online do Servidor cmd5 = "profissao" -- /Profissao - Para ver os Comandos da Profissão Atual cmd6 = "hq" -- /HQ -- Localiza / Deslocaliza o Seu Local de Trabalho -------------------------------------------------------------------- local HQMecanicoBlip = createBlip ( 206.11905, -260.74591, 1.36875 ) setElementVisibleTo ( HQMecanicoBlip, root, false ) -------------------------------------------------------------------- function VerificarBlipEmprego(player) if player then acc = getPlayerAccount ( player ) if isGuestAccount ( acc ) then return end setElementVisibleTo ( HQMecanicoBlip, player, false ) end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then if getElementData ( pl, "Emprego" ) == "Mecanico" then return end VerificarBlipEmprego(pl) end end end, 3000,0) -------------------------------------------------------------------- function ComandoHQ ( source ) if getElementData ( source, "Emprego" ) == "Mecanico" then if isElementVisibleTo ( HQMecanicoBlip, source ) then setElementVisibleTo ( HQMecanicoBlip, source, false ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Desmarcado do Mapa!", "info") else setElementVisibleTo ( HQMecanicoBlip, source, true ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Marcado no Mapa!", "info") end end end addCommandHandler ( cmd6, ComandoHQ ) function RecusarEmprego01 (source) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego01 ) if isElementVisibleTo ( HQMecanicoBlip, source ) then setElementVisibleTo ( HQMecanicoBlip, source, false ) end removeElementData ( source, "Emprego", "Mecanico" ) exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Mecânico com Sucesso!", "warning") end function emarker(marker,md) if (md) then if isPedInVehicle ( source ) then return end if marker == MarkerMecanico then if getElementData ( source, "Emprego" ) == "Mecanico" then exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para se Demitir do Emprego de Mecânico") bindKey ( source, LetraParaMarkers, "down", RecusarEmprego01 ) end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),emarker) function lmarker(marker,md) if (md) then if marker == MarkerMecanico then exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego01 ) end end end addEventHandler("onPlayerMarkerLeave",getRootElement(),lmarker) canceltimer={} function fix(source,cmd,pname) if getElementData(source, "Emprego" ) == "Mecanico" then local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then if cliente == source then exports.Scripts_Dxmessages:outputDx(source, "Você não Pode Oferecer Reparos Para Você Mesmo!", "error") return end if isPedInVehicle(cliente) then local seat = getPedOccupiedVehicleSeat(cliente) if seat == 0 then local mecanico = getElementData(cliente,"cliente:mecanico") if isElement(mecanico) then exports.Scripts_Dxmessages:outputDx(source, "O Jogador "..getPlayerName(cliente).." Ja Esta Sendo Atendido Por um Mecanico!", "error") else local cx,cy,cz = getElementPosition(cliente) local x,y,z = getElementPosition(source) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if dist <= 7 then local cmoney = getPlayerMoney(cliente) if cmoney >= ValorPorReparar then setElementData(cliente,"cliente:mecanico",source) exports.Scripts_Dxmessages:outputDx(source, "Você Ofereceu Serviços de Reparo para o Jogador "..getPlayerName(cliente), "warning") exports.Scripts_Dxmessages:outputDx(cliente, "O Mecanico "..getPlayerName(source).." Quer Reparar seu Veiculo Por $"..ValorPorReparar..", Digite /Aceitar ou /Recusar.", "warning") canceltimer[cliente] = setTimer(cancelfix,10000,1,cliente) else exports.Scripts_Dxmessages:outputDx(source, "O Jogador "..getPlayerName(cliente).." Não tem Dinheiro Suficiente!", "error") end end end else exports.Scripts_Dxmessages:outputDx(source, "O Jogador "..getPlayerName(cliente).." Não é o Motorista do Veiculo!", "error") end else exports.Scripts_Dxmessages:outputDx(source, "O Jogador "..getPlayerName(cliente).." Não Esta em um Veiculo!", "error") end else exports.Scripts_Dxmessages:outputDx(source, "O Jogador Não Foi Encontrado", "error") end end end addCommandHandler(cmd1,fix) -------------------------------------------------------------------- function recusar(source) local mecanico = getElementData(source,"cliente:mecanico") if isElement(mecanico) then exports.Scripts_Dxmessages:outputDx(mecanico, "O Jogador "..getPlayerName(source).." Recusou o Reparo!", "error") -- Mecanico exports.Scripts_Dxmessages:outputDx(source, "Você Recusou o Reparo", "success") end setElementData(source,"cliente:mecanico",nil) if isTimer(canceltimer[source]) then killTimer(canceltimer[source]) end end addCommandHandler(cmd2,recusar) -------------------------------------------------------------------- function aceitar(source) local mecanico = getElementData(source,"cliente:mecanico") if isElement(mecanico) then if not isPedInVehicle(source) then exports.Scripts_Dxmessages:outputDx(mecanico, "O Jogador Aceitou o Reparo, Porem não Esta em um Veiculo!", "warning") exports.Scripts_Dxmessages:outputDx(source, "Você Não Pode Aceitar um Reparo Fora de um Veiculo!", "warning") return end --Procurado = getPlayerWantedLevel ( source ) --if Procurado > 0 then --exports.Scripts_Dxmessages:outputDx(source, "Você Esta Procurado e Não Podera Aceitar o Reparo!", "warning") --exports.Scripts_Dxmessages:outputDx(mecanico, "O Jogador Aceitou o Reparo, Porem Estava Procurado, Reparo Cancelado!", "warning") --return end exports.Scripts_Dxmessages:outputDx(mecanico, "O Jogador "..getPlayerName(source).." Aceitou o Reparo", "success") local cx,cy,cz = getElementPosition(mecanico) local x,y,z = getElementPosition(source) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if dist <= 7 then if isPedInVehicle(source) then local seat = getPedOccupiedVehicleSeat(source) if seat == 0 then local vh = getPedOccupiedVehicle(source) if isElement(vh) then setElementHealth(vh,1000) fixVehicle(vh) setVehicleEngineState(vh,true) if isVehicleDamageProof(vh) then setVehicleDamageProof(vh,false) end end takePlayerMoney(source,ValorPorReparar) givePlayerMoney(mecanico,ValorPorReparar) exports.Scripts_Dxmessages:outputDx(mecanico, "Você Recebeu $"..ValorPorReparar.." Por Reparar um Veiculo!", "success") exports.Scripts_Dxmessages:outputDx(source, "Você Pagou $"..ValorPorReparar.." Ao Mecanico Por Reparar seu Veiculo!", "success") setElementData ( mecanico, "AirNewSCR_LiberarXP", "Sim" ) end end else exports.Scripts_Dxmessages:outputDx(source, "O Mecanico Esta Muito Longe!", "error") exports.Scripts_Dxmessages:outputDx(mecanico, "Você Esta Muito Longe do Cliente!", "error") end end setElementData(source,"cliente:mecanico",nil) if isTimer(canceltimer[source]) then killTimer(canceltimer[source]) end end addCommandHandler(cmd3,aceitar) -------------------------------------------------------------------- function cancelfix(source) local mecanico = getElementData(source,"cliente:mecanico") if isElement(mecanico) then exports.Scripts_Dxmessages:outputDx(mecanico, "O Jogador "..getPlayerName(source).." Demorou Para Aceitar o Reparo!", "error") end exports.Scripts_Dxmessages:outputDx(source, "Você Demorou Demais Para Aceitar o Reparo!", "error") setElementData(source,"cliente:mecanico",nil) end -------------------------------------------------------------------- function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end -------------------------------------------------------------------- addEventHandler("onVehicleDamage", getRootElement(),function(loss) if getElementType ( source ) == "vehicle" then if not isVehicleDamageProof(source) then local HP = getElementHealth(source)-loss if HP <= 350 then HP = 350 setElementHealth(source,350) setVehicleEngineState(source,false) setVehicleDamageProof(source,true) if isVehicleBlown(source) then fixVehicle(source) setElementHealth(source,350) setVehicleDamageProof(source,true) end end end end end) -------------------------------------------------------------------- function DesligarAndLigar ( playerSource ) if math.floor ( getElementHealth( source ) + 0.5 ) > 350 then setVehicleDamageProof( source, false ) -- Não Quebrado else setVehicleEngineState( source, false ) -- Quebrado triggerClientEvent ( "Mecanico>Quebrado", playerSource ) end end addEventHandler ( "onVehicleEnter", root, DesligarAndLigar ) -------------------------------------------------------------------- function MecanicoVem(source) for i, player in ipairs(getElementsByType("player")) do local uj = getElementData(player, "Emprego" ) or false --if type(uj) == "boolean" then if uj == "Mecanico" then exports.Scripts_Dxmessages:outputDx(player, "O Jogador "..getPlayerName(source).." Chamou Por um Mecanico! Digite /Localizar "..getPlayerName(source), "warning") end --end end end addCommandHandler(cmd4,MecanicoVem) -------------------------------------------------------------------- function ComandoMecanico ( ThePlayer ) exports.Scripts_Dxmessages:outputDx(ThePlayer, "Os Mecanicos Foram Avisados, Aguarde no Local!", "warning") setElementData ( ThePlayer, "Chamado:Mecanico", true ) setTimer ( function() removeElementData ( ThePlayer, "Chamado:Mecanico" ) end, 60000, 1 ) end addCommandHandler(cmd4, ComandoMecanico ) -------------------------------------------------------------------- function ComandosProf ( ThePlayer ) if getElementData ( ThePlayer, "Emprego" ) == "Mecanico" then playSoundFrontEnd ( ThePlayer, 43 ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #BEE09AComandos da Profissão de Mecânico", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/HQ #ffffff- #9ABDE0Para Marcar / Desmarcar o seu Local de Trabalho", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/Reparar Nick #ffffff- #9ABDE0Para Reparar um Veiculo de outro Jogador", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/Localizar Nick #ffffff- #9ABDE0Para Localizar um Jogador", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/Deslocalizar #ffffff- #9ABDE0Para Deslocalizar um Jogador", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #FFD700Entre no Veiculo da Profissão, Aguarde um Chamado por um Mecanico!", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) end end addCommandHandler(cmd5, ComandosProf ) -------------------------------------------------------------------- function CriarVeiculosComData () VeiculosComData = { createVehicle(525, 196.30507, -252.62512, 1.3, 0, 0, 180 ), createVehicle(525, 201.30507, -252.62512, 1.3, 0, 0, 180 ), createVehicle(525, 206.30507, -252.62512, 1.3, 0, 0, 180 ), createVehicle(525, 211.30507, -252.62512, 1.3, 0, 0, 180 ), createVehicle(525, 216.30507, -252.62512, 1.3, 0, 0, 180 ), createVehicle(525, 196.30507, -268.03806, 1.3, 0, 0, 0 ), createVehicle(525, 201.30507, -268.03806, 1.3, 0, 0, 0 ), createVehicle(525, 206.30507, -268.03806, 1.3, 0, 0, 0 ), createVehicle(525, 211.30507, -268.03806, 1.3, 0, 0, 0 ), createVehicle(525, 216.30507, -268.03806, 1.3, 0, 0, 0 ), } for i, veh in ipairs(VeiculosComData) do setElementData ( veh, "Emprego", "Mecanico" ) setVehicleDamageProof(veh,true) setVehicleColor( veh, 255, 255, 255 ) setVehiclePlateText ( veh, "RPGAMING" ) addEventHandler("onVehicleStartEnter", veh, VerificarEmprego ) --addEventHandler("onVehicleExit", veh, SairDoVeiculosComData ) local tx, ty, tz = getElementPosition(veh) local rx, ry, rz = getElementRotation(veh) setVehicleRespawnPosition(veh, tx, ty, tz, rx, ry, rz) end end addEventHandler("onResourceStart", resourceRoot, CriarVeiculosComData ) function VerificarEmprego (thePlayer, seat) local Jogador = getElementData(thePlayer, "Emprego" ) if seat == 0 then if Jogador == "Mecanico" then else cancelEvent() exports.Scripts_Dxmessages:outputDx(thePlayer, "Esse Veiculo é Exclusivo dos Mecânicos!", "error") end end end --[[function SairDoVeiculosComData () local veh = source setTimer(function() if getVehicleOccupant(veh) == false then respawnVehicle(veh) end end, 30000, 1) end addEventHandler ( "onPlayerQuit", getRootElement(), SairDoVeiculosComData ) --]] -------------------------------------------------------------------- local rElement = getRootElement() Tempo_Respawn = 5 function respawnVehicles(player, seconds) outputChatBox ( "[BCR]: Fique atento(a), respeite Todas Regras do nosso Servidor!", root, 255, 255, 255, true ) outputChatBox ( "[BCR]: Participe de nossa comunidade, acesse nosso Grupo do WhatsApp. Link no Discord!", root, 255, 255, 255, true ) for i, veh in ipairs(VeiculosComData) do if isEmpty( veh ) then setTimer ( function() respawnVehicle ( veh ) end, 10000, 1 ) end end end setTimer(respawnVehicles, Tempo_Respawn * 60000,0) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end Grupo = "Mecanico" function Verificar_Emprego_Atual ( ) for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo ) ) then if getElementData ( player, "Emprego" ) == false then setElementData ( player, "Emprego", "Mecanico" ) end else if getElementData ( player, "Emprego" ) == "Mecanico" then setElementData ( player, "Emprego", false ) end end end end end setTimer ( Verificar_Emprego_Atual, 5000, 0 ) --------------------------------------------------------------------
  10. Why not see another players my messages? And how to add built-in, and addCommandHandler commands to this chat system? Client: Server: Thanks the help!
  11. Need RPG scripter he will do something and i'll give him steam account have coast 180$ have CS:GO , GTA V , Rocket League , Arma3 and Rainbow Six Siege and more the steam account level 10 add me on discord : Smoker#8738 Facebook : https://www.facebook.com/profile.php?id=100009745308181
  12. Hello! I started lua programming in MTA so, I got a problem, and I don't understand the other topics. Just send the code, and I will read it, and understand it. And if you can descript it pls do it. How to optimize this code on every screen? local x,y = guiGetScreenSize() oX, oY = 1920, 1080 function mainRender() local health, armor = getElementHealth(localPlayer), getPedArmor(localPlayer) local h, m = getTime() if h < 10 then h = "0" .. h end if m < 10 then m = "0" .. m end dxDrawRectangle(1590/oX*x, 30/oY*y, 300/oX*x, 100/oY*y 0x7F000000) dxDrawRectangle(1600/oX*x, 40/oY*y, 280*healt/100/oX*x, 10/oY*y, tocolor(255, 0, 0))-- élet dxDrawRectangle(1600/oX*x, 60/oY*y, 280*armor/100/oX*x, 10/lY*y, tocolor(0, 0, 255))-- pajzs dxDrawText(h .. ":" .. m, 1600, 70, _, _, _, 2, "pricedown", "left", "top") --idő end addEventHandler("OnClientRender", root, mainrender)
  13. Olá, estava fazendo um painel de inicio e queria que ele rodasse um video não uma imagem e eu fiz está função: local sW, sH = guiGetScreenSize() local x, y = (sW/1366), (sH/768) local font = dxCreateFont("font.ttf", x*15) editBox = {} editBox.__index = editBox editBox.instances = {} function onClientResourceStart() tick = getTickCount() g = {} g.user = editBox.new() showCursor(true) showChat(false) setPlayerHudComponentVisible("all", false) addEventHandler("onClientRender", root, dxLoginS) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onClientResourceStart) function dxLoginS() end local browser = guiCreateBrowser( 0, 0, sW, sH, false, false, false) local theBrowser = guiGetBrowser( browser ) addEventHandler( "onClientBrowserCreated", theBrowser, function() loadBrowserURL( source, "https://www.youtube.com/watch?v=S0kWGy_XfMI" ) end) function editBox.new() local self = setmetatable({}, editBox) self.text = "" self.maxLength = 15 self.scale = y*0.8 self.state = "normal" self.font = font self.color = {255,255,255,220} self.textColor = {255,255,255,220} table.insert(editBox.instances, self) return self end function editBox:getPosition(x,y,w,h) return self.x, self.y, self.w, self.h end function editBox:setPosition(x,y,w,h) self.x, self.y, self.w, self.h = x,y,w,h return true end function dxDrawBorder(posX, posY,posW,posH,color,scale) dxDrawLine(posX, posY, posX+posW, posY, color, scale,false) dxDrawLine(posX, posY, posX, posY+posH, color, scale,false) dxDrawLine(posX, posY+posH, posX+posW, posY+posH, color, scale,false) dxDrawLine(posX+posW, posY, posX+posW, posY+posH, color, scale,false) end function isCursorOnElement(x, y, w, h) if (not isCursorShowing) then return false end local sx, sy = guiGetScreenSize() local cx, cy = getCursorPosition local cx, cy = (cx*sx), (cy*sy) if (cx >= x and cx <= x + w) and (cy >= y and cy <= y + h) then return true else return false end end Até ai tudo bem, ele abre o video e tals mas oque eu quero é que ele abra o video já em tela cheia e não igual ao youtube com a logo outros vídeos essas coisas, somente este video mas quando eu dou start nele ele abre ja em tela cheia se poderem me ajudar fico muito grato... ❤️
  14. I'm having trouble understanding the code I type / level the nick and the amount xp more does not work the code if someone could help me thank you Code function DAR_XP_AIRNEWSCR (source, cmd, pname, Quantity) if pname and tonumber then local client = getPlayerFromPartialName (pname) if isElement (client) then if getElementData (source, "Console_AirNewSCR") == "Yes" then setElementData (client, "Level", Quantity) exports.Scripts_Dxmessages: outputDx (source, "You Set the Player's Level" ..getPlayerName (client) .. "# ffffff for" ..Quantity .. "Success!", "success") exports.Scripts_Dxmessages: outputDx (client, "O (A) Admin" ..getPlayerName (source) .. "# ffffff Set your Level to" ..Quantity .. "Success!", "success") end else exports.Scripts_Dxmessages: outputDx (source, "The Player Was Not Found", "error") end end end addCommandHandler ("level", DAR_XP_AIRNEWSCR)
  15. Eu queria separar as funções de um script de bar ( Separar uma função pra cada bebida, Catuaba, Vodca e Cerveja ) pois é muito desorganizado e tambem porque coloquei um painel novo nesse script... ja tentei varias e varias vezes e todas deram errado; c.lua ( A Parte das funções que quero separar Antes ) Esse aqui funciona normalmente, mas o proximo que eu separei não funciona.. function clickEffectDrink(button,state) if button == "left" and state == "up" then if isMouseInPosition(drawDrinksBVS.bgCatuabaX, drawDrinksBVS.bgCatuabaY, drawDrinksBVS.bgCatuabaW, drawDrinksBVS.bgCatuabaH) then if (not isTimer(timerExpireDrinks)) then triggerServerEvent("server:onPlayerBuyDrinkBVS", resourceRoot, 200) else playSoundFrontEnd(6) outputChatBox("Você ainda está com efeito da bebida, espere mais um pouco para beber de novo.", 255, 0, 0) end elseif isMouseInPosition(drawDrinksBVS.bgVodkaX, drawDrinksBVS.bgVodkaY, drawDrinksBVS.bgVodkaW, drawDrinksBVS.bgVodkaH) then if (not isTimer(timerExpireDrinks)) then triggerServerEvent("server:onPlayerBuyDrinkBVS", resourceRoot, 150) else playSoundFrontEnd(6) outputChatBox("Você ainda está com efeito da bebida, espere mais um pouco para beber de novo.", 255, 0, 0) end elseif isMouseInPosition(drawDrinksBVS.bgCervejaX, drawDrinksBVS.bgCervejaY, drawDrinksBVS.bgCervejaW, drawDrinksBVS.bgCervejaH) then if (not isTimer(timerExpireDrinks)) then triggerServerEvent("server:onPlayerBuyDrinkBVS", resourceRoot, 100) else playSoundFrontEnd(6) outputChatBox("Você ainda está com efeito da bebida, espere mais um pouco para beber de novo.", 255, 0, 0) end elseif isMouseInPosition(drawDrinksBVS.bgCloseX, drawDrinksBVS.bgCloseY, drawDrinksBVS.bgCloseW, drawDrinksBVS.bgCloseH) then if isEventHandlerAdded("onClientRender", root, drawDrinks) and isEventHandlerAdded("onClientClick", root, clickEffectDrink) then removeEventHandler("onClientRender", root, drawDrinks) removeEventHandler("onClientClick", root, clickEffectDrink) showCursor(false) end end end end c.lua ( Aqui eu refiz separando as funções das bebidas Catuaba, Vodca e Cerveja, adicionei algumas coisas a mais porque como eu disse, mudei o painel. ) function Catuaba(_,state) if isEventHandlerAdded("onClientRender", root, drawDrinks) then if state == "down" then if isCursorOnElement(screenW * 0.3522, screenH * 0.4714, screenW * 0.4632, screenH * 0.5143) then if (not isTimer(timerExpireDrinks)) then setBlur(false) triggerServerEvent("server:onPlayerBuyDrinkBVS", localPlayer, 200) removeEventHandler("onClientRender", root, drawDrinks) showChat(true) showCursor(false) playSound("sfx/hit.mp3", false) else playSound("sfx/hit.mp3", false) outputChatBox("#1066E7Você ainda está com efeito da bebida, espere mais um pouco para beber de novo.", 255, 0, 0) end end end end end addEventHandler("onClientClick", root, Catuaba) function Vodca(_,state) if isEventHandlerAdded("onClientRender", root, drawDrinks) then if state == "down" then if isCursorOnElement(screenW * 0.3522, screenH * 0.4714, screenW * 0.4632, screenH * 0.5143) then if (not isTimer(timerExpireDrinks)) then setBlur(false) triggerServerEvent("server:onPlayerBuyDrinkBVS", localPlayer, 150) removeEventHandler("onClientRender", root, drawDrinks) showChat(true) showCursor(false) playSound("sfx/hit.mp3", false) else playSound("sfx/hit.mp3", false) outputChatBox("#1066E7Você ainda está com efeito da bebida, espere mais um pouco para beber de novo.", 255, 0, 0) end end end end end addEventHandler("onClientClick", root, Vodca) function Cerveja(_,state) if isEventHandlerAdded("onClientRender", root, drawDrinks) then if state == "down" then if isCursorOnElement(screenW * 0.3522, screenH * 0.4714, screenW * 0.4632, screenH * 0.5143) then if (not isTimer(timerExpireDrinks)) then setBlur(false) triggerServerEvent("server:onPlayerBuyDrinkBVS", localPlayer, 100) removeEventHandler("onClientRender", root, drawDrinks) showChat(true) showCursor(false) playSound("sfx/hit.mp3", false) else playSound("sfx/hit.mp3", false) outputChatBox("#1066E7Você ainda está com efeito da bebida, espere mais um pouco para beber de novo.", 255, 0, 0) end end end end end addEventHandler("onClientClick", root, Cerveja) Oque há de errado no script ? se puderem me informar o erro como sempre agradeço irmãos!
  16. I bring the GM DayZ 0.6.7 of Marwin totally free of bugs (fixed by me) and errors. Ready to edit to your liking. I hope you enjoy it! DOWNLOAD! https://hadesmta.blogspot.mx/2018/04/mtadayz-067-simplificada-limpia.html
  17. GalaxyExx

    clan panel

    hey , i want make a clan list that are showed in panel ( each clan has informations like xp , leader , kills , members , online , members .. ) can anyone help me ?
  18. Hi, Fortnite building system for sell put your offer (: - you can test scripts if you want. https://youtu.be/wlxe1g1oMDQ
  19. Welcome, Fellow Multi Theft Auto players Introduction: Screenshots about our server: Some of our server Features :
  20. Tengo errores en esta funciones dentro de mi sistema de nivel me ayudarían a solucionarlo por favor?. ---EN EL SERVER TENGO ESTE ERROR AQUI: getPlayerEXP = function(l_13_0) if not tonumber(getElementData(l_13_0, "exp")) then -- return not l_13_0 or type(l_13_0) ~= "userdata" or getElementType(l_13_0) ~= "player" or 0 -- do return end -- AQUI end outputDebugString("Bad argument @ 'getPlayerEXP' [Expected player element at argument 1, got " .. tostring(l_13_0) .. "]", 2) return false end -- EN EL CLIENTE TENGO ESTE ERROR AQUI EN LAS MIMAS LINEAS: getPlayerEXP = function(l_7_0) if not tonumber(getElementData(l_7_0, "exp")) then return not l_7_0 or type(l_7_0) ~= "userdata" or getElementType(l_7_0) ~= "player" or 0 do return end -- AQUI end outputDebugString("Bad argument @ 'getPlayerEXP' [Expected player element at argument 1, got " .. tostring(l_7_0) .. "]", 2) return false end -- LOS ERRORES SON DE: `end`expected (to close `if` at line 197) near do
  21. Preciso de uma Verificação para Somente o dono do veículo poder entrar na direção do veículo. De preferência por setelementdata, alguem pode me ajudar?? Tentei assim Quando criar ----- VeiculoPainel[source] = createVehicle... setElementData ( VeiculoPainel[source], "Dono", ""..accname.."" ) setElementData ( source, "Dono", ""..accname.."" ) Quando for entrar ----- Jogador = getElementData( source, "Dono" ) Veículo = getElementData( VeiculoPainel[source], "Dono" ) If Jogador == Dono then --Nada, apenas entrar no veículo normal else cancelEvent ()  Tentei dessa forma, sei que está meio incompleto mais poderiam me ajudar a fazer isso? Meu objetivo e fazer apenas o dono do veículo poder dirigir o carro, e caso o carro não tiver setElementData qualquer um pode entrar no volante, me ajudem.
  22. Login con fondo editable Un sistema de login y creación de cuentas creado enteramente con dxDrawing. Este posee un background de un vídeo de YouTube a elegir por el cliente. PRECIO: 7,00$ Negociable. PayPal Pack de Trabajos Este pack, incluye: Piloto de Aviones Conductor de Buses Conductor de Trenes Granjero Mecánico Minero Repartidor de Pizza Policía (con su respectivo sistema de búsqueda, arresto y prisión) Conductor de Taxis PRECIO: 10,00$ Negociable. PayPal. Sistema de descargas en segundo plano Un sistema con el cual podrás descargar skins, coches y armas en segundo plano, mientras juegas. Evitando largas esperas y que el lado client de los scripts se vea afectado durante la jugabilidad. PRECIO: 5,00$ Negociable, PayPal Sistema de Clanes + Clanes Oficiales Creación de Clanes Lista de Clanes creados, clasificados por si son oficiales o no Sistema de Invitación a Clanes Informacion del clan con notificación de actualización Banco del Clan, que también incluye un sistema de compra de packs oficiales Sistema de Reclutamiento Lista de miembros del clan con sus respectivas acciones PRECIO: 10,00$ Negociable, PayPal. Sistema de Zonas Zombies Sistema utilizado en servidores Biohazard, el cual posee 4 tipos de Zonas. Zona Fácil (Zombies sin armas) Zona Media (Zombies con armas cuerpo-cuerpo) Zona Difícil (Zombies con armas de fuego) Zona BOSS (Zombies especiales, con ataques especiales y vida extra) PRECIO: 8,00$ Negociable. PayPal Tiendas de Skins, Armas y Habilidades Un sistema de tiendas que posee su propia previsualizacion, ya sea del skin que vas a comprar, arma o habilidad. La tienda de habilidad se hace con el skin propio que poseas en el momento, mientras que la del skin, es del skin que desees comprar. Y el arma, el arma que deseas comprar. Enteramente por comandos de teclado (especificado en la misma tienda que tecla sirve para que). Completamente hecho con dxDrawing. PRECIO: 10,00$ Negociable, PayPal Y esos son los scripts que tengo disponibles para la venta. También quisiera aprovechar esta oportunidad para promocionar mis servicios como Paid Scripter (Scripter Pago). Trabajo en cualquier tipo de gamemode. Desde Freeroam hasta RolePlay. Ya algunos en este foro me conocen y han trabajado conmigo. Trabajo enteramente a través de PayPal como método de Pago. En las monedas Dolar Estadounidense (USD) y Euros (EUR). Cualquier solicitud, pueden hacerla directamente a mi pagina de Facebook, las cuales las dejo mas abajo en los métodos de contacto. Cualquier otra cosa, aquí estoy para servir. ¡Hasta otra! Métodos de Contacto: Facebook Correo Mensaje Privado a este perfil (no muy recomendado, ya que puedo tardar un tiempo en responder ya que no frecuento mucho el foro) ¡Un saludo!
  23. Basicamente um script que tem em quase todo servidor, parece que pra quem tem Pc fraco, digita /pcfraco e ele diminui os gráficos ou algo do tipo, e /pcfoda faz o oposto, em alguns servidores o comando e diferente ( /lag )
  24. السلام عليكم ورحمة الله وبركاته طبعا انا خلاص تقريبا باقيلي شهر واجيب جهازي الجديد ف خلاص ليش اقعد ب MTA ويلا خلي اساطير للنوبات يفرحوو فيها ويعدلو براحتهم لاني ما رح ارجع ثاني الي بده باك اب سيرفري مقابل : حساب كلاش اوف كلانس تاون هول عالي 9 او 10 او 11 ويبشر بالباك اب كامل وما بعطيه لاحد غيره ................... يلا استودعكم في الله @!#NssoR_) -- يرجي نقل الموضوع للقسم العام
  25. Why the table disappears after the cycle? Never this was not. shel = {} local shelPlaces = { [1] = { [1] = {x=0,y=0,z=0}, [2] = {x=0,y=0,z=0}, [3] = {x=0,y=0,z=0}, }, } function createShelters(gameId, players) local gameId = tonumber(gameId) shel[gameId] = {} for i=1,#shelPlaces do --outputDebugString("table "..shel[gameId]) shel[gameId][i] = { ["places"] = { [1] = {x=shelPlaces[i][1].x,y=shelPlaces[i][1].y,z=shelPlaces[i][1].z,["object"]="craftTable"}, }, } outputChatBox(shel[1][1]["places"][1]["object"]) -- WORKING for pI=2,#shelPlaces[i] do shel[gameId][i]["places"] = { [pI] = {x=shelPlaces[i][pI].x,y=shelPlaces[i][pI].y,z=shelPlaces[i][pI].z,["object"]=false}, } end end createCraftsTable(gameId) end addEventHandler("onGameStarted", root, createShelters) function createCraftsTable() --for i=1,10 do --for name,object in pairs(shel[gameId][i]) end function tempSpawn() spawnPlayer(source, 0,0,5) setCameraTarget(source, source) end addEventHandler("onPlayerLogin", root, tempSpawn) function startTest(pSource, command, gameId) triggerEvent("onGameStarted", root, gameId) end addCommandHandler("gameTest", startTest) function getGameInfo() outputChatBox(shel[1][1]["places"][1]["object"]) -- NOT WORKING end addCommandHandler("gInfo", getGameInfo)