Skrypty & Kody komenda !online

Status
Zamknięty.

ArtekXDPL94

User
Zarejestrowany
Dołączył
Kwiecień 20, 2016
Posty
20
Liczba reakcji
0
Napisze mi kto? nowy kod na komend? !online, chc?, aby dzia?a? identycznie jak ten pod 8.60 a dok?adnie, aby obok nicku postaci pojawia? si? tak?e jej poziom.
Chce, aby dzia?a? pod wersj? 8.10 na silniku Aries 0.4.0.

Gdy u?yje domy?lnego kodu z "cryingdamson 0.3.6 (8.60) V8.2"

Kod:
local ranks = {
[1] = {"Tutor"},
[2] = {"S. Tutor"},
[3] = {"GM"},
[4] = {"CM"},
[5] = {"Admin"}
}
 
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 getPlayerAccess(pid) == 0 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
 
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "-----------")
 
	local players2 = getPlayersOnline()
	local helpon = 0
	local rank = ""
	local str2 = ""
 
	for _, pid2 in ipairs(players2) do		
		if getPlayerAccess(pid2) > 0 then
			rank = ranks[getPlayerAccess(pid2)]
			str2 = str2 .. getCreatureName(pid2) .." ["..rank[1].."]  "
			helpon = helpon + 1
		end		
	end
	if helpon > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (helpon) .. " support player(s) online:")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str2)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no support players currently online.")
	end
	return true
end

Otrzymuje taki b??d:
error4png_sawnnha.png


Wie kto? czy da si? i jak to naprawi??
 
Odp: komenda !online

Wygrzeba?em z mojego TFS'a (0.4):
[Lua]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, "Lista graczy zalogowanych:")
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[/Lua]
 
Odp: komenda !online

Poprosz? list? funkcji z tego silnika, bo widz?, ?e to jaki? wynalazek.
 
Odp: komenda !online

Do tego silnika nie ma listy funkcji jak w TFS xd, trzeba se radzi? bez tego :)
 
Odp: komenda !online

Pisa?em Ci ju? w innym temacie, daj mi zawarto?? pliku luascript.cpp oraz (o ile posiadasz takie pliki, powinny znajdowa? si? w data/lib) 100-shortcut.lua oraz 050-function.lua.
Najlepiej na PW ?eby nie robi? w tematach syfu.
 
Odp: komenda !online

Polecam zmieni? silnik, bo jak nie masz tych plik?w to masz jakie? g?wno, a nie silnik. I to w dodatku bez source XD (brak luascript.cpp).
 
Status
Zamknięty.
Back
Do góry