marcryzius
New Member
- Joined
- Mar 22, 2009
- Messages
- 61
- Reaction score
- 0
with this script you can get the ranks of professions using storagesvalues.
and can be used by system resets.
getConfigInfo('maxranks')
add in config.lua or remove from script and put in place a number abover zero.
script exclusive OtLand not allow post in other forums.
report bugs in the script.
accept criticism and suggestions.
and can be used by system resets.
PHP:
--[[Marcryzius Devil]]--
function onSay(cid, words, param)
local players,result,str = getConfigInfo('maxranks'),nil,"Ranks by (Marcryzius D\'evil).\n"
local config ={
expml = {
['level'] = 'level',
['lvl'] = 'level',
['maglevel'] = 'maglevel',
['ml'] = 'maglevel'},
skills = {
['fist'] = 0,
['club'] = 1,
['sword'] = 2,
['axe'] = 3,
['distance'] = 4,
['shielding'] = 5,
['fishing'] = 6},
profi = {
['lenhador'] = 201,
['minerador'] = 202,
['agricultor'] = 203,
['ferreiro'] = 204,
['resets'] = 1020,--storage used from resets system
['woodcutter'] = 201,
['miner'] = 202,
['farmer'] = 203,
['blacksmith'] = 204}
}
if(config.expml[param])then
str = str.."(Name) {"..config.expml[param].."} [level].\n"
result = db.getResult("SELECT `name`, "..config.expml[param].." FROM `players` WHERE `group_id` <= 2 ORDER BY "..config.expml[param].." DESC LIMIT 0,"..players..";")
elseif(config.skills[param])then
str = str.."(Name) {"..param.."} [level].\n"
result = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..config.skills[param].." ORDER BY `value` DESC LIMIT 0,"..players..";")
elseif(config.profi[param])then
str = str.."(Name) {"..param.."} [level].\n"
result = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..config.profi[param].." ORDER BY `value` DESC LIMIT 0,"..players..";")
else
return TRUE,doPlayerSendTextMessage(cid,22,'invalid param.')
end
if(result:getID() ~= -1)then
for i=1,players do
if(config.expml[param])then
str = str.."\n "..i.."º ("..result:getDataString("name")..") - ["..result:getDataInt(""..config.expml[param].."").."]"
else
str = str.."\n "..i.."º ("..getName(result:getDataString("player_id"))..") - ["..result:getDataInt("value").."]"
end
if not(result:next())then
break
end
end
result:free()
end
doPlayerPopupFYI(cid, str)
return TRUE
end
add in config.lua or remove from script and put in place a number abover zero.
script exclusive OtLand not allow post in other forums.
report bugs in the script.
accept criticism and suggestions.
Last edited: