Jump to content

kevincouto6

Members
  • Posts

    235
  • Joined

  • Last visited

Everything posted by kevincouto6

  1. Podem me ajudar a centralizar e fazer ficar aparecendo por 20 segundos ( e possível redimensionar para todas as resoluções ? ) function DxCompleteMissons() dxDrawRectangle(0, 305, 1360, 162, tocolor(0, 0, 0, 239), false) dxDrawText(" Mission Complete !", 209, 319, 1151, 467, tocolor(254, 5, 5, 254), 5.00, "beckett", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, DxCompleteMissons ) Acho q para desativar apos 20 segundos devo usar um remove eventhandler com SetTimer porem não tenho certeza mas não sei como centralizar na tela tipo COM A MESMA DISTANCIA AQUI Mission complete COM A MESMA DISTANCIA AQUI TMB
  2. obg, consegui resolver, o dono do servidor me mostrou uma coisa q eu não sabia a função "Executor" verificava quem matou o boss, então eu usei ess verificação if ( Executor ) then ativavo o trigger event ai funcionou individualmente, obg a todos
  3. Sabe me dizer como faxer para funcionar apenas para um jogador, tipo devo fazer uma verificação ou que?
  4. Eu ja tinha feito assim porem n funciona, ele funciona para todos n apena para o q esta em missão , acho q vou ter q fazer uma verificação de nick com getPlayerName porem n sei como fazer, function started9 ( ) outputChatBox ( "funcionou2", client ) function bossKilled(zone, bossColor, liberators, executor) if ( client ) then outputChatBox ( "Boss DeaD", client ) triggerClientEvent ( client, "bossPointClient", client ) else outputChatBox("failed") end end addCommandHandler ("go", bossKilled) --addEventHandler ("zm_onZoneLiberated", getRootElement(), bossKilled) end addEvent( "inicio9", true ) addEventHandler( "inicio9", getRootElement(), started9 )
  5. Foi feito no lado server mostrei apenas a parte q modifiquei, eaqueci de avisar
  6. function started9 ( localPlayer ) local client = localPlayer if ( client ) then outputChatBox ( "funcionou2", client ) function bossKilled(zone, bossColor, liberators, executor) if ( client ) then outputChatBox ( "Boss DeaD", client ) triggerClientEvent ( client, "bossPointClient", client ) else outputChatBox("failed") end end addCommandHandler ("go", bossKilled) --addEventHandler ("zm_onZoneLiberated", getRootElement(), bossKilled) end end addEvent( "inicio9", true ) addEventHandler( "inicio9", getRootElement(), started9 ) Eu usei o comando /go para não ter que matar um boss toda hora apenas para test, então modificando do jeito que voçê falou continuo não funcionando, sem nenhum erro, ou seja funcionava para todos, então pensei em ativar o commando apenas para o "client" mas não funcionou, mesmo assim ativa va o comando para todos, preciso de uma forma de individualizar pensei em getPlayerName ou algo do tipo mas não sei como usar para vefiricar individualmente
  7. Vms lá Não aparece nenhum erro, atualmente não tem erros. usei apenas para verificar se estava funcionando, esqueci de remover. ( Sim esta funcionando ) XD ( zm_onZoneLiberated ) existem zonas no servidor onde e possivel Criar Bosses, quando um Boss é morto por alguma player o evento ( zm_onZoneLiberated ) e detectado se ativado tipo : addEventHandler ("zm_onZoneLiberated", getRootElement(), bossKilled), Quando um Boss morrer se o eventHanddler estiver ativado vai detectar e ativar a função ("bossKilled") espero q possa me entender, sou ruim com palavras XD Bom, o que preciso fazer e ativar o EventHandler para um pessoas apenas, porem não sei como fazer no lado server, if thePlayer then vai verificar todos players, sabe como fazer para tudo funcionar individualmente ?
  8. server-side function started9 ( thePlayer ) outputChatBox ( "funcionou2", thePlayer ) function bossKilled(zone, bossColor, liberators, executor) if ( thePlayer ) then outputChatBox ( "Boss DeaD", thePlayer ) triggerClientEvent ( thePlayer, "bossPointClient", thePlayer ) else outputChatBox("failed") end end addEventHandler ("zm_onZoneLiberated", getRootElement(), bossKilled) end addEvent( "inicio9", true ) addEventHandler( "inicio9", getRootElement(), started9 ) function destroyServerObjects9 () removeEventHandler ("zm_onZoneLiberated", getRootElement(), bossKilled) end addEvent( "destroyElements9", true ) addEventHandler( "destroyElements9", getRootElement(), destroyServerObjects9) function completMission9 ( thePlayer ) givePlayerMoney ( thePlayer, 25000 ) end addEvent ("completMission9", true) addEventHandler ("completMission9", getRootElement(), completMission9) client-side bossPoint = 0 function inicio9 () triggerServerEvent ("inicio9", localPlayer, localPlayer) function dxText8() dxDrawText("Boss Killed : "..(bossPoint).."/1", 355, 0, 817, 87, tocolor(0, 0, 0, 255), 2.00, "default-bold", "left", "top", false, false, false, false, false) end addEventHandler ( "onClientRender",getRootElement(), dxText8 ) end function bossMission9 ( ) if localPlayer then bossPoint = bossPoint+1 outputChatBox ( ""..bossPoint .."" ) if bossPoint >= 5 then outputChatBox("Missão completada") bossPoint = 0 failedMission9 () triggerServerEvent ("completMission9", localPlayer, localPlayer) end end end addEvent( "bossPointClient", true ) addEventHandler( "bossPointClient", localPlayer, bossMission9 ) function failedMission9 () triggerServerEvent ("destroyElements9", localPlayer, localPlayer) bossPoint = 0 removeEventHandler ( "onClientRender",getRootElement(), dxText8 ) completMission() end Aki estou desenvolvendo um script para matar boss que esta no servido esta é uma função que existe no servidor "zm_onZoneLiberated", queria fazer individualmente tudo, porem não funciona no lado client, apenas no server, porem não sei como ativar a função apenas para o jogador da missão e completar a missão apenas no jogador da missão, para completar eu uso um "triggerClientEvent" que ativa uma função no lado cliente, onde soma os points o que preciso fazer e não sei como Ativar o evento "zm_onZoneLiberated" apenas para o jogador que iniciou a missão verificar se quem matou o boss, é o player que iniciou a missão OBS: a função é iniciado por um GuiWindon onde ativa inicia9 () poderiam me ajudar
  9. addEventHandler ("onClientGUIClick", resourceRoot, function (button, state, absoluteX, absoluteY) if (elementos.btns[source]) then if (elementos.btns[source][2] == "copy") then setClipboard(guiGetText(wordsCopy)) end end end) OBS: o script é o memo que esta acima, por isso não postei todo novamente, lado CLIENT ! desculpe reviver este topic, porem estou com uma dificuldade, tipo setClipBoard estou tentando faze-lo no botão COPY, porem só copia o ultimo { titulo = "Mission Description", memo = "KEVIN" } Tipo so COPIA o "KEVIN" , como fasso pra ele copiar da guiMemo que tiver aberta, tipo aperto info e abre conforme a lista, porem quando copio copia apenas o do ultimo da lista, sabe me dizer como resolver ? eu renomei o guiCreateMemo, para wordsCopy mas não sei como add um verificação ou algo do tipo para copiar o memo que foi selecionado da lista addEventHandler("onClientResourceStart", resourceRoot, function() for i,janela in ipairs(janelas) do wnd = guiCreateWindow(598, 161, 202, 329, janela.titulo, false) elementos.window[wnd] = i-1 guiSetVisible (wnd, false) guiWindowSetSizable(wnd, false) wordsCopy = guiCreateMemo(9, 32, 175, 196, janela.memo, false, wnd) btnExit = guiCreateButton(10, 280, 174, 40, "EXIT", false, wnd) btnCopy = guiCreateButton(9, 233, 175, 37, "COPY", false, wnd) elementos.btns[btnExit] = {wnd,"exit"} elementos.btns[btnCopy] = {wnd,"copy"} end end ) espero que consigam me entender, desde ja obrigado, e desculpem por reviver esse topic, achei melhor aki do que criar outro
  10. funcionou, Vlw ae manin (espera para de incomodar agr ) vlw mesmo
  11. destruir é melhor assim ele tera que refazer tudo denovo, porem não tenho a minima idea de como destruir, quando o player se desconnectar
  12. Desculpe voltar, mas não sei o que fazer estava fazendo os detalhes finais e me deparei com um problema " onClientPlayerQuit " " onPlayerQuit " como fazer com que as plantas sejam destruidas, não e possivel verificar se as tabelas e o player quando ele se desconnect então sabem como posso fazer ?
  13. Continua o mesmo erro, esse erro so acontece quando tem dois fazendo ao mesmo tempo, plantei 1 planto o outro jogador vai la e planta 2 e completa quando eu plantar a segunda para completar não vai funcionar vai aparecer o erro GUImission/server.lua:181: Bad argument @ 'destroyElement' [Expected element at argument 1, got nill] aparace conforme a quantidade de plantas que não foi destuida
  14. OKay funcionou obrigado, porem o outro poblema e assim player 1 plantou 1 planta player 2 plantou 2 plantas e completou, as plantas dele foram destruidos tudo coretamente, player1 apos o player 2 completar , player1 plantou e quando chegou na contidade total de 2, foi completar nãa destruiu todos. espera que consiga me entender. No debug aparece esse erro GUImission/server.lua:176: Bad argument @ 'destroyElement' [Expected element at argument 1, got nill]
  15. gui_Windon_Mission.lua ( client-side ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------Panel Gui Missions-------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function () WinMission = guiCreateWindow(374, 156, 594, 329, "Mission ZHP", false) guiSetVisible (WinMission, false ) guiWindowSetSizable(WinMission, false) accepted = guiCreateButton(12, 236, 180, 34, "ACCEPTED", false, WinMission) info = guiCreateButton(207, 236, 180, 34, "INFO", false, WinMission) abandon = guiCreateButton(397, 236, 180, 34, "ABANDON", false, WinMission) ListMissions = guiCreateGridList(12, 36, 565, 190, false, WinMission) guiGridListSetSortingEnabled ( ListMissions, false ) guiGridListAddColumn(ListMissions, "MISSION", 0.9) for i = 1, 11 do guinumeber = guiGridListAddRow(ListMissions) end guiGridListSetItemText(ListMissions, 0, 1, "Mission Plants", false, false) guiGridListSetItemText(ListMissions, 1, 1, "-", false, false) guiGridListSetItemText(ListMissions, 2, 1, "-", false, false) guiGridListSetItemText(ListMissions, 3, 1, "-", false, false) guiGridListSetItemText(ListMissions, 4, 1, "-", false, false) guiGridListSetItemText(ListMissions, 5, 1, "-", false, false) guiGridListSetItemText(ListMissions, 6, 1, "-", false, false) guiGridListSetItemText(ListMissions, 7, 1, "-", false, false) guiGridListSetItemText(ListMissions, 8, 1, "-", false, false) guiGridListSetItemText(ListMissions, 9, 1, "-", false, false) guiGridListSetItemText(ListMissions, 10, 1, "-", false, false) Buttonexit = guiCreateButton(10, 276, 567, 43, "EXIT", false, WinMission) end ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------Memo info Mission-------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local janelas = { { titulo = "Mission Description", memo = "You must kill 50 zombies in area 51\n\n \n Reward\nMoney: R$ 5,000.00 \nEXP : 3555 " } } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------Info Missios-------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local elementos = { window = {}, btns = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() for i,janela in ipairs(janelas) do wnd = guiCreateWindow(939, 156, 196, 329, janela.titulo, false) elementos.window[wnd] = i-1 guiSetVisible (wnd, false) guiWindowSetSizable(wnd, false) guiCreateMemo(9, 32, 175, 196, janela.memo, false, wnd) btnExit = guiCreateButton(10, 280, 174, 40, "EXIT", false, wnd) btnCopy = guiCreateButton(9, 233, 175, 37, "COPY", false, wnd) elementos.btns[btnExit] = {wnd,"exit"} elementos.btns[btnCopy] = {wnd,"copy"} end end ) addEventHandler ("onClientGUIClick", resourceRoot, function (button, state, absoluteX, absoluteY) if (elementos.btns[source]) then if (elementos.btns[source][2] == "exit") then guiSetVisible (elementos.btns[source][1], false) end end end) addEventHandler ("onClientGUIClick", resourceRoot, function (button, state, absoluteX, absoluteY) if (source == info) then for wnd, id in pairs(elementos.window) do if (id == guiGridListGetSelectedItem(ListMissions)) then guiSetVisible (wnd, true) else guiSetVisible (wnd, false) end end end end) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------Local Marker points-------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --if you want add Marker# {}, Mark = { {225.38281, 1905.20300, 17.64063}, } --Marker local Marker1 = createMarker(225.38281, 1905.20300, 17.64063, "cylinder", 1.5, 250,250,0) for k,v in ipairs (Mark) do z = v[3] -1 Marker = createMarker ( v[1], v[2], z, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible (WinMission, true ) showCursor( true ) end end ) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------Accepted Mission-------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) outputDebugString("onClientGUIClick called.") local me = not guiGetVisible (WinMission) if (source == accepted) then outputDebugString("guiGridListGetSelectedItem(ListMissions): "..guiGridListGetSelectedItem(ListMissions)) if (guiGridListGetSelectedItem(ListMissions) == 0) then outputDebugString("1 was selected") inicio8 () guiSetVisible (WinMission, me) showCursor (me) end end end ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------Button EXIT -------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (source == Buttonexit) then guiSetVisible (WinMission, false) for wnd, id in pairs(elementos.window) do guiSetVisible (wnd, false) end showCursor (false) end end) client_mission.lua ( client-side ) plantsPoints = 0 function inicio8 ( ) local retanguloParaPlantio = createColRectangle ( 209.52605, 1906.70947, 155, 155 ) hillRadar = createRadarArea ( 209.52605, 1906.70947, 155, 155, 0, 255, 0, 175 ) addEventHandler("onClientColShapeHit", retanguloParaPlantio, function ( theElement, matchingDimension ) if ( theElement == localPlayer ) then function plant () local block, anim = getPedAnimation( localPlayer ) if ( not( block == "medic" and anim == "CPR" ) ) then local x, y, z = getElementPosition ( localPlayer ) triggerServerEvent ("iniciaJob8", localPlayer, localPlayer, x, y, z ) setTimer(function() plantsPoints = plantsPoints+1 outputChatBox( "Foi plantado "..(plantsPoints).."/2" ) if plantsPoints >= 2 then triggerServerEvent ( "onDestroyElement", localPlayer, localPlayer ) outputChatBox ("voçê plantou todos") plantsPoints = 0 destroyElement ( hillRadar ) end end, 6500, 1) else outputChatBox (" voçê deve esperar 6 sec para plantar novamente " ) end end addCommandHandler ( "d", plant ) end end ) addEventHandler("onClientColShapeLeave", retanguloParaPlantio, function ( theElement, matchingDimension ) if ( theElement == localPlayer ) then outputChatBox( "nop Function." ) removeCommandHandler ( "d", plant ) end end ) end server_mission.lua ( server-side ) local plant = {} local plants1 = {} local indexPl = {} function iniciarFarm8 ( client, x, y, z ) if not indexPl[client] then indexPl[client] = 1 indexPl[client] = indexPl[client] + 1 plant[client][indexPl[client]] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) if plant[thePlayer][indexPl[thePlayer]] and isElement(plant[thePlayer][indexPl[thePlayer]]) and getElementModel( plant[thePlayer][indexPl[thePlayer]] ) == 862 then destroyElement ( plant[thePlayer][indexPl[thePlayer]] ) end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) meta.xml <meta> <script src="gui_Windon_Mission.lua" type="client"/> <script src="client_mission.lua" type="client" /> <script src="server_mission.lua" type="server" /> </meta> aki esta todo o script @DNL291 e @zMpyster
  16. N mostra erro os q aparece eu resolvo porem não remove todos, e não especifica o jogador
  17. Acabei de faze-lo criei o objeto como plant não funcionou então tentei destruir if plants[thePlayer][indexPl[thePlayer]] e ainda não funcionou, mds estou ficando louco, hheheh,
  18. server-side local plants = {} function iniciarFarm8 ( x, y, z ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) setTimer(function() plants[client] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) end, 6500, 1) end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) for id, plant in ipairs(getElementsByType("object")) do if getElementModel( plant ) == 862 then destroyElement ( plant ) end end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) plantDestroy can someone help me, I can destroy all the plants, but I can not seperar the players to destroy, example if you have 2 doing at the same time will destroy the plant of the two players, I need to destroy only the plants of the players who completed the mission, then as fasso to specify the destruction only of the plants of a player ? and srry double post
  19. Ainda não funciona e remove apenas a ultima planta
  20. Aki esta os dois lados guiWindonClient.lua ( client - side ) a parte que inicia8 é esta, botei apenas um pedaço elseif (guiGridListGetSelectedItem(ListMissions) == 2) then outputDebugString("2 was selected") inicio8 () guiSetVisible (WinMission, me) showCursor (me) for wnd, id in pairs(elementos.window) do guiSetVisible (wnd, false) end Client-side plantsPoints = 0 function inicio8 ( ) local retanguloParaPlantio = createColRectangle ( 209.52605, 1906.70947, 155, 155 ) hillRadar = createRadarArea ( 209.52605, 1906.70947, 155, 155, 0, 255, 0, 175 ) addEventHandler("onClientColShapeHit", retanguloParaPlantio, function ( theElement, matchingDimension ) if ( theElement == localPlayer ) then function plant ( thePlayer ) local block, anim = getPedAnimation( localPlayer ) if ( not( block == "medic" and anim == "CPR" ) ) then if ( thePlayer ) then local x, y, z = getElementPosition ( localPlayer ) triggerServerEvent ("iniciaJob8", localPlayer, x, y, z ) --setTimer(function() plantsPoints = plantsPoints+1 outputChatBox( "Foi plantado "..(plantsPoints).."/2" ) if plantsPoints >= 2 then if ( thePlayer ) then if plantsPoints >= 2 then outputChatBox ("voçê plantou todos") plantsPoints = 0 destroyElement ( hillRadar ) triggerServerEvent ( "onDestroyElement", localPlayer ) end end end --end, 6500, 1) end else outputChatBox (" voçê deve esperar 6 sec para plantar novamente " ) end end addCommandHandler ( "d", plant ) end end ) addEventHandler("onClientColShapeLeave", retanguloParaPlantio, function ( theElement, matchingDimension ) if ( theElement == localPlayer ) then outputChatBox( "nop Function." ) removeCommandHandler ( "d", plant ) end end ) end Server-side local plants = {} local plants1 = {} local indexPl = {} function iniciarFarm8 ( client, x, y, z ) if not indexPl[client] then indexPl[client] = 1 indexPl[client] = indexPl[client] + 1 plants[client][indexPl[client]] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) setElementData( client, "Trabalho8", true, false ) animation = setPedAnimation(source, "medic", "CPR", -1, false, false, false, false) end end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) if plant[thePlayer][indexPl[thePlayer]] and isElement(plant[thePlayer][indexPl[thePlayer]]) and getElementModel( plant[thePlayer][indexPl[thePlayer]] ) == 862 then destroyElement ( plant[thePlayer][indexPl[thePlayer]] ) end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy)
  21. Não funcionou, omg eu estou ficando louco XD * primeiro ele não encontra o valor X *então removi o Cliente de (client, x, y,z ) * ai fica dizendo ( attemple to index field '?' (a nil value ) mas não vou desistir tem alguma ideia do que fazer ?
  22. será que esta é a unica fora, tipo a missão vai ser plantar +-- 50 plantas, vou ter que criar para as 50, ou será que tem outra forma, estou usando 2 apenas para test
  23. local plant = {} function iniciarFarm8 ( x, y, z ) setElementData( client, "Trabalho8", true, false ) plant[client] = createObject ( 862, x , y , z - 1 , 0, 0, 0 ) end addEvent ("iniciaJob8", true) addEventHandler ("iniciaJob8", getRootElement(), iniciarFarm8) function plantDestroy ( thePlayer ) local thePlayer = client if plant[thePlayer] and isElement(plant[thePlayer]) and getElementModel( plant[thePlayer] ) == 862 then for thePlayer, plant in ipairs(getElementsByType("object")) do destroyElement ( plant ) end end end addEvent ("onDestroyElement", true) addEventHandler ("onDestroyElement", getRootElement(), plantDestroy) Estou usando desta forma, assim posso criar varias, e remover todos porem remove a dos outros jogadores tambem, preciso que seja removido apenas a minha
×
×
  • Create New...