-
Posts
137 -
Joined
-
Last visited
Everything posted by +[T]rakin
-
Disso sei já, eu estou querendo sabe para não passa dos 10KG tipo tenho 9KG usado e compro um item de 3 KG ai meio que não deixaria eu compra pq senao ia passa dos 10KG
-
Opa Boa Madrugada rsrs, To querendo fazer um inventario com Peso so que estou em duvida sobre um negocio tipo um item (X) pesa 5 KG e no meu inventario ta sendo usado 8KG de 10KG(Limite) como seria uma verificação dizendo que nao pode está comprando/adicionando esse item de 5KG pq o inventario ta quase passando no limite? Obs: Ainda não fiz o código no inv..
-
Opa mano muito obrgado eu ia vim aqui para fala que consegui e é dessa forma que consegui mesmo , bom não foi eu e sim uns scripters que me ajudaram também. Muito obrigado mesmo por ter tirando uns minutos do seu tempo para me ajuda
-
Ok ai agora tenho que fazer a verificação? trailers = { createVehicle (422, -710.332, 964.509, 12.405), createVehicle (422, -714.95, 954.419, 12.234), } function Trailers_Spawn(thePlayer) if trailers[1] then outputChatBox("TESTE", thePlayer, 255, 255, 255, true) end end addEventHandler("onVehicleStartEnter", root, Trailers_Spawn) Obs: Estou usando carro so para ser um pouco rapido
-
Mals pela demora tava vendo se eu encontrava algum script perdido para estuda so que nada. Seguinte eu fiz isso so que não tenho certeza se está certo trailers = { createVehicle (422, 631.21447753906, 809.82647705078,- 42.9609375), createVehicle (422, 640.05676269531, 810.14611816406, -42.9609375), } Veh_Trailers = {} function Trailers_Spawn(thePlayer) for i, v in ipairs ( trailers ) do Veh_Trailers[thePlayer] = createVehicle ( v[1], v[2], v[3], v[4]) end end addEventHandler("onResourceStart", root, Trailers_Spawn)
-
Quando você falou verificar o ID seria isso né? local trailers = { [1] = }, [2] = }, } Porque todos os trailers vão ter o mesmo modelID e a parte da verificação não entendi muito
-
Sim , então como faço para cada trailers ter sua própria função? usando a tabela
-
Boa Tarde estou querendo criar um Job de Caminhoneiro só que diferente tipo seria vários trailers no mapa e cada um tem função. Ai tudo bem so que não tenho uma base para está começando o código , tabela sei criar + ou - em relação de markers e objects agora de vehicles não.
-
mvan = createMarker(100, 100, 100, "cylinder", 1, 255,100,100, 70) Tenta assim, ja fiz isso varias vezes e sempre funciona e também deixa o tamanho do Marker para 1.8
-
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
Opa desculpa pela demora acabei de chegar da escola. Sobre o codigo funcionou perfeitamente so tenho que ver sobre o dxmessages do client mas tirando isso tudo corretamente Obrigado pela ajuda vou está estudando algumas linhas que não entendi muito. -
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
Testei aqui com um amigo tipo nenhum erro no debug, so que quando meu amigo pega a primeira Planta e eu se tiver no trab tbm ela some para mim e não da para fazer o trab -
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
Tentando eu to so que nao consigo aprender pelo wiki as vezes consigo. local Marker_Start = createMarker (-122.4150390625, 43.732421875, 3.1171875 -1, "cylinder", 2, 20, 70, 230, 80) local Blip_Start = createBlipAttachedTo(Marker_Start, 42) local Plantas = { [1] = {-129.10345458984,44.776748657227,3.1171875}, [2] = {-140.21569824219,35.499088287354,3.1171875}, [3] = {-138.20004272461,22.663047790527,3.1171875}, [4] = {-148.60707092285,14.514667510986,3.1171875}, [5] = {-145.90365600586,3.4965758323669,3.1171875}, [6] = {-156.54542541504,-6.012909412384,3.1171875}, [7] = {-154.13597106934,-17.593681335449,3.1171875}, [8] = {-164.40188598633,-27.394626617432,3.1171875}, [9] = {-162.29643249512,-39.118156433105,3.1171875}, [10] = {-171.7504119873,-45.86404800415,3.1171875}, } local Coronas_Plantas = {} local Obj_Plantas = {} function jobStart(theJogador) if getElementType(theJogador) == "player" then if not getPedOccupiedVehicle(theJogador) and not Coronas_Plantas[theJogador] then local x, y, z = unpack (Plantas[1]) Coronas_Plantas[theJogador] = createMarker (x, y, z -1, "corona", 2, 0, 255, 0, 80, theJogador) setElementData (Coronas_Plantas[theJogador], "DnO_Coronas", theJogador) setElementData (Coronas_Plantas[theJogador], "Plantas", 1) Obj_Plantas[theJogador] = createObject(804, x, y, z) setElementData(Obj_Plantas[theJogador], "DnO_Obj", theJogador) setObjectScale(Obj_Plantas[theJogador], 1.0) setElementCollisionsEnabled (Obj_Plantas[theJogador], false) addEventHandler ("onClientMarkerHit", Coronas_Plantas[theJogador], Hit_Coronas) end end end addEventHandler ("onClientMarkerHit", Marker_Start, jobStart) function Hit_Coronas(thePlayer) if (thePlayer == getElementData (source, "DnO_Coronas")) then if (getElementData (source, "Plantas") < #Plantas) then setElementData (source, "Plantas", getElementData (source, "Plantas") + 1) local x, y, z = unpack(Plantas[getElementData(source, "Plantas")]) setElementPosition(source, x, y, z -1) setElementPosition(Obj_Plantas[thePlayer], x, y, z) else removeEventHandler ("onClientMarkerHit", Coronas_Plantas[thePlayer], Hit_Coronas) end end endlocal Marker_Start = createMarker (-122.4150390625, 43.732421875, 3.1171875 -1, "cylinder", 2, 20, 70, 230, 80) local Blip_Start = createBlipAttachedTo(Marker_Start, 42) local Plantas = { [1] = {-129.10345458984,44.776748657227,3.1171875}, [2] = {-140.21569824219,35.499088287354,3.1171875}, [3] = {-138.20004272461,22.663047790527,3.1171875}, [4] = {-148.60707092285,14.514667510986,3.1171875}, [5] = {-145.90365600586,3.4965758323669,3.1171875}, [6] = {-156.54542541504,-6.012909412384,3.1171875}, [7] = {-154.13597106934,-17.593681335449,3.1171875}, [8] = {-164.40188598633,-27.394626617432,3.1171875}, [9] = {-162.29643249512,-39.118156433105,3.1171875}, [10] = {-171.7504119873,-45.86404800415,3.1171875}, } local Coronas_Plantas = {} local Obj_Plantas = {} function jobStart(theJogador) if getElementType(theJogador) == "player" then if not getPedOccupiedVehicle(theJogador) and not Coronas_Plantas[theJogador] then local x, y, z = unpack (Plantas[1]) Coronas_Plantas[theJogador] = createMarker (x, y, z -1, "corona", 2, 0, 255, 0, 80, theJogador) setElementData (Coronas_Plantas[theJogador], "DnO_Coronas", theJogador) setElementData (Coronas_Plantas[theJogador], "Plantas", 1) Obj_Plantas[theJogador] = createObject(804, x, y, z) setElementData(Obj_Plantas[theJogador], "DnO_Obj", theJogador) setObjectScale(Obj_Plantas[theJogador], 1.0) setElementCollisionsEnabled (Obj_Plantas[theJogador], false) addEventHandler ("onClientMarkerHit", Coronas_Plantas[theJogador], Hit_Coronas) end end end addEventHandler ("onClientMarkerHit", Marker_Start, jobStart) function Hit_Coronas(thePlayer) if (thePlayer == getElementData (source, "DnO_Coronas")) then if (getElementData (source, "Plantas") < #Plantas) then setElementData (source, "Plantas", getElementData (source, "Plantas") + 1) local x, y, z = unpack(Plantas[getElementData(source, "Plantas")]) setElementPosition(source, x, y, z -1) setElementPosition(Obj_Plantas[thePlayer], x, y, z) else removeEventHandler ("onClientMarkerHit", Coronas_Plantas[thePlayer], Hit_Coronas) end end end Essa parte refiz no client-side mas ainda o objeto aparece para outro jogador não sei quais partes eu errei. Obs:Nenhum erro no debug -
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
É possivel eu está levando o codigo para client-side sem muda muita coisa?? -
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
Ah beleza você poderia falar as funções com exemplos para eu tenta entende o lado client-side para mim tenta se consigo passar o script. Se eu achasse algum script br assim mas lado client-side eu ate estuda ele mas não acho -
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
local Marker_Start = createMarker (-111.1279296875, -4.025390625, 3.1171875 -1, "cylinder", 1.5, 20, 70, 230, 80 ) Blip_Start = createBlipAttachedTo(Marker_Start, 42) Plantas = { [1] = {-129.10345458984,44.776748657227,3.1171875}, [2] = {-140.21569824219,35.499088287354,3.1171875}, [3] = {-138.20004272461,22.663047790527,3.1171875}, [4] = {-148.60707092285,14.514667510986,3.1171875}, [5] = {-145.90365600586,3.4965758323669,3.1171875}, [6] = {-156.54542541504,-6.012909412384,3.1171875}, [7] = {-154.13597106934,-17.593681335449,3.1171875}, [8] = {-164.40188598633,-27.394626617432,3.1171875}, [9] = {-162.29643249512,-39.118156433105,3.1171875}, [10] = {-171.7504119873,-45.86404800415,3.1171875}, } local Veh_Trator = {} local Coronas_Plantas = {} local Obj_Plantas = {} local Letra = "K" function jobStart(theJogador) if getElementType(theJogador) == "player" then if not getPedOccupiedVehicle(theJogador) and not Coronas_Plantas[theJogador] then exports.Scripts_OnMarkerMsgs_:delete(theJogador) jobStop() local x, y, z = unpack (Plantas[1]) Coronas_Plantas[theJogador] = createMarker (x, y, z -1, "corona", 2, 0, 255, 0, 80, theJogador) setElementData (Coronas_Plantas[theJogador], "DnO_Coronas", theJogador) setElementData (Coronas_Plantas[theJogador], "Plantas", 1) Obj_Plantas[theJogador] = createObject(804, x, y, z) setElementData(Obj_Plantas[theJogador], "DnO_Obj", theJogador) setObjectScale(Obj_Plantas[theJogador], 1.0) setElementCollisionsEnabled (Obj_Plantas[theJogador], false) setPedSkin(theJogador, 158) Veh_Trator[theJogador] = createVehicle(531, -123.7235625, 64.36328125, 3.3815598964391, 0, 0, 156) setElementData(Veh_Trator[theJogador], "DnO_Trator", theJogador) warpPedIntoVehicle( theJogador, Veh_Trator[theJogador]) exports.Scripts_Dxmessages:outputDx (theJogador,"Colher todas as Plantas!!", "info") addEventHandler ("onMarkerHit", Coronas_Plantas[theJogador], Hit_Coronas) end end end function emarker(marker,md) if (md) then if isPedInVehicle ( source ) then return end if marker == Marker_Start then if getElementData ( source, "Emprego" ) == "Fazendeiro" then exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para se Demitir do Emprego de Fazendeiro") bindKey ( source, Letra, "down", jobStop ) else exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para Aceitar o Emprego de Fazendeiro") bindKey ( source, Letra, "down", jobStart ) end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),emarker) function emarker2(marker,md) if (md) then if isPedInVehicle ( source ) then return end if marker == Marker_Start then exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, Letra, "down", jobStart ) unbindKey ( source, Letra, "down", jobStop ) end end end addEventHandler("onPlayerMarkerLeave",getRootElement(),emarker2) function Hit_Coronas(thePlayer) if (thePlayer == getElementData (source, "DnO_Coronas")) then if isPedInVehicle ( thePlayer ) then if (getElementData (source, "Plantas") < #Plantas) then exports.Scripts_Dxmessages:outputDx(thePlayer, "Você colheu a Planta. Siga para a próxima.("..getElementData(source, "Plantas").."/"..#Plantas..")", "success") setElementData (source, "Plantas", getElementData (source, "Plantas") + 1) local x, y, z = unpack(Plantas[getElementData(source, "Plantas")]) setElementPosition(source, x, y, z -1) setElementPosition(Obj_Plantas[thePlayer], x, y, z) else removeEventHandler ("onMarkerHit", Coronas_Plantas[thePlayer], Hit_Coronas) if isElement(Veh_Trator[thePlayer]) then destroyElement(Veh_Trator[thePlayer]) end if isElement(Coronas_Plantas[thePlayer]) then destroyElement(Coronas_Plantas[thePlayer]) end if isElement(Obj_Plantas[thePlayer]) then destroyElement(Obj_Plantas[thePlayer]) end exports.Scripts_Dxmessages:outputDx (thePlayer,"Você terminou de Colher Todas as Plantas bom Trabalho!!", "success") end end end end function jobStop(source) if isElement(Veh_Trator[source]) then destroyElement(Veh_Trator[source]) end if isElement(Coronas_Plantas[source]) then destroyElement(Coronas_Plantas[source]) end if isElement(Obj_Plantas[source]) then destroyElement(Obj_Plantas[source]) end end function resourceStartNotify ( resourcename ) if ( resourcename == getThisResource() ) then outputDebugString ( "Script " .. getResourceName(resourcename) .. " carregado." ) end end addEventHandler( "onResourceStart", getRootElement(), resourceStartNotify ) -
[DUVIDA]] Objeto invisivel para outro jogador
+[T]rakin replied to +[T]rakin's topic in Programação em Lua
Ja tentei com o setElementVisibleTo e deu em nada. Bom o ruim que eu fiz o script todo em server-side e acho que vai ser complicado para mim passa para o client-side porque não sei mexer muito pelo esse lado. -
Boa Tarde, gostaria de sabe ser é possivel colocar um objeto invisivel para outro jogador.
-
Assim thanks sobre o client-side eu não uso muito porque não sei fazer um codigo que funcione bem. Já tentei ver em outros scripts mas nunca achei e muito complicado para eu está entendo o client eu mesmo so uso para fazr paineis.
-
O Script é um emprego de carregador que você tem que pegar a caixa com a empilhadeira e leva ate o caminhão. O loop das "posicoes_caixas" é as caixas que é criada após o script iniciar, digamos que vai mostrar a onde o jogador deve para pegar a caixa. Sim estou referindo ao object da variável caixa.
-
Boa Noite estou tentando fazer uma verificação que o objeto(caixa) após ele encosta no marker vai destruir ele. So que não estou conseguindo verificar ser realmente a caixa encostou no marker server-side function Job_Iniciar(thePlayer) for i, posicoescaixas in ipairs (posicoes_caixas) do if isElement(posicoescaixas) then destroyElement (posicoescaixas) posicoescaixas = nil end end posicoes_caixas = { createObject (1221, 2785.559, -2408.001, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 1.2, -2408.001, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 2.4, -2408.001, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 3.6, -2408.001, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 4.8, -2408.001, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559, -2408.001 - 20, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 1.2, -2408.001 - 20, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 2.4, -2408.001 - 20, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 3.6, -2408.001 - 20, 13.634 -0.4, 0, 0, 180), createObject (1221, 2785.559 + 4.8, -2408.001 - 20, 13.634 -0.4, 0, 0, 180), } if isElement(Caminhao[thePlayer]) and isElement(Empilhadeira[thePlayer]) then destroyElement(Caminhao[thePlayer]) destroyElement(Empilhadeira[thePlayer]) Empilhadeira[thePlayer] = nil Caminhao[thePlayer] = nil end caixa = createObject (1221, 2785.559, -2408.001, 13.634 -0.1, 0, 0, 180) Empilhadeira[thePlayer] = createVehicle(530, 2775.257, -2403.802, 13.792, 0.994, 0.046, 1.751) attachElements( caixa, Empilhadeira[thePlayer], 0, 0.6, 0.4) Caminhao[thePlayer] = createVehicle(456, 2768.087, -2418.615, 14.032, 0.224, -0.256, 98.052) Marker_Descarregar = createMarker (2773.011, -2417.931, 13.657 -1, "cylinder", 1.9, 20, 70, 230, 180) addEventHandler("onMarkerHit", Marker_Descarregar, Job_Descarregar) end addEventHandler("onMarkerHit", Job_Marker, Job_Iniciar) function Job_Descarregar(source) if getElementType(source) == "object" then outputChatBox("Teste", source, 255, 255, 255, true) end end
-
Dessa funciono perfeito Thanks
-
Vou criar outro arquivo .lua e refazer o código todo ou fazer um teste com uma função separada
-
http://prntscr.com/ne8n6f
-
Desculpa pela demora. Testei aqui e aparecendo isso http://prntscr.com/ne6eog