Jump to content

[HELP] MOD PRISÃO


Recommended Posts

Fala galera, necessito da ajuda de vocês...

Vamos lá, esse script pega o player matou o outro, dá 200$ e duas estrelas, então eu quero fazer como está no código.... quando chegar a 6 estrelas ele é preso por 60 segundos e sendo setado pra uma prisão dps voltar pro msm lugar que ele tava ao chegar as 6 estrelas...

Obrigado teste já...

function StarKill ( ammo, killer, killerweapon, Vehicle, bodypart )

  if ( killer ) and ( killer ~= source ) then
   x,y,z = getElementPosition(killer)
   local  procurado = getPlayerWantedLevel (killer)
  

  if procurado == 0 then    
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 2)
    elseif procurado == 2 then
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 4)
    elseif procurado == 4 then
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 6)
  elseif procurado == 6 then
     setPlayerWantedLevel (killer,0)
     removePedFromVehicle (killer)   
   setElementPosition (killer, 2587.328125, 2067.626953125, 10.8203125) 
     outputChatBox ("[PENITENCIÁRIA] - #ff0000Você foi preso por 60 segundos...",killer,80,80,80,true)
     outputChatBox ("[PENITENCIÁRIA] - " .. getPlayerName(killer) .. "#ff0000 foi preso por 60 segundos...",source,80,80,80,true)
   setElementFrozen (killer)
   setTimer (backlocation(killer) setElementPosition, 120000, 1)
  else  
    givePlayerMoney ( killer, 200 )    
  end
end
end
addEventHandler ( "onPlayerWasted", getRootElement(), StarKill )

function backlocation (killer)
setElementPosition (killer,x,y,z+1)

end

~Marcos: Owner and Developer

Fórum: http://infeczumbi.hol.es

server IP: mtasa://198.100.158.105:22003

Link to comment
function StarKill ( ammo, killer, killerweapon, Vehicle, bodypart )

  if ( killer ) and ( killer ~= source ) then
   x,y,z = getElementPosition(killer)
   setElementData(killer, "positions", {x, y, z});
   local  procurado = getPlayerWantedLevel (killer)
  

  if procurado == 0 then    
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 2)
    elseif procurado == 2 then
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 4)
    elseif procurado == 4 then
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 6)
  elseif procurado == 6 then
     setPlayerWantedLevel (killer,0)
     removePedFromVehicle (killer)   
   setElementPosition (killer, 2587.328125, 2067.626953125, 10.8203125) 
     outputChatBox ("[PENITENCIÁRIA] - #ff0000Você foi preso por 60 segundos...",killer,80,80,80,true)
     outputChatBox ("[PENITENCIÁRIA] - " .. getPlayerName(killer) .. "#ff0000 foi preso por 60 segundos...",source,80,80,80,true)
   setElementFrozen (killer, true)
   setTimer (function () 
       backlocation(killer) 
   end, 120000, 1)
  else  
    givePlayerMoney ( killer, 200 )    
  end
end
  
function backlocation (killer)
local x, y, z = unpack(getElementData(killer, "positions"))
setElementPosition (killer,x,y,z+1)

end
end
addEventHandler ( "onPlayerWasted", getRootElement(), StarKill )

 

Link to comment

Uma dúvida que eu sempre tive...

setElementData salva o banco?

On 05/11/2016 at 5:18 PM, MrDante said:

function StarKill ( ammo, killer, killerweapon, Vehicle, bodypart )

  if ( killer ) and ( killer ~= source ) then
   x,y,z = getElementPosition(killer)
   setElementData(killer, "positions", {x, y, z});
   local  procurado = getPlayerWantedLevel (killer)
  

  if procurado == 0 then    
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 2)
    elseif procurado == 2 then
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 4)
    elseif procurado == 4 then
    givePlayerMoney ( killer, 200 )
    setPlayerWantedLevel ( killer, 6)
  elseif procurado == 6 then
     setPlayerWantedLevel (killer,0)
     removePedFromVehicle (killer)   
   setElementPosition (killer, 2587.328125, 2067.626953125, 10.8203125) 
     outputChatBox ("[PENITENCIÁRIA] - #ff0000Você foi preso por 60 segundos...",killer,80,80,80,true)
     outputChatBox ("[PENITENCIÁRIA] - " .. getPlayerName(killer) .. "#ff0000 foi preso por 60 segundos...",source,80,80,80,true)
   setElementFrozen (killer, true)
   setTimer (function () 
       backlocation(killer) 
   end, 120000, 1)
  else  
    givePlayerMoney ( killer, 200 )    
  end
end
  
function backlocation (killer)
local x, y, z = unpack(getElementData(killer, "positions"))
setElementPosition (killer,x,y,z+1)

end
end
addEventHandler ( "onPlayerWasted", getRootElement(), StarKill )

 

vou testar aqui mano... 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...