Jump to content

manawydan

Members
  • Posts

    980
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by manawydan

  1. retorna o "tamanho" de uma tabela. ex: local t ={"a",x,9,"foo"} local tamanho = #t print(tamanho) o print sera 4 porque nossa tabelas apresenta 4 valores.
  2. nice
  3. eu fiz esse mod pra salvar item do inventario do meu server: executeSQLQuery( 'CREATE TABLE IF NOT EXISTS ItensInventarioChao ( model,x,y,z,itemid,id)' ) addCommandHandler("item", function(p,cm,model,itemid) local acc = getPlayerAccount(p) if isObjectInACLGroup( 'user.'..getAccountName(acc), aclGetGroup ( 'Admin' ) ) then local x,y,z = getElementPosition(p) --local rx,ry,rz = getElementRotation(p) z =z-0.8 local allLo = executeSQLQuery( "SELECT * FROM ItensInventarioChao" ) id = #allLo+ 1 executeSQLQuery( "INSERT INTO ItensInventarioChao ( model,x,y,z,itemid,id ) VALUES ( "..model..","..x..", "..y..", "..z..", "..itemid..", "..id..")" ) print("Criando") end end) addCommandHandler("criar", function(p) local acc = getPlayerAccount(p) if isObjectInACLGroup( 'user.'..getAccountName(acc), aclGetGroup ( 'Admin' ) ) then local GetAllLom = executeSQLQuery( "SELECT * FROM ItensInventarioChao" ) if ( type ( GetAllLom ) == "table" and #GetAllLom > 0 ) then for i = 1, #GetAllLom do local n = {GetAllLom[i]["model"],GetAllLom[i]["x"], GetAllLom[i]["y"], GetAllLom[i]["z"], GetAllLom[i]["itemid"]} for ii = 1, #n do n[ ii ] = tonumber( n[ ii ] ) end local item = createInventoryObject(n[1],n[2],n[3],n[4],n[5]) end end end end) a função createInventoryObject é uma funcao que fiz q cria o objeto nas cordenadas e adiciona data a ele. Com esse script eu n precisei criar nenhum banco de dados nem nada apenas fiz as coisas por script.No caso esses dados sql ficam salvos no mta.
  4. Então, no sql vc pode tanto usa o banco de dados do mta e ir criando tabelas, colocando dados... ou voce pode criar um banco de dados do zero e colocar no mta, não necessita ter 2 server pra isso.
  5. acho que voce pode usar xml ou sql pra salvar dados quando o jogador estiver ofline. xml: https://wiki.multitheftauto.com/wiki/Se ... _functions sql: https://wiki.multitheftauto.com/wiki/Se ... _functions Na minha opinião sql é melhor, entretanto um pouco mais dificil de mecher.
  6. http://www.kwksrv-mta.info/KWKSNDsTSR.html
  7. manawydan

    GUI Thing

    or try this local mainLoginWindow = guiCreateWindow(0,0,100,100,"Window",false) addEvent ( "setLoginWindowVisable", true ) function showLoginWindow () guiSetVisible (mainLoginWindow, true) showCursor(true) end addEventHandler( "setLoginWindowVisable", root, showLoginWindow )
  8. manawydan

    GUI Thing

    try delete enableCursor function. if you no make it.
  9. manawydan

    GUI Thing

    whats enableCursor do?
  10. ok try addCommandHandler("handbrake",function(p) if(isPedInVehicle(p)) then local x,y,z = getElementPosition(p) triggerClientEvent("onHandbrakeStart",p,x,y,z) end end) addEvent("onHandbrakeStart",true) addEventHandler("onHandbrakeStart",root, function(x,y,z) local sound = playSound3D("handbrake.mp3",x,y,z,false) setSoundMaxDistance(sound,50) setSoundVolume(sound,1) local vehicle = getPedOccupiedVehicle(source) attachElements(sound,vehicle,0,0,0) end)
  11. sorry. try this: addCommandHandler("handbrake",function() if(isPedInVehicle(localPlayer)) then local x,y,z = getElementPosition(localPlayer) local sound = playSound3D("handbrake.mp3",x,y,z,false) setSoundMaxDistance(sound,50) setSoundVolume(sound,1) local vehicle = getPedOccupiedVehicle(localPlayer) attachElements(sound,vehicle,0,0,0) end end)
  12. try function handbrake () local x, y, z = getElementPosition ( localPlayer ) attachElements ( sound, handbrake, 0, 0, 5 ) local sound = playSound3D("handbrake.mp3", 0, 0, 0, false) setSoundVolume(sound, 1) end addCommandHandler ( "handbrake", handbrake )
  13. i think server side is better. for example is good use takePlayerMoney in server because is "synchronized".
  14. nice, good map.
  15. You're welcome!
  16. um exemplo que fiz(n tenho certeza se vai funfa). addEventHandler("onPlayerQuit",root, function() local conta = getPlayerAccount(source) if (conta) then local vida = getElementHealth(source) setAccountData(conta,"vida",vida) end end) addEventHandler("onPlayerLogin",root, function() local conta = getPlayerAccount(source) if (conta) then local Valor = getAccountData (conta,"vida") if (Valor) then setElementHealth(source,tonumber(Valor)) end end end) Quando o jogador sair do server, se ele tiver uma conta vamos pegar a vida dele e salva na sua conta, com a string "vida". Entao quando este logar vai receber a vida de acordo com o numero que foi salvo quando ele saiu. È quase a mesma coisa q set/get ElementData. Espero ter ajudado!
  17. try this: https://community.multitheftauto.com/in ... ils&id=292
  18. nice man
  19. my texture is black edit: work if i use another texture color, but with black no work, i can change color in the shader.fx?
  20. so before i post i try: engineApplyShaderToWorldTexture ( shaderL, "flame1") engineApplyShaderToWorldTexture ( shaderL, "flame2") engineApplyShaderToWorldTexture ( shaderL, "flame3") engineApplyShaderToWorldTexture ( shaderL, "blaze1") engineApplyShaderToWorldTexture ( shaderL, "blaze2") engineApplyShaderToWorldTexture ( shaderL, "blaze3") but no work to
  21. thanks. But i am try use the shader and no work, first i try shader the flame, but no work, after to all and no work. script shar.lua addEventHandler( "onClientResourceStart", resourceRoot, function() local texture = dxCreateTexture ("fire.png") shaderL = dxCreateShader ( "Amaterasu.fx" ) dxSetShaderValue ( shaderL, "gTexture", texture ) engineApplyShaderToWorldTexture ( shaderL, "all") end) shader Amaterasu.fx texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } my meta.xml is fine and no errors in debug.
  22. it is possible to shade the fire? flame. if yes, whats flame/fire name for shader. Thanks!
  23. nice man, good luck.
×
×
  • Create New...