Multi Theft Auto | Comunidade: [MTA:DayZ] - Tutorial Adicionando Sistema de coma

IMPORTANTE

Reporte de Scripts
- roubados
- créditos alterados
- pouca descrição ou nenhuma

envie um email para "mtasabr@gmail.com" com provas e evidencias.

O post será removido o mais breve possível

Att: Administração

quarta-feira, 5 de agosto de 2015

[MTA:DayZ] - Tutorial Adicionando Sistema de coma

Olá,
Hoje vou esta ensinado como Adicionar o Sistema de Coma.

Vamos Começar !
(Faça Backup - Nao serei responsável por qualquer modificação mal feita.)

Primeiramente Abrimos o Login.lua.
Procuramos por:

triggerClientEvent(player, "onClientPlayerDayZLogin", player)

Você Vai Ver Isso:


Abaixo Adicione:

triggerEvent("putPlayerInComaServer", player)

Ficando Assim:


Agora Salvamos, e Vamos Abrir o SurvivorSystem.lua.

No Final do Arquivo Adicionamos:

  1. -- em coma:
  2. local dyingPlayers = {}
  3. putPlayerInComaServer = function ()
  4.    if getElementData ( source, "blood" ) <= 2000 and getElementData ( source, "blood" ) > 0then
  5.       setPedAnimation ( source, "BEACH""Lay_Bac_Loop",-1,true,false,false)
  6.       toggleAllControls ( source, falsetruefalse)
  7.       toggleControl ( source, "jump"false)
  8.       setElementData ( source, "inComa"true)
  9.       table.insert ( dyingPlayers, source)
  10.       setTimer ( function( player )
  11.          dyingPlayers[tostring(player)] = false
  12.          if isElement( player ) then
  13.             if getElementData ( player"inComa") then
  14.                setElementData ( player"isDead"true)
  15.                toggleAllControls ( playertrue)
  16.                triggerEvent ( "kilLDayZPlayer"player)
  17.             end
  18.          end
  19.       end1200001, source)
  20.    end
  21. end
  22. addEvent("putPlayerInComa"true)
  23. addEventHandler("putPlayerInComa"getRootElement(), putPlayerInComaServer)
  24.  
  25. function useAdrenalin ( player )
  26.    local x,y,z = getElementPosition ( player )
  27.    local found = 0
  28.    for i, v in ipairs ( dyingPlayers ) do
  29.       if isElement ( v ) then
  30.          if getElementData ( v, "inComa" ) then
  31.             local x2, y2, z2 = getElementPosition ( v )
  32.             if getDistanceBetweenPoints3D ( x,y,z, x2, y2, z2 ) < 3 then
  33.                found = 1
  34.                toggleAllControls (v, true )
  35.                if getElementData(v, "brokenbone") then
  36.                   toggleControl (v, "jump"false)
  37.                end
  38.                setElementData (v, "inComa"false)
  39.                setPedAnimation (v, false)
  40.                toggleAllControls (v, falsefalsefalse)
  41.                table.remove ( dyingPlayers, i)
  42.                break
  43.             end
  44.          else
  45.             dyingPlayers[i] = nil
  46.          end
  47.       else
  48.          dyingPlayers[i] = nil
  49.       end
  50.    end
  51.    if found == 1 then
  52.       setElementData ( player,"Painkiller",getElementData(player,"Painkiller") -1)
  53.    end
  54. end

Salvamos.
Agora Vamos Em SurvivorSystem_client.lua.

Procuramos por:

function playerGetDamageDayZ ( attacker, weapon, bodypart, loss )

E Agora procuramos por:
if number == 3 then
setElementData(getLocalPlayer(),"pain",true)
end

E Adicionamos logo Abaixo:


  1. if getElementData(getLocalPlayer()"blood") <= 2000 and getElementData(getLocalPlayer(),"blood") > 0 and not getElementData(getLocalPlayer()"isDead") == true then
  2.    triggerServerEvent("putPlayerInComa"getLocalPlayer() ) -- coma, em seguida, remova
  3.   end

Ficando Assim:

Procuramos por:

function checkStats()

Subsistimos toda essa função por:
(ou Copie e Cole Abaixo toda essa função e desative a outra com
--[[ e --]] )


  1. function checkStats()
  2.  if getElementData(getLocalPlayer(),"logedin") then
  3.   if getElementData(getLocalPlayer(),"bleeding") > 20 then
  4.    setElementData(getLocalPlayer(),"blood",getElementData(getLocalPlayer(),"blood")-getElementData(getLocalPlayer(),"bleeding"))
  5.   else
  6.    setElementData(getLocalPlayer(),"bleeding",0)
  7.   end
  8.   if getElementData(getLocalPlayer()"blood") < 0 and notgetElementData(getLocalPlayer()"isDead") then
  9.    triggerServerEvent("kilLDayZPlayer"getLocalPlayer()falsefalse)
  10.    toggleAllControls ( true )
  11.    setElementData ( localPlayer, "inComa"false )
  12.   end
  13.  end
  14. end
  15. setTimer(checkStats,3000,0)

Ficando Assim:


 Salve e Pronto, foi adicionado o sistema de coma.
Teste seu server antes de colocar ele online com os players.

Criador do Sistema:
italo - MTAz

Tutorial Feito por:
MrBugsFive
Twitter - Facebook

O sistema pode ter bugs , então Teste antes de colocar no seu server com players !!

Nenhum comentário :

Postar um comentário

Postagens Aleatória

copyright © 2006-2014 Multi Theft Auto. All rights reserved.