Jump to content

WeeD1

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by WeeD1

  1. Alguém pode me dizer oq há de errado com esse script? WARNING: [Mods]GlueX\glues.lua:2: Bad argument @ 'attachElements' [Expected at argument 2] function gluePlayer(slot, vehicle, x, y, z, rotX, rotY, rotZ) attachElements(source, vehicle, x, y, z, rotX, rotY, rotZ) setPedWeaponSlot(source, slot) end addEvent("gluePlayer",true) addEventHandler("gluePlayer",getRootElement(),gluePlayer) function ungluePlayer() detachElements(source) end addEvent("ungluePlayer",true) addEventHandler("ungluePlayer",getRootElement(),ungluePlayer)
  2. Já tentei usar o source, porém isso é um sistema de kill mensagens, se eu colocar source, se um player matar o outro, irá aparecer que ele próprio se matou, em vez de aparecer que o jogador x matou o jogador y, com o uso de source ficou aparecendo o jogador x matou o jogador x.
  3. Alguém por favor poderia me auxiliar no erro desse script? Estou tentando a dias concertar isso e não encontrei nada de errado no código. WARNING: [Mod]KillMsg\client.lua:4: Bad argument @ 'getPlayerName' [Expected player at argument 1, got vehicle] ERROR: [Mod]KillMsg\client.lua:4: attempt to index a boolean value function onClientPlayerWasted(killer) local names = getPlayerName(source):gsub("#%x%x%x%x%x%x", "") if killer then local namek = getPlayerName(killer):gsub("#%x%x%x%x%x%x", "") outputJoinquitMessage("#00ff00"..namek.."#FFFFFF matou #00ff00"..names.."") else outputJoinquitMessage("#00ff00"..names.."#FFFFFF cometeu suicidio") end end addEventHandler("onClientPlayerWasted", root, onClientPlayerWasted)
  4. Sem problemas, funcionou tudo certinho aqui, obrigado pela ajuda @Tommy.
  5. Testei aqui e funcionou isso também... Porém testei adaptar na área verde que eu uso de todas as formas, colando linha por linha já to algumas horas quebrando a cabeça com isso, mas até agora não consegui, talvez porque a área verde que eu uso, usa programação em OOP também. Teria como fazer isso por mim por favor? Obs: Testei colocar até em pastas separadas da área verde para testar, porém sem sucesso. greenzones = { {x = 60, y = -1973, z = -20, width = 301, depth = 225, height = 500, r = 0 , g = 200 , b = 0 , a = 100}, -- Praia } local AreaV = {} function IniciarAreaVerde() if greenzones and #greenzones ~= 0 then for _,v in ipairs (greenzones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local colShape = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height) local rarea = createRadarArea (v.x, v.y, v.width, v.depth, v.r,v.g,v.b,v.a) setElementParent (rarea, colShape) colShape:setData("AreaProte", true) if colShape then AreaV[colShape] = true addEventHandler ("onElementDestroy", colShape, function() if AreaV[source] then AreaV[source] = nil end end ) addEventHandler ("onColShapeHit", colShape, function (h, d) if h and d and isElement(h) and getElementType (h) == "player" and getElementDimension( h ) == 0 and getElementInterior(h) == 0 then setElementData(h,"areaverde",true) end if h and d and isElement(h) and getElementType (h) == "vehicle" and getElementDimension( h ) == 0 and getElementInterior(h) == 0 then setVehicleDamageProof(h, true) end end ) addEventHandler ("onColShapeLeave", colShape, function (h, d) if h and d and isElement(h) and getElementType (h) == "player" and getElementDimension( h ) == 0 and getElementInterior(h) == 0 then setElementData(h,"areaverde",false) end if h and d and isElement(h) and getElementType (h) == "vehicle" and getElementDimension( h ) == 0 and getElementInterior(h) == 0 then setVehicleDamageProof(h, false) end end ) end end end end end end addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()), IniciarAreaVerde)
  6. Sim o problema é exatamente esse. Vou tentar resolver com o setElementData, obrigado pela ajuda.
  7. Alguém sabe se existe alguma função semelhante ao setVehicleDamageProof para blindar o veículo? Tenho 2 mods com essa mesma função e eles estão entrando em conflito, pois ao entrar no servidor a pessoa já entra com o veículo blindado, porém após ela passar por uma certa área e sair dessa área que usa essa mesma função, acaba desativando a blindagem, e eu queria que continuasse. Obs: Um desses mods ele seta a blindagem apenas em um local especifico (Área verde), já o outro mod ele seta a blindagem em todo o servidor, porém são modos diferentes (Modo Passivo semelhante ao GTAV online)
  8. Não, quando o veículo é explodido ele cancela normalmente o trabalho, porém quando ele é destruído seja pelo próprio painel P, ou por algum mod, o trabalho continua em execução. O que eu queria é que após o veículo ser destruído o trabalho ser cancelado. Tem alguma função que de pra fazer isso?
  9. Estou com um erro aqui, que após o veículo ser destruído ele aparece esse aviso no debugscript 3 e fica floodando durante algum tempo, teria como me ajudarem nisso pfv? WARNING: LuzesPM\server.lua:66: Bad argument @ 'killTimer' [Expected lua-timer at argument 1, got boolean] p_lights = {} p_timer = {} p_lvar = {} function toggleLights(thePlayer, cmd) local veh = getPedOccupiedVehicle(thePlayer) local id = getElementModel(veh) if (id == 523) or (id == 490) or (id == 597) or (id == 599) then if(p_lights[veh] == 0) or(p_lights[veh] == nil) then p_lights[veh] = 1 outputChatBox("#FF0000*ATENÇÃO: #ffffffLuzes da Policia Foram Ativadas.", thePlayer, 0, 200, 100, true) setVehicleOverrideLights ( veh, 2 ) p_timer[veh] = setTimer( function() if(p_lvar[veh] == 0) or (p_lvar[veh] == nil) then p_lvar[veh] = 1 setVehicleLightState ( veh, 1, 0) setVehicleLightState ( veh, 2, 0) setVehicleLightState ( veh, 0, 1) setVehicleLightState ( veh, 3, 1) setVehicleHeadLightColor(veh, 0, 0, 255) else setVehicleLightState ( veh, 3, 0) setVehicleLightState ( veh, 0, 0) setVehicleLightState ( veh, 1, 1) setVehicleLightState ( veh, 2, 1) setVehicleHeadLightColor(veh, 255, 0, 0) p_lvar[veh] = 0 end end, 500, 0) else p_lights[veh] = 0 outputChatBox("#FF0000*ATENÇÃO: #ffffffLuzes da Policia Foram Desativadas.", thePlayer, 0, 200, 100, true) killTimer(p_timer[veh]) setVehicleLightState ( veh, 0, 0) setVehicleLightState ( veh, 1, 0) setVehicleLightState ( veh, 2, 0) setVehicleLightState ( veh, 3, 0) setVehicleHeadLightColor(veh, 255, 255, 255) setVehicleOverrideLights ( veh, 1 ) end end end addCommandHandler("alerta", toggleLights) addEventHandler ( "onVehicleExplode", getRootElement(), function() if(p_lights[source] == 1) then killTimer(p_timer[source]) end end ) addEventHandler ( "onVehicleRespawn", getRootElement(), function() if(p_lights[source] == 1) then killTimer(p_timer[source]) end end ) addEventHandler("onElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" then if(p_lights[source] == 1) then p_timer[source] = false killTimer(p_timer[source]) end end end)
  10. Eu não entendi muito bem isso, testei no servidor porém não deu em nada... vou deixar aqui o código completo : function prisao(Policial, cmd, Jogador) local accName = getAccountName ( getPlayerAccount ( Policial ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "PM" ) ) then if cmd == "prender" then if Jogador then Jogador = getPlayerFromPartialName(Jogador) estrelasdeprocurado = getPlayerWantedLevel(Jogador) local jX, jY, jZ = getElementPosition (Jogador) local pX, pY, pZ = getElementPosition (Policial) local dist = getDistanceBetweenPoints3D ( pX, pY, pZ, jX, jY, jZ) if Jogador == Policial then return outputChatBox("#FF0000Voce não pode se Prender.", Policial, 255, 255, 255, true) elseif ( estrelasdeprocurado == 0 ) then return outputChatBox("#FF0000Este Jogador não está sendo Procurado!", Policial, 255, 255, 255, true ) elseif dist >= 3 then return outputChatBox("#FF0000Chegue mais perto do Jogador para Prender!", Policial, 255, 255, 255, true ) end Prender(Jogador) outputChatBox("#FF0000Voce Recebeu R$1.000 Por prender o Jogador "..getPlayerName(Jogador).."", Policial, 255 , 255, 255, true) givePlayerMoney(Policial, 1000) else outputChatBox("#FF0000Digite o Nome do Jogador!", Policial, 255, 255, 255, true) end elseif cmd == "liberar" then if Jogador then Jogador = getPlayerFromPartialName(Jogador) estrelasdeprocurado = getPlayerWantedLevel(Jogador) if Jogador == Policial then return outputChatBox("#FF0000Voce não pode se Liberar!", Policial, 255, 255, 255, true) elseif not getElementData(Jogador, "preso") or not getElementData(rRoot,""..getPlayerSerial(Jogador).."-j") then return outputChatBox("#FF0000Este jogador não está Preso!", Policial, 255, 255, 255, true ) end Liberar(Jogador) else outputChatBox("#FF0000Digite o Nome do Jogador!", Policial, 255, 255, 255, true) end end else end end addCommandHandler("prender", prisao)
  11. Alguém pra me dar um help nisso? ERROR: Prender.lua:8: attempt to compare number with boolean Já tentei fazer assim porém deu o mesmo problema (acredito que o que eu fiz esteja errado): elseif ( dist > 5 ) then return outputChatBox("#FF0000fChegue mais perto do jogador para prender!", Policial, 255, 255, 255, true ) elseif ( dist < 6 )then return outputChatBox("#FF0000Chegue mais perto do jogador para prender!", Policial, 255, 255, 255, true ) end local jX, jY, jZ = getElementPosition (Jogador) local pX, pY, pZ = getElementPosition (Policial) local dist = getDistanceBetweenPoints3D ( pX, pY, pZ, jX, jY, jZ) if Jogador == Policial then return outputChatBox("#ff0000Voce não pode se Prender.", Policial, 255, 255, 255, true) elseif ( estrelasdeprocurado == 0 ) then return outputChatBox("#ff0000Este Jogador não está sendo Procurado!", Policial, 255, 255, 255, true ) elseif dist >= 3 then return outputChatBox("#ff0000Chegue mais perto do Jogador para Prender!", Policial, 255, 255, 255, true ) end Prender(Jogador) outputChatBox("#ff0000Voce Recebeu R$1.000 Por prender o Jogador "..getPlayerName(Jogador).."", Policial, 255 , 255, 255, true) givePlayerMoney(Policial, 1000) else outputChatBox("#ff0000Digite o Nome do Jogador!", Policial, 255, 255, 255, true) end
  12. Estou com um problema em um mod de car-lock, já vi vários tópicos relacionados a esse mesmo mod, mas nenhum conseguiu me ajudar, ele acusa esses erros: WARNING: [Mod]-CarLock\server.lua:78: Bad argument @ 'getElementData' [Expected element at argument 1] WARNING: [Mod]-CarLock\server.lua:98: Bad argument @ 'getElementData' [Expected element at argument 1] WARNING: [Mod]-CarLock\server.lua:102: Bad argument @ 'setElementData' [Expected element at argument 1] WARNING: [Mod]-CarLock\server.lua:103: Bad argument @ 'setVehicleLocked' [Expected element at argument 1] WARNING: [Mod]-CarLock\server.lua:105: Bad argument @ 'getVehicleController' [Expected vehicle at argument 1] Alguém que possa me ajudar a resolver isso? Se for preciso estou disposto a pagar. function initCarLocks () local players = getElementsByType ( "player" ) for k,p in ipairs(players) do removeElementData ( p, "cl_ownedvehicle" ) bindKey ( p, "l", "down", doToggleLocked ) end local vehicles = getElementsByType ( "vehicle" ) for k,v in ipairs(vehicles) do removeElementData ( v, "cl_vehicleowner" ) removeElementData ( v, "cl_vehiclelocked" ) setVehicleLocked ( v, false ) end end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), initCarLocks ) addEventHandler ( "onResourceStop", getResourceRootElement ( getThisResource () ), initCarLocks ) function cl_PlayerJoin ( ) bindKey ( source, "l", "down", doToggleLocked ) end addEventHandler ( "onPlayerJoin", getRootElement(), cl_PlayerJoin ) function cl_VehicleStartEnter ( enteringPlayer, seat, jacked ) local theVehicle = source local theOwner if ( getElementData ( theVehicle, "cl_vehiclelocked" ) == true ) then theOwner = getElementData ( theVehicle, "cl_vehicleowner" ) if theOwner ~= false and theOwner ~= enteringPlayer then end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), cl_VehicleStartEnter ) function cl_PlayerDriveVehicle ( player, seat, jacked ) if ( seat == 0 ) then oldVehicle = getElementData ( player, "cl_ownedvehicle" ) if ( (cl_VehicleLocked(source) == true) and (cl_VehicleOwner(source) ~= player) ) then removePedFromVehicle( player ) outputChatBox ("#ff0000Veículo Trancado.", source, 255, 255, 255, true) return false end cl_SetVehicleOwner ( source, player ) end return true end addEventHandler ( "onVehicleEnter", getRootElement(), cl_PlayerDriveVehicle ) function cl_SetVehicleOwner ( theVehicle, thePlayer ) local oldVehicle = getElementData ( thePlayer, "cl_ownedvehicle" ) if ( oldVehicle ~= false ) then end setElementData ( theVehicle, "cl_vehicleowner", thePlayer ) setElementData ( theVehicle, "cl_vehiclelocked", false ) setElementData ( thePlayer, "cl_ownedvehicle", theVehicle ) end function cl_VehicleOwner ( theVehicle ) return getElementData( theVehicle, "cl_vehicleowner" ) end function cl_VehicleLocked ( theVehicle ) return getElementData( theVehicle, "cl_vehiclelocked" ) end function doToggleLocked ( source ) local theVehicle , strout if ( getElementType(source) == "vehicle" ) then theVehicle = source end if ( getElementType(source) == "player" ) then theVehicle = getElementData ( source, "cl_ownedvehicle" ) end if ( theVehicle ) then if ( getElementData ( theVehicle, "cl_vehiclelocked") == true ) then doUnlockVehicle ( source ) else doLockVehicle ( source ) end else end end function doLockVehicle ( source ) local theVehicle , strout if ( getElementType(source) == "vehicle" ) then theVehicle = source end if ( getElementType(source) == "player" ) then theVehicle = getElementData ( source, "cl_ownedvehicle" ) end if ( theVehicle ) then if ( getElementData ( theVehicle, "cl_vehiclelocked") == true ) then strout = "*Seu Veiculo ja esta Trancado." Err_Msg(strout, source) else setElementData ( theVehicle, "cl_vehiclelocked", true) setVehicleLocked ( theVehicle, true ) outputChatBox ("#ff0000Seu Veículo foi Trancado.", source, 255, 255, 255, true) if ( getVehicleController ( theVehicle ) == false ) then end end end end function doUnlockVehicle ( source ) local theVehicle, strout if ( getElementType(source) == "vehicle" ) then theVehicle = source end if ( getElementType(source) == "player" ) then theVehicle = getElementData ( source, "cl_ownedvehicle" ) end if ( theVehicle ) then if ( getElementData ( theVehicle, "cl_vehiclelocked") == false ) then else setElementData ( theVehicle, "cl_vehiclelocked", false) setVehicleLocked ( theVehicle, false ) outputChatBox ("#ff0000Seu Veículo foi Destrancado.", source, 255, 255, 255, true) if ( getVehicleController ( theVehicle ) == false ) then end end end end
  13. oi, alguém poderia me ajudar com um WARNING em um script? WARNING: ExplodeSome\dvoe_s.lua:4: Bad argument @ 'destroyElement' [Expected element at argument 1] local timer = 500 function desaparecer() setTimer(destroyElement, timer, 1, source) end addEventHandler("onVehicleExplode", getRootElement(), desaparecer)
×
×
  • Create New...