Jump to content

NewGamer

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by NewGamer

  1. Bem o servidor não usa freeroam é RPG
  2. Alguem pode me ajuda? O players que ta em everyone nao consegue fala do chat e eu nao sei a permissao da acl
  3. Bom desse meio tempo acabei achando um novo script de loja, estou pensando do futuro abrir um servidor RPG com algumas ideias do GTA V. Quero agrada jogadores e me agradar.
  4. 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)
  5. Obrigado! Tenho q aprender mais sobre server e cliente
  6. 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)
  7. Muito obrigado moço melhor professor .-. em breve vou posta uns script aki do forum vlw msm finalmente vou pode fazer oq eu queria
  8. Bom nao sei se fiz algo de errado ou o codigo ta meio errado num sei. Mas quando eu inicio o script a GUI ja aparece e nao era para aparecer . Edit: O erro da GUI abrir quando iniciar o script arrumei e a setar tbm so que quando eu aperto do Piloto eu vou direto para o veiculo mas eu quero passa pelo marker primeiro ai sim eu vou por veiculo. local veh = {} function takeJob( vehID ) -- quero usar o marker de la para fazer essa função if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end veh[source] = createVehicle(422,-282.26953125, 1529.451171875, 75.359375, 0, 0, 109.58242797852) warpPedIntoVehicle( source, veh[source] ) end addEvent("server:takeJob",true) addEventHandler("server:takeJob", root, takeJob)
  9. É fico muito confuso mesmo mas o importante q eu posso usa o marker do outro .lua, Obrigado pela ajuda vou esta testando se acontece algum erro q eu tive dificuldade eu venho aqui dnv
  10. Erro: WARNING: Agencia\Agencia.s.lua:19: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil] do lado Servidor function pegar (source) if isElementWithinMarker(source, Carro) then if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source) Islamico = true veh[source] = createVehicle(422,1481.083984375, -1730.6201171875, 13.3828125, 0, 0, 109.58242797852) warpPedIntoVehicle( source, veh[source] ) end end addEventHandler("onMarkerHit", source, pegar) addEvent("trabalho",true)
  11. Tudo bem? Bom não sei se to fazendo algo de errado desse script e tbm não sei se isso funciona. Eu estou tentando pegar o marker de um script.lua e levar para outro .lua exemplo crio o Marker do exemplo.lua e queria leva ele para o exemplo2.lua so que nao sei . Aqui esta o meu script de como estou fazendo Pegar o marker desse script. addEvent("opengui",true) function opengui_func() AgenciaT = guiCreateWindow(412, 90, 546, 486, "Agencia de Empregos", false) Aceitar = guiCreateButton(78, 436, 130, 27, "Aceitar", false, AgenciaT) Cancelar = guiCreateButton(348, 436, 130, 27, "Cancelar", false, AgenciaT) Lista = guiCreateGridList(53, 170, 451, 253, false, AgenciaT) guiGridListAddColumn(Lista, "Empregos", 0.3) guiGridListAddColumn(Lista, "Salários", 0.3) guiGridListAddColumn(Lista, "Cidades", 0.3) for i = 1, 2 do guiGridListAddRow(Lista) end guiGridListSetItemText(Lista, 0, 1, "Piloto", false, false) guiGridListSetItemText(Lista, 0, 2, "1500", false, false) guiGridListSetItemText(Lista, 0, 3, "Los Santos", false, false) guiGridListSetItemText(Lista, 1, 1, "Fazendeiro", false, false) guiGridListSetItemText(Lista, 1, 2, "1000", false, false) guiGridListSetItemText(Lista, 1, 3, "Los Santos", false, false) Messager = guiCreateMemo(48, 38, 451, 124, "Seja Bem Vindo a Prefeitura do Servidor, BRASIL TOP RPG para você começar a trabalhar precisa selecionar o emprego que você deseja trabalhar e apertar em Aceitar. Boa Sorte com seu novo emprego", false, AgenciaT) guiMemoSetReadOnly ( Messager, true) showCursor(true) addEventHandler("onClientGUIClick", Cancelar, function() destroyElement(AgenciaT) showCursor(false) end, false) function onGridListClick(source) local itemrow,itemcolumn = guiGridListGetSelectedItem(Lista) if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Piloto" then blip = createBlip ( 2003.5859375, -2401.1025390625, 13.546875, 42) outputDebugString("Blip visible distance: "..getBlipVisibleDistance(blip)) setBlipVisibleDistance(blip, 10000) -- Distancia Aeroporto LS outputChatBox("Local marcador vá até o [T]", source) destroyElement(AgenciaT) showCursor(false) else if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Fazendeiro" then Carro = createMarker (1482.3427734375, -1729.4150390625, 13.3828125 -1, "cylinder", 2, 255 ,0 ,0, 255) --Quero levar esse marker para outro .lua para pode spawna o veiculo triggerServerEvent(source, "trabalho", source, true) -- e aqui é quando leva para o script servidor bom nao se se é aqui o erro outputChatBox("Local marcador vá até o [T]", source) destroyElement(AgenciaT) showCursor(false) end end end end end addEventHandler("onMarkerHit",Carro,onGridListClick) -- o evento addEventHandler("onClientGUIClick", Aceitar, onGridListClick) end addEventHandler("opengui", root, opengui_func) E levar para esse script. local marker = createMarker(362.8115234375, 173.8154296875, 1008.3828125 -1, "cylinder", 1.5, 255, 0, 0) setElementInterior(marker, 3) function guioeffnen(player) triggerClientEvent(player, "opengui", player, true) end addEventHandler("onMarkerHit",marker,guioeffnen) function pegar (source) -- quero usar o marker de la para fazer essa função if isElementWithinMarker(source, Carro) then if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source) Islamico = true veh[source] = createVehicle(422,1481.083984375, -1730.6201171875, 13.3828125, 0, 0, 109.58242797852) warpPedIntoVehicle( source, veh[source] ) end addEvent("trabalho",true) end addEventHandler( "onMarkerHit",Carro, pegar )
  12. Tudo ocorrendo bem muito obrigado vocês são otimo professores.
  13. Opa obg ai por exemplo para pode criar o blip quando clica do Piloto assim ? novo ainda da area de script function onGridListClick() local itemrow,itemcolumn = guiGridListGetSelectedItem(Lista) if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Piloto" then blip 1 = createBlip end end end
  14. Poderia me passa um exemplo do GuiGridListGetSelectedItem? eu nao entendi muito bem da wiki
  15. addEvent("opengui",true) function opengui_func() AgenciaT = guiCreateWindow(412, 90, 546, 486, "Agencia de Empregos", false) Aceitar = guiCreateButton(78, 436, 130, 27, "Aceitar", false, AgenciaT) Cancelar = guiCreateButton(348, 436, 130, 27, "Cancelar", false, AgenciaT) Lista = guiCreateGridList(53, 170, 451, 253, false, AgenciaT) guiGridListAddColumn(Lista, "Empregos", 0.3) guiGridListAddColumn(Lista, "Salários", 0.3) guiGridListAddColumn(Lista, "Cidades", 0.3) guiGridListAddRow(Lista) guiGridListSetItemText(Lista, 0, 1, "Piloto", false, false) guiGridListSetItemText(Lista, 0, 2, "1500", false, false) guiGridListSetItemText(Lista, 0, 3, "Los Santos", false, false) showCursor(true) addEventHandler("onClientGUIClick", Cancelar, function() destroyElement(AgenciaT) showCursor(false) end, false) end addEventHandler("opengui", root, opengui_func)
  16. Olá tudo bem? Gostaria de saber como faço para selecionar a linha guiGridList do Piloto e depois aperta do button Aceitar e criar um blip da coord? Fico grato pela sua ajuda! addEvent("opengui",true) function opengui_func() AgenciaT = guiCreateWindow(412, 90, 546, 486, "Agencia de Empregos", false) Aceitar = guiCreateButton(78, 436, 130, 27, "Aceitar", false, AgenciaT) Cancelar = guiCreateButton(348, 436, 130, 27, "Cancelar", false, AgenciaT) Lista = guiCreateGridList(53, 170, 451, 253, false, AgenciaT) guiGridListAddColumn(Lista, "Empregos", 0.3) guiGridListAddColumn(Lista, "Salários", 0.3) guiGridListAddColumn(Lista, "Cidades", 0.3) guiGridListAddRow(Lista) guiGridListSetItemText(Lista, 0, 1, "Piloto", false, false) guiGridListSetItemText(Lista, 0, 2, "1500", false, false) guiGridListSetItemText(Lista, 0, 3, "Los Santos", false, false) showCursor(true) addEventHandler("onClientGUIClick", Cancelar, function() destroyElement(AgenciaT) showCursor(false) end, false) end addEventHandler("opengui", root, opengui_func)
  17. Olá tudo bem? Bom so novo aqui no Forum e vi que aqui vocês ajuda o pessoal como eu.Gostaria de se vocês podem me ajuda o problema é o seguinte eu estou quebrando a cabeça para sabe como chamar uma função que está em outro arquivo.lua. E também como faço para quando eu passa em cima a pé de um Marker abrir a GUI que está em outro .lua?? Fico grato por quem me ajuda
×
×
  • Create New...