CR
pedido

Rank De Reset

Por Crazyskezi, 15 de out. de 2012 em Scripts

3
991
CrazyskeziC
15 de outubro de 2012 às 08:37

Bom, dia. Eu gostaria de pedir a Vocês um sistema de !rank reset, Pois sempre quando tentei instalar um desses q esta nesses topicos a janelinha do meu rank ficou toda cinza.Oks ? Gostaria mt da ajuda de voces, meu SV É 8.50.

 

 

+ Rep Para Quem ajudar !

jhon992J
15 de outubro de 2012 às 09:11

Se o teu sistema de reset for por storage esse script irá resolver:

 

talkactions/scripts/rankreset.lua

local storageRank = 59381 -- storage que salva resets

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)
if (param == "") then
  doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você possui "..getPlayerStorageValue(cid, storageRank).." resets.")
  return true
end
if (param == "rank") then
local max = 50
local letters_to_next = 50
local name_now
local name = "Highscore for Reputação\n"
local rkn = 0
local no_break = 0
name = name.."\n"
name = name.."Rank. Reset | Nome do Jogador\n"
local v = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = ".. storageRank .." 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
if name ~= "Highscore\n" then
	doPlayerPopupFYI(cid, name)
end
return true
else
doPlayerSendCancel(cid, "Command valid: !reset, !reset rank.")
end
return true
end

 

talkactions.xml

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

Editado Outubro 15 por Jhon992

CrazyskeziC
17 de outubro de 2012 às 14:47

Se o teu sistema de reset for por storage esse script irá resolver:

 

talkactions/scripts/rankreset.lua

local storageRank = 59381 -- storage que salva resets

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)
if (param == "") then
  doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você possui "..getPlayerStorageValue(cid, storageRank).." resets.")
  return true
end
if (param == "rank") then
local max = 50
local letters_to_next = 50
local name_now
local name = "Highscore for Reputação\n"
local rkn = 0
local no_break = 0
name = name.."\n"
name = name.."Rank. Reset | Nome do Jogador\n"
local v = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = ".. storageRank .." 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
if name ~= "Highscore\n" then
	doPlayerPopupFYI(cid, name)
end
return true
else
doPlayerSendCancel(cid, "Command valid: !reset, !reset rank.")
end
return true
end

 

talkactions.xml

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

 

Valew ae lek + REP ajudou mtt