Ir para conteúdo

Featured Replies

  • Respostas 9
  • Visualizações 307
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

Pera, ultima tentativa uahuahsaush mas acho q n da, vamos ver.

 

troca o primeiro script por esse:

Spoiler

function getPlayerFrags(cid)
	local time = os.time()
	local times = {today = (time - 86400), week = (time - (7 * 86400))}
	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
	
	if(result:getID() ~= -1) then
		repeat
			local content = {date = result:getDataInt("date")}
			if(content.date > times.today) then
				table.insert(contents.day, content)
			elseif(content.date > times.week) then
				table.insert(contents.week, content)
	else
		table.insert(contents.month, content)
			end
		until not result:next()
		result:free()
	end

	local size = {
		day = table.maxn(contents.day),
		week = table.maxn(contents.week),
		month = table.maxn(contents.month)
	}
	return size.day + size.week + size.month
end

function onLogin(cid)
 local frags = getPlayerFrags(cid)
    if frags >= 10 and frags < 30 then
        doCreatureSetSkullType(cid, SKULL_YELLOW)
    elseif frags >= 30 and frags < 80 then 
        doCreatureSetSkullType(cid, SKULL_GREEN)
    elseif frags >= 80 and frags < 150 then
        doCreatureSetSkullType(cid, SKULL_WHITE)
    elseif frags >= 150 and frags < 300 then
        doCreatureSetSkullType(cid, SKULL_RED)
    elseif frags > 300 then
        doCreatureSetSkullType(cid, SKULL_BLACK)
    end
    return true
end

 

 

Postado
  • Autor
32 minutos atrás, Sekk disse:

Pera, ultima tentativa uahuahsaush mas acho q n da, vamos ver.

 

troca o primeiro script por esse:

  Mostrar conteúdo oculto


function getPlayerFrags(cid)
	local time = os.time()
	local times = {today = (time - 86400), week = (time - (7 * 86400))}
	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
	
	if(result:getID() ~= -1) then
		repeat
			local content = {date = result:getDataInt("date")}
			if(content.date > times.today) then
				table.insert(contents.day, content)
			elseif(content.date > times.week) then
				table.insert(contents.week, content)
	else
		table.insert(contents.month, content)
			end
		until not result:next()
		result:free()
	end

	local size = {
		day = table.maxn(contents.day),
		week = table.maxn(contents.week),
		month = table.maxn(contents.month)
	}
	return size.day + size.week + size.month
end

function onLogin(cid)
 local frags = getPlayerFrags(cid)
    if frags >= 10 and frags < 30 then
        doCreatureSetSkullType(cid, SKULL_YELLOW)
    elseif frags >= 30 and frags < 80 then 
        doCreatureSetSkullType(cid, SKULL_GREEN)
    elseif frags >= 80 and frags < 150 then
        doCreatureSetSkullType(cid, SKULL_WHITE)
    elseif frags >= 150 and frags < 300 then
        doCreatureSetSkullType(cid, SKULL_RED)
    elseif frags > 300 then
        doCreatureSetSkullType(cid, SKULL_BLACK)
    end
    return true
end

 

 

ele ta salvando a skull, mas não muda ela..

 

achei isso aq na pasta tbm.

Spoiler

function onThink(cid, interval)
    if(not isCreature(cid)) then
        return
    end

    local skull, skullEnd = getCreatureSkull(cid), getPlayerSkullEnd(cid)
    if(skullEnd > 0 and skull > SKULL_WHITE and os.time() > skullEnd and not getCreatureCondition(cid, CONDITION_INFIGHT)) then
        doPlayerSetSkullEnd(cid, 0, skull)
    end
end
 

 

Editado por Strung (veja o histórico de edições)

Postado

Não muda porque precisa da parte onKill pra alterar a skull, de qualquer maneira pra esse sistema rodar 100% você precisa de alteração nas sources.

 

Se tivesse procurado mais 1 pouquinho teria achado, testa ai.

 

Editado por Way20 (veja o histórico de edições)

 

 

 

Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito.

                                                                                                                                                                                                                                        Aristóteles 

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.6k

Informação Importante

Confirmação de Termo