determinate determinate

Author Topic: Am I OPerator? [isOp()]  (Read 1137 times)

0 Members and 1 Guest are viewing this topic.

Offline TTB

  • Lord
  • ***
  • Posts: 440
  • Karma: +17/-1
Am I OPerator? [isOp()]
« on: September 14, 2009, 02:30:31 pm »
Hi,

Is it possible to detect yourself (hub:getOwnNick()) as an OPerator? I tried it with:
Code: [Select]
A. if hub:getOwnNick(isOP) then end

B.
local nick = hub:getOwnNick()
if nick:isOp() then end

C.

if isOperator(hub, hub:getOwnNick()) then end

function isOperator(hub,nick)
local operator = false
for k,v in pairs(hub._users) do
if string.lower(k) == string.lower(nick) then
if k:isOp() then
operator = true
end
end
end
return operator
end

None of above seems to work. Any suggestions?  ???

TTB

(¯ ·.¸¸.-> Admin @ Surfnet hubs <-.¸¸.·´¯)

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Am I OPerator? [isOp()]
« Reply #1 on: September 15, 2009, 02:13:45 am »
Code: [Select]
hub:isOp(hub:getOwnNick())
Code: [Select]
function isOperator(hub,nick)
local nick = hub:getOwnNick()
return hub:isOp(nick)
end
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline TTB

  • Lord
  • ***
  • Posts: 440
  • Karma: +17/-1
Re: Am I OPerator? [isOp()]
« Reply #2 on: September 15, 2009, 09:32:29 am »
Thank you Mutor  ;)   
TTB

(¯ ·.¸¸.-> Admin @ Surfnet hubs <-.¸¸.·´¯)

 

determinate determinate
guestbook