Narutimmy Posted October 30, 2014 Share Posted October 30, 2014 Hola vengo por ayuda jeje ya le busque y nose porque pasa eso que el KDR queda en negativo como en la foto.. el codigo es este... 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
Alexs Posted October 30, 2014 Share Posted October 30, 2014 ¿Esto sucede siempre o solo en situaciones especificas? Link to comment
Narutimmy Posted October 31, 2014 Author Share Posted October 31, 2014 ¿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
Recommended Posts