Ir para conteúdo

Preciso De Aulguns Scirpts


exorcist

Posts Recomendados

Bom Pessoal Tenho uns talktions (!frag,!online.)eles estão com bugs nos scripts por isso se alguem tiver me passa.REP+ pra quem ajudar.

Versão:8.60

 

Para o !online use este aqui :

 

Va na pasta do seu OT data/talkactions/scripts , copie e cole um aruivo .lua , apague tudo que tem dentro , renomeie para online , e coloque isso :

 

local config = {

 

showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))

 

}

 

 

function onSay(cid, words, param, channel)

 

local players = getPlayersOnline()

 

local strings = {""}

 

 

local i, position = 1, 1

 

local added = false

 

for _, pid in ipairs(players) do

 

if(added) then

 

if(i > (position * 7)) then

 

strings[position] = strings[position] .. ","

 

position = position + 1

 

strings[position] = ""

 

else

 

strings[position] = i == 1 and "" or strings[position] .. ", "

 

end

 

end

 

 

if((config.showGamemasters or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) or not getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then

 

strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"

 

i = i + 1

 

added = true

 

else

 

added = false

 

end

 

end

 

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:")

 

for i, str in ipairs(strings) do

 

if(str:sub(str:len()) ~= ",") then

 

str = str .. "."

 

end

 

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)

 

end

 

 

return true

 

end

 

Depois va em talkactions.xml e adicione a seguinte linha :

 

<talkaction words="!online" event="script" value="online.lua"/>

 

 

Para !frag , esse aqui :

 

Va na pasta do seu OT data/talkactions/scripts , copie e cole um aruivo .lua , apague tudo que tem dentro , renomeie para frags , e coloque isso :

 

local config = {

 

useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),

 

advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))

 

}

 

 

function onSay(cid, words, param, channel)

 

if(not config.useFragHandler) then

 

return false

 

end

 

 

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 = {

 

name = result:getDataString("name"),

 

level = result:getDataInt("level"),

 

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)

 

}

 

if(config.advancedFragList) then

 

local result = "Frags gained today: " .. size.day .. "."

 

if(size.day > 0) then

 

for _, content in ipairs(contents.day) do

 

result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

 

end

 

 

result = result .. "\n"

 

end

 

 

result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."

 

if(size.week > 0) then

 

for _, content in ipairs(contents.week) do

 

result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

 

end

 

 

result = result .. "\n"

 

end

 

 

result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."

if(size.month > 0) then

 

for _, content in ipairs(contents.month) do

 

result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

 

end

 

 

result = result .. "\n"

 

end

 

 

local skullEnd = getPlayerSkullEnd(cid)

 

if(skullEnd > 0) then

 

result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)

 

end

 

 

doPlayerPopupFYI(cid, result)

 

else

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")

 

if(size.day > 0) then

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")

 

end

 

 

local skullEnd = getPlayerSkullEnd(cid)

 

if(skullEnd > 0) then

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))

 

end

 

end

 

 

return true

 

end

 

Depois va em talkactions.xml , e adicione a seguinte linha :

 

<talkaction words="!frag" event="script" value="frags.lua"/>

 

Se era isso que estava procurando , REP+ ? :button_ok:

Editado por StremeMakky
Link para o comentário
Compartilhar em outros sites

:/ nfuncionou aki ficou assim

[01/01/2000 12:43:53] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)

[01/01/2000 12:43:53] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/online.lua)

e o frags

data/lib/function.lua:432: attempt to index local 'str' (a boolean value)

[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)

Se puder me ajudar agradeço

Link para o comentário
Compartilhar em outros sites

:/ nfuncionou aki ficou assim

[01/01/2000 12:43:53] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)

[01/01/2000 12:43:53] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/online.lua)

e o frags

data/lib/function.lua:432: attempt to index local 'str' (a boolean value)

[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)

Se puder me ajudar agradeço

 

 

Qual a versão do OT ?

qual distro ta usando ?

Link para o comentário
Compartilhar em outros sites

A Versão Do ot é 8.60

um snowz pbot que eu passei pra 8.60

(as apastas que eu usei para mudar a versão era de um Alissow 8.60) :thumbsupsmiley:

Editado por neero102
Link para o comentário
Compartilhar em outros sites

Frags!

 

local config = {
       useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
       advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}

function onSay(cid, words, param, channel)
       if(not config.useFragHandler) then
               return false
       end

       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 = {
                               name = result:getDataString("name"),
                               level = result:getDataInt("level"),
                               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)
       }
       if(config.advancedFragList) then
               local result = "Frags gained today: " .. size.day .. "."
               if(size.day > 0) then
                       for _, content in ipairs(contents.day) do
                               result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
                       end

                       result = result .. "\n"
               end

               result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
               if(size.week > 0) then
                       for _, content in ipairs(contents.week) do
                               result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
                       end

                       result = result .. "\n"
               end

               result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
               if(size.month > 0) then
                       for _, content in ipairs(contents.month) do
                               result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
                       end

                       result = result .. "\n"
               end

               local skullEnd = getPlayerSkullEnd(cid)
               if(skullEnd > 0) then
                       result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
               end

               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, result)
       else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
               if(size.day > 0) then
                       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
               end

               local skullEnd = getPlayerSkullEnd(cid)
               if(skullEnd > 0) then
                       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
               end
       end

       return true
end

 

 

online

 

local config = {
showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))
}

function onSay(cid, words, param)
local players = getPlayersOnline()
local strings = {}

local i = 1
local position = 1
for _, pid in ipairs(players) do
	if(i > (position * 7)) then
		strings[position] = strings[position] .. ","
		position = position + 1
		strings[position] = ""
	else
		strings[position] = i == 1 and "" or strings[position] .. ", "
	end

	if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > getPlayerAccess(pid))) then
		strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
		i = i + 1
	end
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:")
for i, str in ipairs(strings) do
	if(str:sub(str:len()) ~= ",") then
		str = str .. "."
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
end

return TRUE
end

Editado por mulizeu
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...