What's new
  • logo_cipsoft
    Latest servers:
    New servers will open on: 19th Feb 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Talkactions Simple exp ranking

Status
Not open for further replies.

3dzio

Active User
Joined
Jun 6, 2009
Messages
83
Reaction score
7
Po wpisaniu komendy !myrank pokazuje nasz? pozycj? w rankingu expa OTS'a, czyli nasz? pozycj? w levelach serwera. To m?j 2 kod wi?c r?wnie? prosz? o wyrozumia?o??.

Tworzymy talkactions\scripts\simplerank.lua:
PHP:
-- simple personal ranking
-- Created by Layflette/Fec/3dzio

function onSay(cid, words, param)
	local best_list = db.getResult("SELECT `level`,`name` FROM `players` WHERE `group_id` < '2' AND `account_id` > '1' ORDER BY `experience` DESC;")
	local player_name = getPlayerName(cid)
	local count = 1
	if best_list:getID() ~= -1 then
		while true do
			local currName = best_list:getDataString('name')
			if currName == player_name then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are in the ' .. count .. ' place !')
			else
				count = count + 1
			end
			if not best_list:next() then break end
		end
	end
	best_list:free()
	return TRUE
end

W talkactions.xml dodajemy
PHP:
<talkaction words="!myrank" script="simplerank.lua"/>
Testowane na tfs 0.2.15.r102 mystic spirit.
 

ersiu

Active User
Joined
Apr 7, 2008
Messages
95
Reaction score
7
Odp: Simple exp ranking

naprawd?? trzeba jebn?? p?tle na wszystkich graczy z bazy danych, ?eby sprawdzi? swoj? pozycj?? : (

- ogarnij numerowanie i zr?b wydajnie jak dajesz pod publike :)
 
Last edited:

Dubler

Lua Factory =)
Joined
Apr 8, 2009
Messages
1,874
Reaction score
111
Odp: Simple exp ranking

mistrzu, exhaust exhaust bo Ci baz? udusz?
 

Placek

Blue Waffle
Joined
Sep 30, 2008
Messages
6,793
Reaction score
667
Age
9
Odp: Simple exp ranking

Tym to nawet bez exhaustu udusza... 3 czy 4 osoby wpisza na raz i dupa. Ewentualnie z 10...
 
Status
Not open for further replies.
Top