• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Help In a php/lua script?.

wlj

retierd
Joined
Jan 7, 2009
Messages
1,201
Reaction score
1
Well i did think the thread pass in Support
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
second.

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
What is wrong i giv 2 rep++ :wub:
 
Last edited:
Post at least some _description_, what is wrong, what is not working here, from where you have these files, if it are original files or you changed it somehow. Thank you.
 
Exactly what Pierroth said. We don't know what that script should do and we don't feel like reading though all of those lines just to figure that out. Give us an explanation on what the script does and how it should work. Include any error messages that you receive when you try and run the script.
 
yeah, but i dont get what are you trying to do...
I know something is wrong, but what is it that you are trying to do, what error does it show?

Exactly what Pierroth said. We don't know what that script should do and we don't feel like reading though all of those lines just to figure that out. Give us an explanation on what the script does and how it should work. Include any error messages that you receive when you try and run the script.

like
Can not load Not.lua and its talkactions ;S

need to a tutor bec the commands is buged ....
 
no tutor script the commands can u read :O
my commands.xml is buged so i did write as a lua script but it buged in console!
 
God, ur english is too complicated, not makin fun of you, but i dont get what your saying, all i get is that u screw up the console because u were trying to change the tutor commands? is that it? why would u write a script for tutor commands?
are you trying to use ur own script for tutors? wtf?
 
God, ur english is too complicated, not makin fun of you, but i dont get what your saying, all i get is that u screw up the console because u were trying to change the tutor commands? is that it? why would u write a script for tutor commands?
are you trying to use ur own script for tutors? wtf?

omg -.- look ive tryed everything it doesnt work i use lua commands in talkactions insted for gm,tutor,senators. Please dont msg here if u dno that it is. :mad:
 
Back
Top