Bom galera esté o primeiro Script que posto.
Percebi que na Internet é muito complicado de achar algum Script Frag Counter funcional e mais impossível ainda com comando !rank.
Trago a você meus Scripts:
Frag Counter ganhando Determinada Experiencia!
Vá até Data/CreatureScripts/Scripts e crie 3 arquivos .lua com os seguintes nomes: kill.lua, killhigh.lua, killlow.lua
Abra o Kill.lua e coloque o seguinte:
-- Original script created by MaxLinux or Sciter -- Frag Counter with Experience Reward --
function onKill(cid, target)
local frags = (getPlayerStorageValue(cid, 90190))
local killed = (getPlayerName(target))
if(isPlayer(cid) and isPlayer(target)) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
if getPlayerLevel(cid) == getPlayerLevel(target) then
doPlayerAddExperience(cid, 1000000)
doSendAnimatedText(getPlayerPosition(cid), "1000000", TEXTCOLOR_WHITE)
setPlayerStorageValue(cid, 90190, (getPlayerStorageValue(cid, 90190) + 1))
doPlayerSendTextMessage(cid,20,"Voce matou " .. killed .. ", agora voce tem " .. frags .. " frags!")
return TRUE
end
return TRUE
end
end
end
Edite os Valores em Verde Claro para a Experiencia que será adquirida ao matar o outro jogador.
Nos outros 2 arquivos, killlow.lua e killhigh.lua edite os 2 da mesma forma porem ganhando menos e mais experiência em cada um deles. (Dica: Edite os valores com adição e redução de 50% da experiência para não haver absurdos de Experiênce Gain nem Power Abuse para ganhar Experiência sempre.)
Após tudo isso feito vá até Data/CreatureScripts/CreatureScripts.xml abra-o e cole o seguinte:
<event type="kill" name="Kill" event="script" value="kill.lua"/> <event type="kill" name="KillLow" event="script" value="killlow.lua"/> <event type="kill" name="KillHigh" event="script" value="killhigh.lua"/>
Look Frags, dê look e veja quantos ele matou!
Vá até Data/CreatureScripts/Scripts e crie um arquivo .lua e depois renomeio de look.lua, abra-o e cole o seguinte:
-- Original script edited by MaxLinux or Sciter -- Look Frags -- function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,' [Frags: '..getPlayerStorageValue(thing.uid, 90190)..']') return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,' [Frags: '..getPlayerStorageValue(cid, 90190)..']') local string = 'Você vê a si mesmo.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'Health: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'IP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'Position: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
Depois de ter feito isso vá até Data/CreatureScripts/creaturescripts.xml abra-o e cole o seguinte:
<event type="login" name="fraglook_register" event="script" value="look.lua"/> <event type="look" name="fraglook" event="script" value="look.lua"/>
Agora o Sistema de !rank frags, veja quem é o maior assassino de seu Servidor!
Primeiro vá até Data\TalkActions\Scripts crie um arquivo .lua com o nome de ranks.lua, depois de feito isso abra-o e coloque o seguinte:
-- Original script edited by MaxLinux or Sciter -- Ranking Frags -- function getPlayerNameByGUID2(n) local c = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..n..";") if c:getID() == -1 then return "SQL_ERROR["..n.."]" end return c:getDataString("name") end function onSay(cid, words, param) local max = 10 local letters_to_next = 20 local skills = { ['fist'] = 0, ['club'] = 1, ['sword'] = 2, ['axe'] = 3, ['distance'] = 4, ['shielding'] = 5, ['fishing'] = 6, ['dist'] = 4, ['shield'] = 5, ['fish'] = 6, } local name_now local name = "Highscores\n" local rkn = 0 local no_break = 0 param = string.lower(param) dofile('config.lua') if param == "" or param == "level" and ( param ~= "magic" and param == "ml") and skills[param] == nil then name = name.."\n" name = name.."Ranking Level - Nome do Jogador\n" local v = db.getResult("SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` <= 2 ORDER BY `experience` DESC LIMIT 0,"..(max)..";") repeat no_break = no_break +1 if v:getID() == -1 then break end rkn = rkn+1 name_now, l = v:getDataString("name"), string.len(v:getDataString("name")) space = "" for i=1, letters_to_next-l do space = space.." " end name = name..rkn..". ["..v:getDataInt("level") .."] - "..name_now..space.." ".."\n" if no_break >= 20 then break end until v:next() == false elseif param == "magic" or param == "ml" then name = name.."\n" name = name.."Ranking Magic - Nome do Jogador\n" local v = db.getResult("SELECT `name`, `level`, `maglevel` FROM `players` WHERE `group_id` <= 2 ORDER BY `maglevel` DESC LIMIT 0,"..(max)..";") repeat if v:getID() == -1 then break end rkn = rkn+1 name_now, l = v:getDataString("name"), string.len(v:getDataString("name")) space = "" for i=1, letters_to_next-l do space = space.." " end name = name..rkn..". ["..v:getDataInt("maglevel").."] - "..name_now..space.." ".." ".."".."\n" until v:next() == false elseif param == "kills" or param == "killer" or param == "kill" or param == "frag" or param == "frags" then name = name.."\n" name = name.."Ranking Frags\n" local v = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = 90190 ORDER BY cast(value as INTEGER) DESC;") local kk = 0 repeat if kk == max or v:getID() == -1 then break end kk = kk+1 name_now, l = getPlayerNameByGUID2(v:getDataInt("player_id")), string.len(getPlayerNameByGUID2(v:getDataInt("player_id"))) space = "" for i=1, letters_to_next-l do space = space.." " end if name_now == nil then name_now = 'sql error['..v:getDataInt("player_id")..']' end name = name..kk..". ["..v:getDataInt("value").."] - "..name_now..space.." \n" until v:next() == false elseif skills[param] ~= nil then name = name.."\n" name = name.."Ranking "..param.." fighting - Nome do Jogador\n" local v = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..skills[param].." ORDER BY `value` DESC;") local kk = 0 repeat if kk == max or v:getID() == -1 then break end kk = kk+1 name_now, l = getPlayerNameByGUID2(v:getDataInt("player_id")), string.len(getPlayerNameByGUID2(v:getDataInt("player_id"))) space = "" for i=1, letters_to_next-l do space = space.." " end if name_now == nil then name_now = 'sql error['..v:getDataInt("player_id")..']' end name = name..kk..". ["..v:getDataInt("value").."] - "..name_now..space.." \n" until v:next() == false end if name ~= "Highscore\n" then doPlayerPopupFYI(cid, name) end return TRUE end
Depois de fazer isso vá até Data/TalkActions/TalkActions.xml abra-o e procure pela parte dos comandos usados por Players e coloque o seguinte:
<talkaction words="!rank" script="ranks.lua"/>
Salve e feche.
E agora para o fim do Tópico, comando !kills
Primeiro vá até Data/TalkActions/Scripts crie um arquivo .lua e renomeio de kills.lua, abra-o e coloque o seguinte:
-- Original script created by MaxLinux or Sciter -- Check Kills -- function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have " .. getPlayerStorageValue(cid, 90190) .. " kills.") return true end
Depois vá até Data/TalkActions/TalkActions.xml abra-o e procure pela parte dos comandos de Players e coloque o seguinte:
<talkaction words="!kills" event="script" value="kills.lua"/>
Salve e feche.
Bom, espero que tenham gostado. Para aqueles que gostaram muito, por favor não deixar de dar seu REP+ que ficarei muito agradecido.
Todos os Scripts, alguns foram apenas editados e alguns foram criados por mim.
Created By Sciter.
Created By Max Linux.
OBS SOU OS DOIS, É QUE USO OS DOIS NICKS.