Jump to content

RenanPG

Members
  • Posts

    186
  • Joined

Everything posted by RenanPG

  1. Acabei de testar e funciona, seta 23:59 no painel admin para ver.
  2. Não sei se existe uma função para pegar dia de semana, mas da pra fazer uma gambiarra tipo essa pra atualizar o dia conforme o horário do getTime: local dias = { [0] = "Domingo"; [1] = "Segunda"; [2] = "Terça"; [3] = "Quarta"; [4] = "Quinta"; [5] = "Sexta"; [6] = "Sábado" } local dia = 0 setTimer(function() local h, m = getTime() if(h == 0 and m == 0) then if(dia == 6) then dia = 0 else dia = dia + 1 end end end, 1000, 0) addEventHandler( "onClientRender", root, function () dxDrawText( dias[dia], 1045, 606, 1105, 624, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, false, false) end )
  3. @John Smith As arezu said, when you have something invalid in the code it would break the execution of the main script, and it would stop in the part the error occurs.
  4. I would recommend using pcall to ignore code errors. function onResourceStart() local file = fileOpen("editable.lua") if(file) then pcall(loadstring( fileRead(file, fileGetSize(file)) ) ) fileClose(file) end end addEventHandler("onResourceStart", root, onResourceStart)
  5. As far as i know you can loop through the predefined variable guiRoot, but you'll need a recursion to get all elements, because exists children of children GUIs. guiRoot > Window > Button (an example of a gui tree)
  6. @StanleySathler Eh só fazer um override da função original, tipo assim: local _addEventHandler = addEventHandler -- variavel com a função nativa function addEventHandler(...) -- função editada -- aqui faz a lógica que vc quiser return _addEventHandler(...) end
  7. Is there a way to protect html files ? for example encrypting or avoid client cache ?
  8. Tente usar esta função abaixo ao invés do getPlayerName(). https://wiki.multitheftauto.com/wiki/Ge ... artialName
  9. Achei isso no google, ai tem algumas coisas que poderá ajudar vocês
  10. The main problem is not your "coding style", at least you should pass the arguments correctly.
  11. Coloque isso na linha 8. outputChatBox("O " .. getPlayerName(source) .. "#00ff00 Está Revistando o Jogador" .. getPlayerName(thePlayer))
  12. RenanPG

    Comedy by XeoN

    vdd KKKKKKKKKKKKKKKK
  13. RenanPG

    Comedy by XeoN

    OVH não suporta cores em java, porisso da lag.
  14. Você também pode usar o setElementHealth(theElement, 0) como uma alternativa ao killPed no lado cliente, fica mais simples do que enviar ao servidor. source geralmente é o elemento que sofreu o evento dentro do addEventHandler(). getLocalPlayer() retorna o player do client.
  15. Não corrige mano, xeon não aprende.
  16. o que ta errado filho? Head deveria ser o id. if (attacter and weapon == 69 and bodypart == Head) then
  17. @XeoN- Seu código ainda tem erros, não acho que seja necessário chamar o roots para isso.
  18. killPed é server side apenas. -- for _, v in ipairs ( { "pro", "std", "poor" } ) do setWeaponProperty ( "sniper", v, "damage", 9999 ) end Como não? é so cria -__- function killPed( p) return setElementHealth(p,0) end
  19. O id da arma está incorreto, pegue os ids necessários aqui: https://wiki.multitheftauto.com/wiki/Weapon.
  20. Eu quero que mate em qualquer parte do corpo nao so na cabeça (client-side) local weapons = {20, 40} -- id da arma function onClientPedDamage(_, weapon) if(getElementType(source) == "player") then if(weapons[weapon]) then return killPed(source) end end end addEventHandler("onClientPedDamage", getRootElement(), onClientPedDamage)
  21. I'm not sure if I understood your question, but you can try one of these control checkers. if(getControlState("handbrake")) then end if(getControlState("brake_reverse")) then end
×
×
  • Create New...