wlj
retierd
- Joined
- Jan 7, 2009
- Messages
- 1,201
- Reaction score
- 1
Well i did think the thread pass in Support
second.
What is wrong i giv 2 rep++ :wub:
PHP:
function onSay(cid, words, param) if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end
local ret = getAccountIdByName(param) if(ret == 0) then
ret = getAccountIdByAccount(param) if(ret == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. param .. "' does not exists.") return TRUE
end
end
local list = getBanList(BANTYPE_NOTATION, ret)
if(type(list) ~= "table" or table.maxn(list) <= 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such account or player does not have any notation.")
return TRUE
end
ret = "Notations for account " .. ret .. "\n"
for i, ban in ipairs(list) do
local tmp = ban.adminId ~= 0 and getPlayerNameByGUID(ban.adminId) or "unknown" ret = ret .. "\nAdded at " .. os.date("%c", ban.added) .. " by " .. tmp .. " with reason: " .. getBanReason(ban.reason) .. " and comment: " .. ban.comment .. "."
end
doPlayerPopupFYI(cid, ret)
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
TRUE
end
PHP:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return TRUE
end
local t = string.explode(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough params.")
return TRUE
end
local multifloor = FALSE
if(t[3]) then
multifloor = getBooleanFromString(t[3])
end
local tmp = 0
local spectators = getSpectators(getCreaturePosition(cid), t[1], t[2], multifloor)
for i, tid in ipairs(spectators) do
if(isPlayer(tid) == TRUE and tid ~= cid and getPlayerAccess(tid) < getPlayerAccess(cid)) then
doRemoveCreature(tid)
tmp = tmp + 1
end
end
if(tmp > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Kicked " .. tmp .. " players.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not kick any player.")
end
return TRUE
end
PHP:
function onSay(cid, words, param)
local list = {}
local ips = {}
local players = getPlayersOnline()
for i, pid in ipairs(players) do
local ip = getPlayerIp(pid)
local tmp = table.find(ips, ip)
if(tmp ~= nil) then
if(table.countElements(list, ip) == 0) then
list[players[tmp]] = ip
end
list[pid] = ip
end
table.insert(ips, ip)
end
if(table.maxn(list) > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently online players with same IP address(es):")
for pid, ip in pairs(list) do
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " (" .. doConvertIntegerToIp(ip) .. ")")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently there aren't any players with same IP address(es).")
end
return TRUE
end
Last edited: