Jonas^
Members-
Posts
1,016 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Jonas^
-
Realmente, é um pequeno problema, porém deve ser reportado !
-
Ele não editou a resource, isso é um warning nativo da propria resource, a solução é: setTimer ( kickPlayer, 100, 1, player, (getElementType(source) = "player") and source or "Console", reason ) Igual o DNL disse, esse warning causa quando você tenta kikar alguém pelo console!
-
Entendi, ja havia resolvido obg, !
-
ERRO: client.lua:430 exports: call to non-running server resource ( tactics ) [string "?"] if exports.tactics:getPlayerGameStatus(localPlayer) == "Play" or exports.tactics:getPlayerGameStatus(localPlayer) == "Loading" then LINHA DO ERRO < ---------- function() if source == localPlayer then if exports.tactics:getPlayerGameStatus(localPlayer) == "Play" or exports.tactics:getPlayerGameStatus(localPlayer) == "Loading" then if isTimer(killCamTimer) then if isTimer(eTimer) then killTimer(eTimer) end killTimer(killCamTimer) killerName = nil killerHealth = nil killerRank = nil killerWeapon = nil removeEventHandler("onClientPreRender", root, interpolateCam) start = nil killerFOE = nil killerYOU = nil destroyShaderForPlayer(killElement) killElement = nil if exports.tactics:getPlayerGameStatus(localPlayer) == "Play" then setCameraTarget(localPlayer) else exports.tactics:setCameraSpectating() end end end end end) Função toda acima ! Outro erro: attempt to index anill value função: if exports.tactics:getRoundMapInfo()["modename"] ~= "lobby" then Toda função: function() if exports.tactics:getRoundMapInfo()["modename"] ~= "lobby" then ammoFired = (ammoFired or 0) + 1 end end) Se alguém souber oq é isso agradeço !
-
Olá, como eu posso saber se a outputchatbox sera enviada para todos ou apenas para a pessoa que usar o comando?
-
Não, pois quando eu fecho e abro o MTA novamente a textura dos outros server somem, após eu entrar no meu servidor novamente e entrar nos outros servidor todos passam a ter a mesma textura na arena novamente ! não tem em mente o que pode ser?
-
addEventHandler("onClientResourceStart", resourceRoot, function() --/-- arena = engineLoadTXD("models/Textura/arena_20.txd") engineImportTXD( arena, 14853 ) --/-- end) 0BS: Eu uso essa mesma função para carregar minhas skins de personagens/armas etc, mas eu tirei da função só deixar a da arena!
-
Oi, eu fiz uma textura para um interior porém todo servidor que eu entro a textura aplica no servidor que eu entro também, queria que aparecesse somente no meu servidor, não sei o que esta de errado, se alguém poder ajudar, parece que ele esta modificando os arquivos do proprio gta ! CLIENT-SIZE arena = engineLoadTXD("models/Textura/arena_20.txd") engineImportTXD( arena, 14853 ) <file src="models/Textura/arena_20.txd" /> META ACIMA
-
bad argument @ 'getelementtype' [ expected element at argument 1, got nill ] Linha 2 < - function MakePlayerHeadshot( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "ped" then if bodypart == 9 then triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) setPedHeadless ( source, true ) killPed( source, attacker, weapon, bodypart ) setTimer( BackUp, 900, 1, source ) end end end
-
Obrigado em breve irei testar! a DNL pode ver privado por favor? quero uma ajuda mas não quero divulgar o código publicamente !
-
Error: rANKSYSTEM:CLIENT.lua:8 bad argument #1 to 'format' [number expected, got nill ) return tonumber(("%."..decimals.."f"):format(number)) Esse erro é causado quando tem alguns jogadores ONLINE sozinho não acontece ! Toda a função do erro: --/-- RATIO DIMINUIÇÃO DAS CASAS function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end
-
Perfeito, funcionou, obrigado!
-
Então - Não tem como resolver os warnings?
-
descomentei e ficou num carregamento infinito, e não é erro é warning
-
---------------------------------- -----------| Settings |----------- ---------------------------------- blackLoginScreen = true -- Set to 'true' to display a black screen to the player untill they log in or choose to play as a guest. enableKickPlayer = true -- Set whether to kick the player after they fail to login specified amount of times. disallowLogout = false -- Set whether to show the userpanel to the players if they log out of their accounts. removeBlackScreenTime = 4 -- The time it takes for the black screen to dissapear - If you choose to display the black screen. [IN SECONDS] maxLoginAttempts = 5 -- Set the maximum incorrect login attempts before the player gets kicked - If player kicking is enabled. ---------------------------------- -- Screen and GUI window sizes screenWidth,screenHeight = guiGetScreenSize() mainWidth,mainHeight = 749,472 regWidth,regHeight = 439,344 -- Generate the XML file name myFont = guiCreateFont( "verdana.ttf", 13 ) myFont2 = guiCreateFont( "verdana.ttf", 9 ) myFont3 = guiCreateFont( "verdana.ttf", 8 ) myFont4 = guiCreateFont( "verdana.ttf", 18 ) function getServerName() triggerServerEvent("onClientLoginLoaded",getLocalPlayer()) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getServerName) sound = playSound("Som/music.mp3",true) -- Iniciar a música function setXmlFileName(sName) xmlFileName = tostring("ContaLMTactics_"..sName..".xml") loginPanel() end addEvent("onGetServerData",true) addEventHandler("onGetServerData",getRootElement(),setXmlFileName) ---------------------------------- addEvent("onRequestIncreaseAttempts",true) addEvent("onRequestDisplayPanel",true) function loginPanel() -- Check if autologin is enabled - If yes, then log the player in, else create and show the userpanel local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then status = xmlNodeGetAttribute(xmlFile,"autologin") if (status == "true") then local username = tostring(xmlNodeGetAttribute(xmlFile,"user")) local password = tostring(xmlNodeGetAttribute(xmlFile,"pass")) if not (username == "") and not (password == "") then triggerServerEvent("onRequestAutologin",getLocalPlayer(),username,password) end else if blackLoginScreen == true then fadeCamera(false,0,0,0,0) end mainWindow = guiCreateWindow(412, 157, 387, 456, "Login [BR-PT]", false) guiWindowSetSizable(mainWindow, false) guiSetAlpha(mainWindow, 1.00) editUsername = guiCreateEdit(93, 116, 187, 25,"",false,mainWindow) guiEditSetMaxLength(editUsername,30) editPassword = guiCreateEdit(93, 199, 187, 25,"",false,mainWindow) guiEditSetMaxLength(editPassword,30) guiEditSetMasked(editPassword,true) lblUsername = guiCreateLabel(103, 68, 158, 38,"Usuario:",false,mainWindow) guiLabelSetColor(lblUsername,254, 254, 254) guiLabelSetVerticalAlign(lblUsername,"center") guiLabelSetHorizontalAlign(lblUsername,"center",false) guiSetFont(lblUsername,myFont2) lblPassword = guiCreateLabel(103, 151, 158, 38,"Senha:",false,mainWindow) guiLabelSetColor(lblPassword,254, 254, 254) guiLabelSetVerticalAlign(lblPassword,"center") guiLabelSetHorizontalAlign(lblPassword,"center",false) guiSetFont(lblPassword,myFont2) btnLogin = guiCreateButton(108, 260, 162, 44,"Login",false,mainWindow) guiSetFont(btnLogin,myFont) btnToggleRegister = guiCreateButton(92, 340, 198, 60,"Criar Uma Conta",false,mainWindow) guiSetFont(btnToggleRegister,myFont) registerWindow = guiCreateWindow(screenWidth/2-regWidth/2,screenHeight/2-regHeight/2,regWidth,regHeight,"Registro LM Tactics Server v1.2 By Jonas",false) guiWindowSetSizable(registerWindow,false) guiSetAlpha(registerWindow, 1.00) editRegistrationUsername = guiCreateEdit(98, 90, 242, 25,"",false,registerWindow) editRegistrationPassword = guiCreateEdit(98, 162, 242, 25,"",false,registerWindow) guiEditSetMasked(editRegistrationPassword,true) editRegistrationRepeatPassword = guiCreateEdit(93, 240, 242, 25,"",false,registerWindow) guiEditSetMasked(editRegistrationRepeatPassword,true) lblRUsername = guiCreateLabel(98, 56, 242, 17,"Usuario:",false,registerWindow) guiLabelSetColor(lblRUsername,254, 254, 254) guiLabelSetVerticalAlign(lblRUsername,"center") guiLabelSetHorizontalAlign(lblRUsername,"center",false) guiSetFont(lblRUsername,myFont2) lblRPassword = guiCreateLabel(98, 130, 242, 17,"Senha:",false,registerWindow) guiLabelSetColor(lblRPassword,254, 254, 254) guiLabelSetVerticalAlign(lblRPassword,"center") guiLabelSetHorizontalAlign(lblRPassword,"center",false) guiSetFont(lblRPassword,myFont2) lblRepeatPassword = guiCreateLabel(99, 203, 242, 17,"Confirme sua senha:",false,registerWindow) guiLabelSetColor(lblRepeatPassword,254, 254, 254) guiLabelSetVerticalAlign(lblRepeatPassword,"center") guiLabelSetHorizontalAlign(lblRepeatPassword,"center",false) guiSetFont(lblRepeatPassword,myFont2) btnCancel = guiCreateButton(232, 292, 179, 38,"Cancelar",false,registerWindow) guiSetFont(btnCancel,myFont2) btnConfirmRegistration = guiCreateButton(29,292,179,38,"Registrar",false,registerWindow) guiSetFont(btnConfirmRegistration,myFont2) guiSetVisible(mainWindow, true) guiSetVisible(registerWindow, false) guiSetInputEnabled(true) showCursor(true) addEventHandler("onClientGUIClick",btnLogin,onClickLogin) addEventHandler("onClientGUIClick",btnToggleRegister,onClickRegisterToggle) addEventHandler("onClientGUIClick",btnConfirmRegistration,onClickRegisterConfirm) addEventHandler("onClientGUIClick",btnCancel,onClickCancel) addEventHandler("onRequestIncreaseAttempts",getRootElement(),increaseAttempts) attemptedLogins = 0 end xmlUnloadFile(xmlFile) else xmlFileHandler(true) end addEventHandler("onRequestDisplayPanel",getRootElement(),logoutHandler) end --addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),loginPanel) -- Desativar Auto Login function removeAutoLogin() local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then local status = xmlNodeGetAttribute(xmlFile,"autologin") if status == "true" then xmlNodeSetAttribute(xmlFile,"autologin","false") outputChatBox("#FF0000[INFO] - #FFFFFFAuto-login #FF0000Desativado!",255,255,255,true) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) else outputChatBox("#FF0000[INFO] - #FFFFFFAuto-login já está #FF0000Desativado!",255,255,255,true) xmlUnloadFile(xmlFile) end end end addCommandHandler("desativarauto", removeAutoLogin) -- Ativar autologin function addAutoLogin() local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then local status = xmlNodeGetAttribute(xmlFile,"autologin") if status == "false" then xmlNodeSetAttribute(xmlFile,"autologin","true") outputChatBox("#00FF00[INFO] - #FFFFFFAuto-login #00FF00Ativado!",255,255,255,true) setTimer(outputChatBox,1000,1,"#FF0000[AVISO] - #FFFFFFPara desabilitar o login automático, use #FF0000/desativarauto.",255,255,255,true) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) else outputChatBox("#00FF00[INFO] - #FFFFFFAuto-login já está #00FF00Ativado!",255,255,255,true) xmlUnloadFile(xmlFile) end end end addCommandHandler("ativarauto", addAutoLogin) -- LOGIN PLAYER function onClickLogin(button,state) if(button == "left" and state == "up") then if (source == btnLogin) then username = guiGetText(editUsername) password = guiGetText(editPassword) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts) xmlFileHandler() end end end -- REGISTER PLAYER function onClickRegisterConfirm(button,state) if(button == "left" and state == "up") then if (source == btnConfirmRegistration) then username = guiGetText(editRegistrationUsername) password = guiGetText(editRegistrationPassword) passwordConfirm = guiGetText(editRegistrationRepeatPassword) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password,passwordConfirm) end end end -- Open registration window function onClickRegisterToggle(button,state) if(button == "left" and state == "up") then if (source == btnToggleRegister) then guiSetVisible(registerWindow, true) guiBringToFront(registerWindow) guiSetInputEnabled(true) showCursor(true) end end end -- Cancel registration function onClickCancel(button,state) if(button == "left" and state == "up") then if (source == btnCancel) then guiSetVisible(mainWindow, true) guiSetVisible(registerWindow, false) guiSetInputEnabled(true) showCursor(true) end end end -- Show login window function showLoginWindow() guiSetVisible(mainWindow, true) guiSetVisible(registerWindow, false) guiSetInputEnabled(true) showCursor(true) end addEvent("showLoginWindow", true) addEventHandler("showLoginWindow",getRootElement(),showLoginWindow) -- Hide login window function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(mainWindow, false) guiSetVisible(registerWindow, false) showCursor(false) stopSound(sound) -- Parar a música if blackLoginScreen == true then fadeCamera(true,removeBlackScreenTime) end end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) -- Hide register window function hideRegisterWindow() guiSetInputEnabled(true) guiSetVisible(mainWindow, true) guiSetVisible(registerWindow, false) showCursor(true) end addEvent("hideRegisterWindow", true) addEventHandler("hideRegisterWindow", getRootElement(), hideRegisterWindow) -- Show login panel when a player logs out if 'dissalowLogout' is set to TRUE function logoutHandler() if (disallowLogout == true) then loginPanel() setTimer(outputChatBox,600,1,"#FF0000[AVISO] - #FFFFFF Você foi desconectado. Por favor, faça login novamente.",255,255,255,true) end end -----------------------------------------------------------------------------------------------| -- XML File Handler function xmlFileHandler(gReturn) local xmlFile = xmlLoadFile(xmlFileName) if not xmlFile then xmlFile = xmlCreateFile(xmlFileName,"settings") xmlNodeSetAttribute(xmlFile,"autologin","false") end xmlNodeSetAttribute(xmlFile,"user",tostring(guiGetText(editUsername))) xmlNodeSetAttribute(xmlFile,"pass",tostring(guiGetText(editPassword))) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) if (gReturn) then if (gReturn == true) then loginPanel() else return end end end -- Increase Login Attepts function increaseAttempts() attemptedLogins = attemptedLogins+1 end é warning
-
mainWindow = guiCreateWindow(412, 157, 387, 456, "Login BR-PT ", false) guiWindowSetSizable(mainWindow, false) guiSetAlpha(mainWindow, 1.00) Achei na parte de criar a gui.
-
Thanks é, você pode me ajudar resolver 2 warnings? [2018-06-08 21:23:18] WARNING: LMLogin\loginpanel_client.lua:259: Bad argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nil] [2018-06-08 21:23:19] WARNING: LMLogin\loginpanel_client.lua:260: Bad argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nil] -- Hide login window function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(mainWindow, false) guiSetVisible(registerWindow, false) showCursor(false) stopSound(sound) -- Parar a música if blackLoginScreen == true then fadeCamera(true,removeBlackScreenTime) end end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow)
-
function playSounds( weapon ) if(cSoundsEnabled)then local x,y,z = getElementPosition(source) if weapon == 31 then -- M4A1 local sound = playSound3D("sounds/weapon/m4.ogg", x,y,z) setSoundMaxDistance( sound, distance ) end elseif weapon == 23 then -- SILENCIADA local sound = playSound3D("sounds/weapon/silenced.ogg", x,y,z) setSoundMaxDistance( sound, distance ) end elseif weapon == 24 then -- DEAGLE local sound = playSound3D("sounds/weapon/deagle.ogg", x,y,z) setSoundMaxDistance( sound, distance ) end elseif weapon == 29 then -- MP5 local sound = playSound3D("sounds/weapon/mp5.ogg", x,y,z) setSoundMaxDistance( sound, distance) end elseif weapon == 30 then -- M240 local sound = playSound3D("sounds/weapon/ak.ogg", x,y,z) setSoundMaxDistance( sound, distance ) end elseif weapon == 33 then -- SNIPER local sound = playSound3D("sounds/weapon/sniper.ogg", x,y,z) setSoundMaxDistance( sound, distance ) end end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), playSounds) LMClient.lua:34: 'end' expected (to close 'function' at line 23) near 'elseif' < - ERRO
-
Tente ler na wiki faça igual eu, eu tentei ajudar, eu também sou um pouco iniciante, ou espere algum veterano responder !
-
function solicitaPay (thePlayer, cmd, user) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "MEC" ) ) then if not user then outputChatBox ("Erro de sintaxe, use /consertar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) setTimer (function () if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end end end end addCommandHandler ("consertar", solicitaPay)
-
No comando que você quer que só quem estiver na acl '' Mecanico '' use .
-
Use a função: if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Mecanico" ) ) then OBS: criar o grupo na ACL do servidor com o mesmo nome caso contrario não ira funcionar!
-
Como coloco pack de som de armas em servidor de MTA?
Jonas^ replied to DouglaS666's topic in Programação em Lua
Use uma dessas 2 resources que o @malignos citou e use a função: setWorldSoundEnabled ( 5, false ) Isso ira remover o som do GTA e ira deixar somente o som da resource modificada !
