Jump to content

Cristtk

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by Cristtk

  1. screenW, screenH = guiGetScreenSize() x,y,w,h = 1514, 413, 100, 100 slots = { {1067, 381, 281, 281, imgx = 1101, imgy = 433}, {1067, 381, 281, 281, imgx = 1101, imgy = 513}, {1067, 381, 281, 281, imgx = 1218, imgy = 511}, {1067, 381, 281, 281, imgx = 1179, imgy = 511}, {1067, 381, 281, 281, imgx = 1140, imgy = 512}, {1067, 381, 281, 281, imgx = 1140, imgy = 433}, {1067, 381, 281, 281, imgx = 1179, imgy = 433}, {1067, 381, 281, 281, imgx = 1218, imgy = 433} } addEventHandler("onClientRender", root, function() dxDrawImage(1067, 381, 281, 281, "exemplo1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x,y,w,h, "exemplo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end) showCursor(true) temp = {} movendo = false addEventHandler("onClientClick", root, function(b, s) if b == "left" then if s == "down" then if isMouseInPosition(x,y,w,h) then movendo = true addEventHandler("onClientRender", root, Mover) end else if movendo then movendo = false local inSlot = false if not inSlot then x,y = temp[1], temp[2] end for i,v in ipairs(slots) do if isMouseInPosition(v[1], v[2], v[3], v[4]) then inSlot = true x,y = v.imgx, v.imgy break end end temp = {} difx, dify = nil,nil removeEventHandler("onClientRender", root, Mover) end end end end) difx, dify = nil,nil function Mover() if #temp == 0 then temp[1], temp[2] = x, y end local mx, my = getCursorPosition() if not difx then difx, dify = (screenW * mx) - x, (screenH * my) - y end local cx, cy = (screenW * mx) - difx, (screenH * my) - dify x, y = cx, cy end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end Estou na duvida de como fazer com que a imagem exemplo2 fique sempre disponivel para ser movida para imagem exemplo1, ou seja, ao mover a imagem exemplo2 para a exemplo1, ela sera criada no primeiro slot imgx = 1101, imgy = 433. Assim sucessivamente, como se tivesse preenchendo a caixa.
  2. Use uma bindkey, quando eu aperto ela deveria definir a vida de pouco em pouco até concluir os 100 de vida. Mas quando aperto a bindkey ela só seta vida uma vez que no caso no script acima é +0,5. Estou usando o lado server.
  3. Ola boa tarde, como faço para essa função funcionar e adicionar vida ao player conforme o time. Segui o código abaixo. No caso a cada 2 segundos setar +1 de vida ao player até que se complete todo o life. function oneLife(player) if isElement(player) then unbindKey(player, "F", "down", oneLife) theTimer = setTimer(function() if getElementHealth(player) >= 100 then toggleAllControls (player, true) setPedAnimation(player) killTimer(theTimer) return end setElementHealth(player, getElementHealth(player) + 0.5) end,2*1000,1) setElementPosition(player, 2006.3161621094, -1390.7022705078, 27.355516433716) setElementRotation(player, -0, 0, 180) setPedAnimation( player, "CRACK", "crckidle2", -1, false, false, false, true) setPedHeadless(player, false) toggleAllControls ( player, false ) end end
  4. Ola como faço para proteger as imagens de um serve. TIpo ao baixar um servidor você pode ir no diretorio do mta e ver la os mods e imagens baixadas. Como faço para proteger de modo que as imagens não fiquem no diretorio dos players?. Teria algum meio de proteger .dff e .txd tambem? Para que não apareça no diretorio do mta de outros player?
  5. How do i convert .dff, .txd, .col files to .dffc, .txdc, .colc?
  6. Coloquei essa linha de codigo do lado serve. theZone = false function shapeHit ( thePlayer ) outputChatBox ( getPlayerName ( thePlayer ) .. " is in the zone!" ) end function setZone ( playerSource, commandName, fX, fY, fZ ) if ( fZ and fY and fX ) then local tempCol = createColCuboid ( fX, fY, fZ, 10.0, 10.0, 10.0 ) if ( tempCol == false ) then outputConsole ( "Syntax is: set_zone <X> <Y> <Z>" ) else if ( theZone ~= false ) then destroyElement ( theZone ) else addEventHandler ( "onColShapeHit", theZone, shapeHit ) end theZone = tempCol outputChatBox ( "Zone has moved!" ) end end end addCommandHandler ( "set_zone", setZone )
  7. Ola como faço pra criar um ColCboid? Ja tentei usar as instruções do https://wiki.multitheftauto.com/wiki/CreateColCuboid e não consegui. Se alguem puder me ajudar agradeço.
  8. Ola boa tarde, como faço para os team ficar salvo quando reinicio o servidor. Ja tentei alguns metódos e nada, quando desligo o servidor local e ligo novamente os team some. Teria como deixar salvo mesmo nçao tendo player neles?
  9. Ola como faço para os carros sumir quando o dono dele deslogar. No servidor aqui quando o dono do carro desloga(quit), o carro continua no servidor, teria como fazer o carro sumir? Desde ja agradeço.
  10. function toggleWeaponSounds_f ( ) local enabled = isWorldSoundEnabled ( 5 ) enabled = not enabled local state = "enabled" if ( not enabled ) then state = "disabled" end -- setWorldSoundEnabled ( 5, enabled ) outputChatBox ( "Weapon sounds " .. state ) end addCommandHandler ( "toggleweaponsounds", toggleWeaponSounds_f ) Com comando funciona, mas como faço pra ativar automático sem usar comando? Tipo ligo o mod e ja desativa os sons sem comando. E como faço pro mod funcionar pra todo mundo, desativar o audio de todo mundo? Desde ja agradeço.
  11. Ola, tem como desativar os sons originais das armas por meio de script ? Se sim poderia me dizer como fazer. Desde ja agradeço.
  12. Ola como faço para criar um NPC com animação fixa. Explorar quero criar um npc que fique aberto para sempre.
  13. Ola, teria como remover um objeto do mapa através de um script colocando o id e todas as cordenadas? Vi uma vez no forum que é possivel mas não to achando mais o tópico que fala sobre. Se puderem me ajudar mostrando o tópico ou me indicando um script agradeço. Eu tentei esse mas não funcionou. bool removeWorldModel ( 3980, 75.638, 142.5733, 79.3254, 20.0932 [, int interior = 0 ] )
  14. Ola, como faço para o que ta dentro de uma função fincionar quando tiver dois valores exigidos. No script abaixo tem um exemplo, ali se faction for 11 ou 21 vai funcionar o que ta dentro da função independete sendo 11 ou 21 mas eu quero que funcione quando os dois valores são exigidos ou seja só vai funcionar se faction for 11 e 21. Como faço? Acho que teria que colocar alguma coisa no lugar do (or). if tonumber(getElementData(p, "char.factionID")) == 11 or getElementData(p, "char.factionID") == 21 then
  15. Olá, tenho um script de skin por pickup mas quando vou pegar a skins ela vem de boa mais eu fico preso(tento sair o personagem anda mas não sai do lugar como se estivesse em uma esteira) por alguns segundos sem sair do lugar, só depois de uns 2 segundos consigo sair do pickup de skin. Ficarei grato se alguem puder me ajudar. Segui o script abaixo, uso host com mysql. skin = createPickup (1183.745, -1383.19, 13.601, 3, 1275, 0 ) function pickupskin ( thePlayer ) if getElementData(thePlayer, "char.factionDuty") == 26 then setPlayerSkin ( thePlayer, 276 ) end end addEventHandler ( "onPickupUse", skin, pickupskin ) -- -------------------------------------------------------------------------------------------- skin2 = createPickup (1178.631, -1383.197, 13.637, 3, 1275, 0 ) function pickupskin2 ( thePlayer ) if getElementData(thePlayer, "char.factionDuty") == 26 then setPlayerSkin ( thePlayer, 231 ) end end addEventHandler ( "onPickupUse", skin2, pickupskin2 ) -- -------------------------------------------------------------------------------------------- skin3 = createPickup (1146.488, -1382.93, 13.859, 3, 1275, 0 ) function pickupskin3 ( thePlayer ) if getElementData(thePlayer, "char.factionDuty") == 26 then setPlayerSkin ( thePlayer, 274 ) end end addEventHandler ( "onPickupUse", skin3, pickupskin3 ) -- -------------------------------------------------------------------------------------------- skin4 = createPickup (1146.518, -1378.538, 13.858, 3, 1275, 0 ) function pickupskin4 ( thePlayer ) if getElementData(thePlayer, "char.factionDuty") == 26 then setPlayerSkin ( thePlayer, 253 ) end end addEventHandler ( "onPickupUse", skin4, pickupskin4 ) -- -------------------------------------------------------------------------------------------- skin6 = createPickup (1173.732, -1383.5, 13.671, 3, 1275, 0 ) function pickupskin6 ( thePlayer ) if getElementData(thePlayer, "char.factionDuty") == 26 then setPlayerSkin ( thePlayer, 70 ) end end addEventHandler ( "onPickupUse", skin6, pickupskin6 ) -- -------------------------------------------------------------------------------------------- skin7 = createPickup (1169.075, -1383.584, 13.703, 3, 1275, 0 ) function pickupskin7 ( thePlayer ) if getElementData(thePlayer, "char.factionDuty") == 26 then setPlayerSkin ( thePlayer, 278 ) end end addEventHandler ( "onPickupUse", skin7, pickupskin7 )
  16. Ola depois de dois meses co minha host ativa sem nenhum problema do nada quando logo hoje vejo que a delegacia esta com textura que não existe na host. A testura é a do bop, reparei tambem que mudou em outros lugares. Creio que o erro esteja em meu mta e não no servidor pois não existe essas texturas la. Alguem sabe o motivo de isso acontecer?
  17. Certeza que pode ser conflito? Não pode ser algum erro no código? Pois uso banco de dados MYSQL.
  18. Alguem pode me ajudar, tenho um mod de spwan de skins, no serve local com host local pelo phpMyAdmin e xamp funciona normal o spawn, ja quando envio pra host não funciona, passo por cima do pickup e nada acontece. Segui o script abaixo: skin = createPickup (1183.745, -1383.19, 13.601, 3, 1275, 0 ) function pickupskin ( thePlayer ) local accName = getAccountName(getPlayerAccount(thePlayer)) if getElementData(thePlayer, "char.factionDuty") == 26 then setPedSkin ( thePlayer, 276 ) end end addEventHandler ( "onPickupUse", skin, pickupskin ) -- ------------------------------------------------------------------------------------------------ skin2 = createPickup (1178.631, -1383.197, 13.637, 3, 1275, 0 ) function pickupskin2 ( thePlayer ) local accName = getAccountName(getPlayerAccount(thePlayer)) if getElementData(thePlayer, "char.factionDuty") == 26 then setPedSkin ( thePlayer, 231 ) end end addEventHandler ( "onPickupUse", skin2, pickupskin2 ) -- ------------------------------------------------------------------------------------------------ skin3 = createPickup (1146.488, -1382.93, 13.859, 3, 1275, 0 ) function pickupskin3 ( thePlayer ) local accName = getAccountName(getPlayerAccount(thePlayer)) if getElementData(thePlayer, "char.factionDuty") == 26 then setPedSkin ( thePlayer, 274 ) end end addEventHandler ( "onPickupUse", skin3, pickupskin3 ) -- ------------------------------------------------------------------------------------------------ skin4 = createPickup (1146.518, -1378.538, 13.858, 3, 1275, 0 ) function pickupskin4 ( thePlayer ) local accName = getAccountName(getPlayerAccount(thePlayer)) if getElementData(thePlayer, "char.factionDuty") == 26 then setPedSkin ( thePlayer, 253 ) end end addEventHandler ( "onPickupUse", skin4, pickupskin4 ) -- ------------------------------------------------------------------------------------------------ skin6 = createPickup (1173.732, -1383.5, 13.671, 3, 1275, 0 ) function pickupskin6 ( thePlayer ) local accName = getAccountName(getPlayerAccount(thePlayer)) if getElementData(thePlayer, "char.factionDuty") == 26 then setPedSkin ( thePlayer, 70 ) end end addEventHandler ( "onPickupUse", skin6, pickupskin6 ) -- ------------------------------------------------------------------------------------------------ skin7 = createPickup (1169.075, -1383.584, 13.703, 3, 1275, 0 ) function pickupskin7 ( thePlayer ) local accName = getAccountName(getPlayerAccount(thePlayer)) if getElementData(thePlayer, "char.factionDuty") == 26 then setPedSkin ( thePlayer, 278 ) end end addEventHandler ( "onPickupUse", skin7, pickupskin7 )
  19. Ola não sei se esse é o local certo para falar sobre tal assunto. Quando faço um mapa e removo objetos do proprio servidor da um bug as coisas ficam sumindo, quando chego mais perto da um lag ai as coisas aparece. Ja fiz um teste colocando pouca coisa no mapa pra ver se era um sobrecarregamento do cliente mas não é, ja coloquei um script que da de definir a distancia que posso ver o objeto mas não funcionou.Vi aqui no forum que ocorre quando tiramos um objeto original do game. Alguem teria uma soluçao ou dica para me ajudar a resolver esse problema. Ficarei agradecido se aguem me ajudar.
  20. Ola, vocês poderiam me ajudar a fazer um sistema de payday que paga somente as pessoas que estão no grupo(Utilizo banco da dados MYSQL). Segui abaixo o script function Funcionar (source) local Money_Pagamento = 1000 outputChatBox ('#FF6565 -------- Pagamento do Banco --------',getRootElement(),255,255,255,true) outputChatBox (' ',getRootElement(),255,255,255,true) outputChatBox ('#80FF00 O Banco Lhe Pagou: #FFFFFF'..Money_Pagamento,getRootElement(),255,255,255,true) outputChatBox (' ',getRootElement(),255,255,255,true) givePlayerMoney (getRootElement(),Money_Pagamento) end setTimer (Funcionar,5000,0) Eu tinha feito um script de abrir um portão e funcionou myGate1 = createObject ( 980, 1540.6999511719,-1625.9000244141 ,15.10000038147,360, 360, 90 ) Zona = createColCircle ( 1540.303, -1626.207, 6, 6 ) function Portao1(thePlayer) if getElementData(thePlayer, "char.factionID") == 190 then moveObject (myGate1, 3000, 1540.7001953125,-1625.900390625,20.39999961853 ) end end addEventHandler ( "onColShapeHit", Zona, Portao1 ) function Portao2(thePlayer) if getElementData(thePlayer, "char.factionID") == 190 then moveObject (myGate1, 3000, 1540.6999511719,-1625.9000244141 ,15.10000038147 ) end end addEventHandler ( "onColShapeLeave", Zona, Portao2 ) Preciso que só as pessoas que estajam no "(cha.factionID) == 190 " recebam o pagamento. No script do portão foi facil fazer, mas o payday ta complicado.
  21. Fiz isso ai ja o objeto aparece mas invisivel.
  22. Alguem pode me ajudar, quero colocar um objeto de uma porta em um interior. Preciso saber onde coloco o setElementInterior e o setElementDimension. Ja tentei aqui mais o objeto fica invisivel no interior. myGate1 = createObject ( 980, 1540.6999511719,-1625.9000244141 ,15.10000038147,360, 360, 90 ) Zona = createColCircle ( 1540.303, -1626.207, 6, 6 ) function Portao1(thePlayer) if getElementData(thePlayer, "char.factionID") == 190 then moveObject (myGate1, 3000, 1540.7001953125,-1625.900390625,20.39999961853 ) end end addEventHandler ( "onColShapeHit", Zona, Portao1 ) function Portao2(thePlayer) if getElementData(thePlayer, "char.factionID") == 190 then moveObject (myGate1, 3000, 1540.6999511719,-1625.9000244141 ,15.10000038147 ) end end addEventHandler ( "onColShapeLeave", Zona, Portao2 )
×
×
  • Create New...