function onSay(cid, words, param, channel)
local str = "##Online[Ip]: target\n"
local i = #getPlayersOnline()
local n = 1
if param =="" then
for _,cid in ipairs(getPlayersOnline()) do
local ip =convertIntToIP(getPlayerIp(cid))
local target = getCreatureTarget(cid) < 1 and "nothing" or getCreatureName(getCreatureTarget(cid))
str = str..""..getCreatureName(cid) .. "["..ip.."] : attacking "..target.."".. (n < i and ", " or ".")
n = n + 1
end
doPlayerSendTextMessage(cid,27,str)
else
local player = param
local playerr = getPlayerByNameWildcard(player)
if tonumber(player) then
return doSendMagicEffect(getThingPos(cid),2) and doPlayerSendTextMessage(cid,18,"You need to enter a player name.") and true
end
if not playerr then
return doSendMagicEffect(getThingPos(cid),2) and doPlayerSendTextMessage(cid,18,"Player ["..player.."] doesnt exist or is offline.") and true
end
local player_ip =convertIntToIP(getPlayerIp(playerr))
local plyer_target = getCreatureTarget(playerr) < 1 and "nothing" or getCreatureName(getCreatureTarget(playerr))
doPlayerSendTextMessage(cid,27,getCreatureName(playerr).."["..player_ip.."] : is attacking "..plyer_target)
end
return true
end