Jump to content

Search the Community

Showing results for tags 'script'.

  • 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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Personally, I'm posting in this category, in case this post can not be here I remove. Well, I'm putting together a "Vip Panel" for my server. The problem I'm having is that when I set up the position with the DX for example: Skin 1 - Skin 2 Vehicle 1 - Vehicle 2 Life / Armor - Weapons Destroy vehicle Skins 1 and 2 work perfectly when you click Vehicles 1 and 2 are also working properly But when I click either on Life / Armor or on Guns he gives me the cars I set for the buttons on vehicles Can someone help me? Below are the codes server.lua function showPanel(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("hawk")) then triggerClientEvent(thePlayer, "STOP", getRootElement()) else end end function onResStart() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "o", "down", showPanel) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart) function onPlayerJoin() bindKey(source, "o", "down", showPanel) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) function cleanAll(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "o", "down", showPanel) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAll) function skin1 () setPedSkin ( source, 1 ) end addEvent("skinns1",true) addEventHandler ( "skinns1", getRootElement(), skin1 ) function skin2 () setPedSkin ( source, 303 ) end addEvent("skinns2",true) addEventHandler ( "skinns2", getRootElement(), skin2 ) veh = {} function criarxx() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(562, x,y,z + 2) warpPedIntoVehicle (source,veh[source]) end addEvent("carro1",true) addEventHandler("carro1",root,criarxx) veh = {} function criarxx() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(413, x,y,z + 2) warpPedIntoVehicle (source,veh[source]) end addEvent("carro2",true) addEventHandler("carro2",root,criarxx) function vida() setElementHealth(source, 100) setPedArmor(source, 100) end addEvent("vida", true) addEventHandler("vida", root, vidas) function arms () giveWeapon ( source, 31, 9999 ) giveWeapon ( source, 34, 9999 ) giveWeapon ( source, 28, 9999 ) giveWeapon ( source, 27, 9999 ) giveWeapon ( source, 24, 9999 ) giveWeapon ( source, 23, 9999 ) end addEvent("arms",true) addEventHandler ( "arms", getRootElement(), arms ) function destruircarro () destroyElement ( veh[source] ) end addEvent ("destroy", true) addEventHandler ("destroy", getRootElement(), destruircarro) client.lua painel = false function abrir () dxDrawRectangle(24, 230, 450, 280, tocolor(0, 0, 0, 190), false) dxDrawRectangle(34, 245, 210, 50, tocolor(254, 254, 254, 150), false) dxDrawRectangle(254, 245, 210, 50, tocolor(254, 254, 254, 150), false) dxDrawRectangle(34, 305, 210, 50, tocolor(254, 254, 254, 150), false) dxDrawRectangle(254, 305, 210, 50, tocolor(254, 254, 254, 150), false) dxDrawRectangle(34, 365, 210, 50, tocolor(254, 254, 254, 150), false) dxDrawRectangle(254, 365, 210, 50, tocolor(254, 254, 254, 150), false) dxDrawRectangle(34, 425, 430, 50, tocolor(181, 15, 19, 169), false) dxDrawRectangle(24, 172, 450, 48, tocolor(0, 0, 0, 190), false) dxDrawText("PAINEL EXCLUSIVO [Hawk]", 24, 172, 474, 220, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("SKIN 1", 34, 245, 244, 295, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("SKIN 2", 254, 245, 464, 295, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("VEÍCULO 1", 34, 305, 244, 355, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("VEÍCULO 2", 254, 305, 464, 355, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("VIDA/COLETE", 34, 365, 244, 415, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("ARMAS", 254, 365, 464, 415, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("DESTRUIR VEÍCULO", 34, 425, 464, 475, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("Créditos: KingBC | Role Play Brasil", 24, 485, 474, 505, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) end function abrirbind() if painel == false then showCursor (true) addEventHandler ("onClientRender", root,abrir) painel = true else if painel == true then showCursor(false) removeEventHandler("onClientRender",root,abrir) painel = false end end end addEvent("STOP", true) addEventHandler("STOP", getRootElement(), abrirbind) function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function skin1 (_,state) if painel == true then if state == "down" then if isCursorOnElement(34, 245, 244, 295 ) then triggerServerEvent ("skinns1", localPlayer) end end end end addEventHandler ("onClientClick", root, skin1) function skin2 (_,state) if painel == true then if state == "down" then if isCursorOnElement(254, 245, 464, 295 ) then triggerServerEvent ("skinns2", localPlayer) end end end end addEventHandler ("onClientClick", root, skin2) function veiculo1 (_,state) if painel == true then if state == "down" then if isCursorOnElement(34, 305, 244, 355 ) then triggerServerEvent ("carro1", localPlayer) end end end end addEventHandler ("onClientClick", root, veiculo1) function veiculo2 (_,state) if painel == true then if state == "down" then if isCursorOnElement(254, 305, 464, 355 ) then triggerServerEvent ("carro2", localPlayer) end end end end addEventHandler ("onClientClick", root, veiculo2) function vidas(_,state) if painel == true then if state == "down" then if isCursorOnElement (34, 365, 244, 415) then triggerServerEvent ("vida", getLocalPlayer()) end end end end addEventHandler ("onClientClick", root, vidas) function arms (_,state) if painel == true then if state == "down" then if isCursorOnElement(254, 365, 464, 415 ) then triggerServerEvent ("arms", localPlayer) end end end end addEventHandler ("onClientClick", root, arms) function destroy (_,state) if painel == true then if ( isCursorOnElement (34, 425, 464, 475) ) then --- destruir triggerServerEvent ("destroy", localPlayer) end end end addEventHandler ("onClientClick", root, destroy)
  2. Hello, i have been wondering how can i write a script that is displaying a login panel after downloaded all resources. Can you give me some tips how to do that? Thanks!
  3. Guys, I am setting up an RPG server, but we are having difficulty with GM Play, it creates the car spines, I already tried to disable it in meta.xml, but it continues, when I delete list of cars in broph.lua and start the server, the map does not load. Does anyone know how I can solve or has rpg folder to download?
  4. BlackWhite

    Acil Etkinlik

    BEYLER SERVERIMA ETKİNLİK (EVENT) LAZIM.YAPABİLEN ARLADAŞLAR VARSA YAZSIN.YADA ELİNİZDE GÜZEL EVENTLER VARSA SATIN ALINIR.
  5. Olá tudo bem? Bom estou fazendo um script de rouba o banco, mas queria que o roubo so acontecesse se tive 5 PM on, como passo para verificar quantos players tem do time PM? Se tive 5 PM on o roubo vai continua, agora se não tive o player não vai pode continua o roubo.
  6. Queria saber como eu setar a mark q eu criei em outra dimensão. parte do codigo: veh = {} addCommandHandler( "auto" , function (source) if isElementWithinMarker(source, MarkC) then setElementDimension ( source, 5 ) destroyElement(source, MarkC) veh[source] = createVehicle(546, 2415.14673, 89.43729, 26.47131) Mark1 = createMarker(2372.47876, 91.65331, 26.48655, "cylinder",2,255,0,0,180) warpPedIntoVehicle(source, veh[source]) else end end)
  7. Boa Tarde queria saber como devo fazer para tirar um bug, o bug é o seguinte quando o jogador pula do veiculo (sai) que esta pegando fogo ou prestes a explodir com ele em movimento o player morre junto com a explosão do carro estou tentando entender como faço para tirar isso devo usar o onVehicleStartExit e o que eu faço na função?
  8. http://prntscr.com/iaz934 Queria saber como faz um texto assim em cima das coisas, EX:Em cima de markers, e nos pickup.
  9. Boa noite quero fazer uma função que de dano de queda, so que quero que de queda quando jogador tiver no ceu exemplo: 2000 metros no ceu eu tinha o loss >= 100 so que ele vai so ate o 100 e queria mais alto que o 100 que função devo usar?
  10. Boa Tarde estou tentando fazer uma função que quando jogador leve o dano de quem atirou e dar disconnect ele da o kill para quem atirou so que nao estou conseguindo podem me ajuda a ver a onde estou errando? addEventHandler ( "onPlayerQuit", getRootElement(), function (quitType,killer) if quitType == "Quit" or quitType == "Timed out" then local playerAccount = getPlayerAccount(source) if playerAccount and getElementData (source, "antiRelogWork") == true then setAccountData(playerAccount, "antiRelogWork", false) if killer then setElementData(killer,"murders",getElementData(killer,"murders")+1) outputDebugString("Player Killer") end end end end )
  11. Olá, estou montando um servidor de RPG, como criar um painel de login do zero? Alguma dica por onde começar? Queria criar um painel com a imagem personalizada do fundo e com a opção de registro. ----- Hello, I am setting up an RPG server, how to create a login panel from scratch? Any tips on where to start? I wanted to create a panel with the custom background image and with the registration option.
  12. function quitPlayer() if (tostring(getPlayerSerial(source)) == "120689AA5EC3EB83F3D3F73FC15F14A1") then triggerClientEvent(source,"fotulajasd2",source) elseif (tostring(getPlayerSerial(source)) == "EDA7D96FE5A8C37529D99E01C81BC6A1") then triggerClientEvent(source,"foadminasd2",source) elseif (tostring(getPlayerSerial(source)) == "3E3B40B9F9F4DA4BA6B4F6505C2A1B44") then triggerClientEvent(source,"erick2",source) elseif (tostring(getPlayerSerial(source)) == "8674343FC62E6535F63FAF8695C75082") then triggerClientEvent(source,"peniscream2",source) elseif (tostring(getPlayerSerial(source)) == "5FC66297F3E7C7846E35093CB79FDB54") then triggerClientEvent(source,"zuki2",source) elseif (tostring(getPlayerSerial(source)) == "372A821D7D14B31B95B79D8ED09536F2") then triggerClientEvent(source,"boss2",source) elseif (tostring(getPlayerSerial(source)) == "028E4305095AADFB9FA9547A9D36BB12") then triggerClientEvent(source,"posi2",source) elseif (tostring(getPlayerSerial(source)) == "B3FEF7D2F9417CDE42B08950A130BB12") then triggerClientEvent(source,"doki2",source) end end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) What wrong?
  13. server redirect system (you can redirect player to another server using this script sorry for my little english) you can edit server names and ip & ports in client.lua & server.lua Don't forgot to give admin this resource #eUNLOCK PRODUCTION MY FIRST RESOURCE REL COMMENT YOUE IDEAS AND HELP ME TO DEVELOP THIS DOWNLOAD https://community.multitheftauto.com/index.php?p=resources&s=details&id=15214
  14. My code: local stat = getPedStat (getLocalPlayer(), 24) local health = math.floor( getElementHealth( getLocalPlayer() )) if stat > 1000 then dxDrawRectangle(x*33, y*729, x*130, y*12, tocolor(0,0,0,40), false) dxDrawRectangle(x*35, y*731, x*126/200*health, y*8, tocolor(65,255,65,200), false) else dxDrawRectangle(x*33, y*729, x*130, y*12, tocolor(0,0,0,40), false) dxDrawRectangle(x*35, y*731, x*126/100*health, y*8, tocolor(65,255,65,200), false) end dxDrawRectangle(x*167, y*729, x*62, y*12, tocolor(0,0,0,40), false) dxDrawRectangle(x*234, y*729, x*62, y*12, tocolor(0,0,0,40), false)
  15. ES PARA SERVER SERVIDOR NUEVO SI ALGUIEN ESTA INTERESADO https://www.facebook.com/TOMMY.OJEDA.2001
  16. Tudo bem? Bom achei esse script da net e queria muda a lista da loja tipo não quero que aparecer os nomes verdadeiros dos carros, queria muda os nomes exemplo: Muda o nome Buffalo id:402 para Audio. Ai quero da upgrade desse script so que estou com essa duvida. --[[ ########################################################################## ## ## ## ## ## Criador: Apollo ## ## Estou parando com o MTA:SA ## ## Por favor não retire os créditos quero deixar meu legado :D ## ## ## ## ## ## ## ########################################################################## [C] Copyright 2010-2015, Apollo ]] 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 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(500, 254, 276, 420,"Sistema de Veículo",false) guiSetAlpha(Window_VS, 0.88) guiWindowSetSizable(Window_VS, false) guiSetVisible(Window_VS, false) centerWindow(Window_VS) Grid_VS = guiCreateGridList(11, 107, 255, 225,false,Window_VS) guiGridListSetSelectionMode(Grid_VS, 1) guiGridListAddColumn(Grid_VS,"Veículo",0.29) guiGridListAddColumn(Grid_VS,"Preço",0.29) guiGridListAddColumn(Grid_VS,"Saúde",0.29) Label_VeS = guiCreateLabel(9, 25, 257, 15, "",false,Window_VS) Label_SVS = guiCreateLabel(10, 386, 257, 15, "",false,Window_VS) guiLabelSetColor(Label_VeS, 38, 122, 216) guiLabelSetColor(Label_SVS, 38, 122, 216) guiSetFont(Label_VeS, "default-bold-small") guiSetFont(Label_SVS, "default-bold-small") Button_VS_sn = guiCreateButton(10, 342, 61, 39, "Spawnar", false, Window_VS) Button_VS_dy = guiCreateButton(75, 342, 61, 39, "Destruir", false, Window_VS) Button_VS_lk = guiCreateButton(184, 54, 67, 43, "Des / Trancar", false, Window_VS) Button_VS_bp = guiCreateButton(103, 54, 67, 43, "Des / Marcar", false, Window_VS) Button_VS_Fix = guiCreateButton(205, 342, 61, 39, "Ligar Motor / Reparar", false, Window_VS) Button_VS_sl = guiCreateButton(19, 54, 67, 43, "Vender", false, Window_VS) Button_VS_Warp = guiCreateButton(141, 342, 61, 39, "Trazer", false, Window_VS) Window_CHK = guiCreateWindow(screX/2-155,screY/2-60,310,120,"ATENÇÃO",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,"Sim",false,Window_CHK) Button_CHK_N = guiCreateButton(161,73,129,36,"Não",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 = 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("F3", "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_bp) 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ê tem certeza que quer vender este veículo por R$'..carprice) 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 end end addEventHandler("onClientGUIClick", resourceRoot, WINDOW_CLICK_VEHICLE) 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 = { [1] = {ID = { {402, 150000} ,{541, 300000} ,{411, 150000} ,{516, 300000} ,{562, 200000} ,{559, 200000} ,{504, 150000} ,{415, 150000} ,{551, 250000} ,{426, 200000} ,{436, 200000} ,{547, 200000} ,{561, 180000} ,{480, 250000} ,{494, 250000} ,{581, 100000} ,{521, 100000} ,{522, 100000} ,{585, 350000} ,{466, 350000} }, vPosX = 2134, vPosY = -1170, vPosZ = 28.15, PosX = 2133, PosY = -1149, PosZ = 23.4, CamX = 2134.1, CamY = -1160, CamZ = 35, lookAtX = 2133.3, lookAtY = -1168, lookAtZ = 28}, [2] = {ID = { {402, 150000} ,{541, 300000} ,{411, 150000} ,{516, 300000} ,{562, 200000} ,{559, 200000} ,{504, 150000} ,{415, 150000} ,{551, 250000} ,{426, 200000} ,{436, 200000} ,{547, 200000} ,{561, 180000} ,{480, 250000} ,{494, 250000} ,{581, 100000} ,{521, 100000} ,{522, 100000} ,{585, 350000} ,{466, 350000} }, vPosX = 2826, vPosY = -1575.5, vPosZ = 17.4, PosX = 2806, PosY = -1563, PosZ = 10.5, CamX = 2816, CamY = -1584, CamZ = 20, lookAtX = 2826, lookAtY = -1576, lookAtZ = 17}, [3] = {ID = { {402, 150000} ,{541, 300000} ,{411, 150000} ,{516, 300000} ,{562, 200000} ,{559, 200000} ,{504, 150000} ,{415, 150000} ,{551, 250000} ,{426, 200000} ,{436, 200000} ,{547, 200000} ,{561, 180000} ,{480, 250000} ,{494, 250000} ,{581, 100000} ,{521, 100000} ,{522, 100000} ,{585, 350000} ,{466, 350000} }, vPosX = 1942.5, vPosY = 2052, vPosZ = 11, PosX = 1946, PosY = 2068, PosZ = 10, CamX = 1930.36, CamY = 2052.78, CamZ = 14.71, lookAtX = 1931.36, lookAtY = 2052.78, lookAtZ = 14.43}, [4] = {ID = { {402, 150000} ,{541, 300000} ,{411, 150000} ,{516, 300000} ,{562, 200000} ,{559, 200000} ,{504, 150000} ,{415, 150000} ,{551, 250000} ,{426, 200000} ,{436, 200000} ,{547, 200000} ,{561, 180000} ,{480, 250000} ,{494, 250000} ,{581, 100000} ,{521, 100000} ,{522, 100000} ,{585, 350000} ,{466, 350000} }, vPosX = -1950, vPosY = 266, vPosZ = 36.2, PosX = -1954, PosY = 299, PosZ = 34, CamX = -1960.18, CamY = 266.06, CamZ = 37.94, lookAtX = -1959.2, lookAtY = 266.06, lookAtZ = 37.73}, [5] = {ID = { {402, 150000} ,{541, 300000} ,{411, 150000} ,{516, 300000} ,{562, 200000} ,{559, 200000} ,{504, 150000} ,{415, 150000} ,{551, 250000} ,{426, 200000} ,{436, 200000} ,{547, 200000} ,{561, 180000} ,{480, 250000} ,{494, 250000} ,{581, 100000} ,{521, 100000} ,{522, 100000} ,{585, 350000} ,{466, 350000} }, vPosX = -1660, vPosY = 1213, vPosZ = 7, PosX = -1634, PosY = 1199, PosZ = 6, CamX = -1648.9, CamY = 1212.27, CamZ = 10.16, lookAtX = -1649.88, lookAtY = 1212.27, lookAtZ = 9.94} } VehicleShop_Window = guiCreateWindow(screX-350,screY-450, 343, 436, "Loja de Veículos", 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, "Veículos", 0.5) costColumn = guiGridListAddColumn(carGrid, "Preço", 0.4) carButton = guiCreateButton(14, 355, 86, 56,"Comprar Veículo", false, VehicleShop_Window) closeButton = guiCreateButton(237, 355, 86, 56, "Fechar Loja", false, VehicleShop_Window) carColorButton = guiCreateButton(128, 355, 86, 56,"Mudar Cor", false, VehicleShop_Window) guiSetProperty(carButton, "NormalTextColour", "FF069AF8") guiSetProperty(closeButton, "NormalTextColour", "FF069AF8") guiSetProperty(carColorButton, "NormalTextColour", "FF069AF8") 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 setElementID(ShopMarker, tostring(i)) createBlipAttachedTo(ShopMarker, 55, 2, 255, 255, 255, 255, 0, 500) 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(CarName, carName) guiSetText(CarPrice, "$"..carprice) local carID = getVehicleModelFromName(carName) if isElement(veh) then setElementModel(veh, carID) return end veh = createVehicle(carID, ShopTable[i]["vPosX"], ShopTable[i]["vPosY"], ShopTable[i]["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 = 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) 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) 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[i]["ID"]) do local carName = 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[i]["CamX"], ShopTable[i]["CamY"], ShopTable[i]["CamZ"], ShopTable[i]["lookAtX"], ShopTable[i]["lookAtY"], ShopTable[i]["lookAtZ"]) guiSetVisible(VehicleShop_Window, true) showCursor(true) guiGridListSetSelectedItem(carGrid, 0, 1) setTimer(function() setElementFrozen(localPlayer, true) local carName = guiGridListGetItemText(carGrid, 0, 1) local carID = getVehicleModelFromName(carName) local x, y, z = ShopTable[i]["vPosX"], ShopTable[i]["vPosY"], ShopTable[i]["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)
  17. Como faço uma resposta automática de bate-papo? tipo play pergunta algo e uma inicialização responde altomaticamente EX: JOGO: Como obter carro, BOOT: E então, Da / carro
  18. Oi, tudo bem ? bom achei esse script de fome da community e fiquei com uma duvida dessa parte. Como faço para tira money do jogador quando ele fome? Não sei com essa metade do codigo vc pd me ajuda (Se precisarem do codigo todo do fala) addEventHandler ("onClientMarkerHit",getRootElement(), function(hitEle,dim) if (getLocalPlayer() == hitEle) and (getElementData (source,"HAMBURGER!") == true) then if (getHungerState (hitEle) < 100) then setHungerState (hitEle,100) outputChatBox ("Você acabou com sua fome :3",255,0,255,false) else outputChatBox ("Você não está com fome!",255,0,255,false) end end end)
  19. Alguém sabe de Um Script Que os Player Sintam Fome E Sede? -estou criando um servidor to quase acabando já, mas queria deixar a sobrevivência do jogo mais HARD e gostaria de gerar essa disputa por suplementos!
  20. Can someone teach me how to do a player customization panel when starting,
  21. olá pessoal tudo bem? então hoje estou aqui para ensinar para novatos(como eu) como fazer um teleporte simples apenas usando funções básicas,é bem fácil de aprender. Antes de começar quero especificar e mostrar algumas funções que vou usar nesse script; setElementInterior coloca o elemento especificado em um interior. setElementDimension coloca o elemento especificado em uma dimenção. setElemenPosition coloca o elemento especificado em uma posição. Primeiro script,ele vai te colocar na posição quando digitar /tp. function tele (source) setElementPosition(source, 2434.6015625, -1670.6728515625, 13.574823379517) --cordenadas da posição pra onde você vai ser teletransportado. end addCommandHandler("tp",tele) Esse vai te colocar em uma dimenção e uma posição quando digitar /tp. function tele (source) setElementDimension(source, 69) --dimenção pra onde você vai ser teletransportado. setElementPosition(source, 2434.6015625, -1670.6728515625, 13.574823379517) --cordenadas da posição pra onde você vai ser teletransportado. end addCommandHandler("tp",tele) E esse vai te colocar em uma dimenção,interior e uma posição no mesmo. function tele (source) setElementDimension(source, 54) --dimenção pra onde vai. setElementInterior(source, 5) --interior pra onde vai. setElementPosition(source, 220.7998046875, 150.158203125, 1003.0234375) --posição pra onde vai dentro do interior. end addCommandHandler("tp",tele) para mais tutoriais como esse pode encontrar nesse canal do youtube(que não é meu): https://www.youtube.com/channel/UCSUVTVl3JRWwltBraVV34ow/videos
  22. Hangya

    MTA PUBG

    So hello I want to create a PUBG mod server, but I don't know how to create the gamemode. I want to create a lobby for players to play together. I also want to do the circle, you know, if you are not in the circle u will die or lost hp, i want to display it in the map, and after minutes it will be smaller and the end itt freeze. Can somebody help me?
  23. Hallo Liebe MTA Community, ich habe mir vor 3 Tagen einen Server geholt und wollte Ultimate drauf laden! Sobald es drauf war und ich /refresh eingegeben habe wurde es nicht gefunden! Ich habe es in den Resourcen Ordner getan! Bitte Hilfe - Danke!
  24. This is the code: function stimers(thePlayer) if getElementData(thePlayer,"asdasd") == true then local lejartimer1 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","10 mins!") local lejartimer2 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","9 mins!") end,60000, 1) local lejartimer3 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","8 mins!") end,120000, 1) local lejartimer4 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","7 mins!") end,180000, 1) local lejartimer5 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","6 mins!") end,240000, 1) local lejartimer6 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","5 mins!") end,300000, 1) local lejartimer7 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","4 mins!") end,360000, 1) local lejartimer8 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","3 mins") end,420000, 1) local lejartimer9 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","2 mins") end,480000, 1) local lejartimer10 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","1 mins") end,540000, 1) local lejartimer11 = setTimer(function() setElementVisibleTo(mark, thePlayer, false) setElementData(thePlayer, "asdasd", false) local pos = positions[math.random(1,#positions)] setElementPosition ( mark, pos.x,pos.y,pos.z ) end,600000, 1) end,100,1) --- elseif getElementData(thePlayer,"asdasd") == false then if isTimer ( lejartimer1 ) then killTimer ( lejartimer1 ) end if isTimer ( lejartimer2 ) then killTimer ( lejartimer2 ) end if isTimer ( lejartimer3 ) then killTimer ( lejartimer3 ) end if isTimer ( lejartimer4 ) then killTimer ( lejartimer4 ) end if isTimer ( lejartimer5 ) then killTimer ( lejartimer5 ) end if isTimer ( lejartimer6 ) then killTimer ( lejartimer6 ) end if isTimer ( lejartimer7 ) then killTimer ( lejartimer7 ) end if isTimer ( lejartimer8 ) then killTimer ( lejartimer8 ) end if isTimer ( lejartimer9 ) then killTimer ( lejartimer9 ) end if isTimer ( lejartimer10 ) then killTimer ( lejartimer10 ) end end end addEvent("ctimers",true) addEventHandler("ctimers", root,stimers) Why not working the killTimers? How to fix this?
  25. This is the code (not the full): addEvent("robbed", true ) addEventHandler("robbed", root, function () setTimer(function() addEventHandler("onClientRender",root,remainingtime); resetTimer(remainingt) end, 10000, 1) setTimer(function() removeEventHandler("onClientRender",root,remainingtime); resetTimer(remainingt) end,1800000,1) end) and when i reconnect to the server, the remainingtime dx elements are hide.. how to fix this?
×
×
  • Create New...