Ir para conteúdo

Featured Replies

Postado
  • Autor

@Vodkart acredito eu que esteja relacionado aqui             

local targetKills = (getPlayerStorageValue(cid, config.killStorageValue) > 0 and getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = (getPlayerStorageValue(cid, config.deathStorageValue) > 0 and getPlayerStorageValue(cid, config.deathStorageValue)) + 1
            
            local killerKills = (getPlayerStorageValue(killer, config.killStorageValue) > 0 and getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = (getPlayerStorageValue(killer, config.deathStorageValue) > 0 and getPlayerStorageValue(killer, config.deathStorageValue)) + 1

  • Respostas 13
  • Visualizações 400
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
Em 05/12/2016 ás 20:28, helix758 disse:

@Vodkart acredito eu que esteja relacionado aqui             

local targetKills = (getPlayerStorageValue(cid, config.killStorageValue) > 0 and getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = (getPlayerStorageValue(cid, config.deathStorageValue) > 0 and getPlayerStorageValue(cid, config.deathStorageValue)) + 1
            
            local killerKills = (getPlayerStorageValue(killer, config.killStorageValue) > 0 and getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = (getPlayerStorageValue(killer, config.deathStorageValue) > 0 and getPlayerStorageValue(killer, config.deathStorageValue)) + 1

 

acho que n mas tenta

 

local targetKills = getPlayerStorageValue(cid, config.killStorageValue) <= 0 and 1 or getPlayerStorageValue(cid, config.killStorageValue)+1
local targetDeaths = getPlayerStorageValue(cid, config.deathStorageValue) <= 0 and 1 or getPlayerStorageValue(cid, config.deathStorageValue)+1
            
local killerKills = getPlayerStorageValue(killer, config.killStorageValue) <= 0 and 1 or getPlayerStorageValue(killer, config.killStorageValue)+1
local killerDeaths = getPlayerStorageValue(killer, config.deathStorageValue) <= 0 and 1 or getPlayerStorageValue(killer, config.deathStorageValue)+1

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
Spoiler

local c = {
	affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
	killStorageValue = 3943,
	deathStorageValue = 3944,
	-- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
	rewardItem = {
		use = true,
		itemid = 5953,
		minLevel = false, -- false if you don't want any level req
		minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
	},
	killMessage = {
		use = true,
		text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
		messageClass = MESSAGE_STATUS_CONSOLE_BLUE
	},
	killerAnimation = {
		use = false,
		text = "Frag!", -- Only 9 letters! No "commands" here.
		color = 1
	},
	targetAnimation = {
		use = false,
		text = "OWNED!!", -- Only 9 letters! No "commands" here.
		color = 180
	}
}

function onDeath(cid, corpse, deathList)
	for i = 1, math.min(c.affected, #deathList) do
		local killer = deathList[i]
		if(isPlayer(killer)) then
			if(getPlayerIp(cid) == getPlayerIp(killer)) then
				return true
			end
			local targetKills = math.max(tonumber(getCreatureStorage(cid, c.killStorageValue)) or 0, 0) + 1
			local targetDeaths = math.max(tonumber(getCreatureStorage(cid, c.deathStorageValue)) or 0, 0) + 1
			
			local killerKills = math.max(tonumber(getCreatureStorage(killer, c.killStorageValue)) or 0, 0) + 1
			local killerDeaths = math.max(tonumber(getCreatureStorage(killer, c.deathStorageValue)) or 0, 0) + 1
			
			doCreatureSetStorage(killer, c.killStorageValue, killerKills)
			doCreatureSetStorage(cid, c.deathStorageValue, targetDeaths)
			local killerLevel = getPlayerLevel(killer)
			local targetLevel = getPlayerLevel(cid)
			local levelDiff = targetLevel - killerLevel
			local values = {
				["KILLERKILLS"] = killerKills,
				["KILLERDEATHS"] = killerDeaths,
				["KILLERNAME"] = getCreatureName(killer),
				["KILLERLEVEL"] = killerLevel,
				
				["TARGETKILLS"] = targetKills,
				["TARGETDEATHS"] = targetDeaths,
				["TARGETNAME"] = getCreatureName(cid),
				["TARGETLEVEL"] = targetLevel
			}
			local function formateString(str)
				local t = str:gsub("|(.-)|", function(a) return values[a] end)
				return t
			end
			
			if(c.rewardItem.use and (not c.rewardItem.minLevel or targetLevel >= c.rewardItem.minLevel) and (not c.rewardItem.minLevelDiff or levelDiff >= c.rewardItem.minLevelDiff)) then
				doPlayerAddItem(killer, c.rewardItem.itemid, 1)
			end
			if(c.killMessage.use) then
				doPlayerSendTextMessage(killer, c.killMessage.messageClass, formateString(c.killMessage.text))
			end
			if(c.killerAnimation.use) then
				doSendAnimatedText(getThingPos(killer), c.killerAnimation.text, c.killerAnimation.color)
			end
			if(c.targetAnimation.use) then
				doSendAnimatedText(getThingPos(cid), c.targetAnimation.text, c.targetAnimation.color)
			end
		end
	end
	return true
end

 

sem tempo pra testar

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo