Ir para conteúdo

Featured Replies

Postado

Boa noite a todos do TK, venho caridosamente pedir o suporte de vocês é claro se poderem ...
Estou com o seguinte problema, eu tenho o script pra dar o SKULL correto conforme a quantia de frags.

 

Aqui está o script que uso:

Spoiler

function onLogin(cid)
    if(getPlayerFrags(cid) >= 5 and getPlayerFrags(cid) < 7)then
        doCreatureSetSkullType(cid, 2)
    elseif(getPlayerFrags(cid) >= 8 and getPlayerFrags(cid) < 10)then
        doCreatureSetSkullType(cid, 3)
    elseif(getPlayerFrags(cid) >= 11 and getPlayerFrags(cid) < 13)then
        doCreatureSetSkullType(cid, 1)
    elseif(getPlayerFrags(cid) >= 14)then
        doCreatureSetSkullType(cid, 4)
    end
    return true
end

Essa função é um LOGIN.. Mas aparentemente quando abro o servidor ela não da problema, mas quando vou logar qualquer CHARACTER ele da a seguinte mensagem.. Segue anexo:

 

 

 

dsdsadsadsad.jpg

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

Resolvido por Lyu

Ir para solução
  • Respostas 8
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Procurei a função aqui, não testei, mas adicione-a em data/lib/050-function.lua e veja se resolve o seu problema. function getPlayerFrags(cid) local time = os.time() local times = {today = (time

  • Está faltando a função getPlayerFrags.

  • @Andersen96 Setá conforme o nome .. SKULL_WHITE , SKULL_YELLOW , SKULL_RED , SKULL_BLACK .. você pode usar em mods seria até melhor  PS: é do skyforever , você não falo qual versão era e tal

Posted Images

Postado
  • Solução
4 minutos atrás, Andersen96 disse:

@Lyu E como adiciono ela? poderia explicar melhor? <3

 

Procurei a função aqui, não testei, mas adicione-a em data/lib/050-function.lua e veja se resolve o seu problema.

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

 

Postado
  • Autor

@Lyu Perfeito !!! Se poder me ajudar em uma ultima coisinha agradeço...
 

Spoiler

function onKill(cid, target, lastHit)
    
    if(getPlayerFrags(cid) >= 5 and getPlayerFrags(cid) < 6) and getPlayerStorageValue(cid, 7000) ~= 1 then
        doCreatureSetSkullType(cid, 2)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Green Skull! You have killed 500 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 500 players, he received the emblem - Green Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7000, 1)
    elseif(getPlayerFrags(cid) >= 7 and getPlayerFrags(cid) < 8) and getPlayerStorageValue(cid, 7001) ~= 1 then
        doCreatureSetSkullType(cid, 3)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained White Skull! You have killed 2500 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 2500 players, he received the emblem - White Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7001, 1)
    elseif(getPlayerFrags(cid) >= 9 and getPlayerFrags(cid) < 10) and getPlayerStorageValue(cid, 7002) ~= 1 then
        doCreatureSetSkullType(cid, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Yellow Skull! You have killed 5000 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 5000 players, he received the emblem - Yellow Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7002, 1)
    elseif(getPlayerFrags(cid) >= 11 and getPlayerFrags(cid) < 100000) and getPlayerStorageValue(cid, 7003) ~= 1 then
        doCreatureSetSkullType(cid, 4)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Red Skull! You have killed 10000 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 10000 players, he received the emblem - Red Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7003, 1)
    end
    return true
end

Este script era pra trocar o SKULL quando avançasse os FRAGS requerido, ou seja.. EX: tenho 6 frags que é TYPESKULL: 2 quando mato um player deveria trocar para a caveira de FRAGS 7 que seria a TYPE: 1 .. Mas não está trocando após chegar nos frags requeridos. 

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