Jump to content

[Ayuda] KDR Negativo (-4.34)


Narutimmy

Recommended Posts

Hola vengo por ayuda jeje ya le busque y nose porque pasa eso que el KDR queda en negativo como en la foto..

10387607_816713005047169_6972551675294151167_n.jpg?oh=bd42ee74527a74b98b309b701c6e0ea0&oe=54E65939&__gda__=1424155401_e95f1e92781a09c5e24ec52e93a645f8

el codigo es este... :S

setElementData(source,"TD",(getElementData(source,"TD") - 1)) 
  valor = getElementData(source,"TK")/getElementData(source,"TD") 
  setElementData(source,"KDR",math.round(valor,2,'ceil')) 
  
   
  triggerClientEvent(source, "hideInventoryManual", source) 
  if getElementData(source, "alivetime") > 10 and not isElementInWater(source) then 
    local x, y, z = getElementPosition(source) 
    if getDistanceBetweenPoints3D(x, y, z, 6000, 6000, 0) > 200 then 
      local x, y, z = getElementPosition(source) 
      local rotX, rotY, rotZ = getElementRotation(source) 
      local skin = getElementModel(source) 
      local ped = createPed(skin, x, y, z, rotZ) 
      pedCol = createColSphere(x, y, z, 1.5) 
      killPed(ped) 
      setTimer(destroyDeadPlayer, 2700000, 1, ped, pedCol) 
      attachElements(pedCol, ped, 0, 0, 0) 
      setElementData(pedCol, "parent", ped) 
      setElementData(pedCol, "playername", getPlayerName(source)) 
      setElementData(pedCol, "deadman", true) 
      setElementData(pedCol, "MAX_Slots", getElementData(source, "MAX_Slots")) 
      local time = getRealTime() 
      local hours = time.hour 
      local minutes = time.minute 
      setElementData(pedCol, "deadreason", getPlayerName(source) .. " is dead. Cause of death: " .. (weapon or "Unknown") .. ". Time of death: " .. hours .. ":" .. minutes .. " o'clock.") 
    end 
  end 
  if killer then 
    if not getElementData(source, "bandit") then 
      addPlayerStats(killer, "humanity", math.random(-2500, -1000)) 
    else 
      addPlayerStats(killer, "humanity", math.random(1000, 2500)) 
    end 
    setElementData(killer, "murders", getElementData(killer, "murders") + 1) 
    setElementData(killer, "Reputacion", getElementData(killer, "Reputacion")+10) 
    setElementData(killer,"TK",(getElementData(killer,"TK"))+ 1) 
    valor = getElementData(killer,"TK")/getElementData(killer,"TD") 
    setElementData(killer,"KDR",math.round(valor,2,'ceil')) 
  
    triggerClientEvent(killer, "displayClientInfo", killer, "Info", "Reputacion +10", 200, 200, 22) 
    if 0 > getElementData(killer, "humanity") then 
      setElementData(killer, "bandit", true) 
    end 
    if getElementData(source, "bandit") == true then 
      setElementData(killer, "banditskilled", getElementData(killer, "banditskilled") + 1) 
      setElementData(killer, "Reputacion", getElementData(killer, "Reputacion")+20) 
      triggerClientEvent(killer, "displayClientInfo", killer, "Info", "Reputacion +20", 200, 200, 22) 
    end 
    if headshot == true then 
      setElementData(killer, "headshots", getElementData(killer, "headshots") + 1) 
      setElementData(killer, "Reputacion", getElementData(killer, "Reputacion")+50) 
      triggerClientEvent(killer, "displayClientInfo", killer, "Info", "Reputacion +50", 200, 200, 22) 
    end 
  end 

Gracias :)

Link to comment
¿Esto sucede siempre o solo en situaciones especificas?

Tiene 2 problemas...

1.- Al matar a alguien en lugar de aumentar baja si estaba nose -4 pasa a -5.

ademas se supone nose matas 10 mueres 200 veces = 0,05 ... en teoria el kdr no deberia de bajar de 0

2.- Ademas si te suicidas o mueres solo te toma como el kille y te da una muerte y un asesinato.

EDIT: Arreglado pasa que

setElementData(source,"TD",(getElementData(source,"TD") - 1)) 

en realidad era

setElementData(source,"TD",(getElementData(source,"TD") + 1)) 

jeje Gracias.

Link to comment
  • Recently Browsing   0 members

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