Postado Novembro 8, 2018 6 anos 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: Editado Novembro 8, 2018 6 anos por Andersen96 (veja o histórico de edições)
Postado Novembro 8, 2018 6 anos Solução 4 minutos atrás, Andersen96 disse: @Lyu E como adiciono ela? poderia explicar melhor? 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 Novembro 8, 2018 6 anos 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.