I want that an Operator can't delreg some specified users profiles. I have tried to create a command, but i have had some problem. I have written there. But Ptokax tell me that is an error. Can you halp me?
if (cmd=="!delreg" or cmd=="!DelReg" or cmd=="!Delreg" or cmd=="!Unreg" or cmd=="!unreg") then
s,e,cmd,str = strfind(data, "%b<>%s(%S+)%s(%S+)")
local usr = GetItemByName(str)
if (usr.bOperator or usr.iProfile == 2) then
user:SendPM(BotName, "Non puoi deregistrare "..usr.." fa parte di una classe protetta")
SendPmToNick(usr, BotName, "L'operatore "..user.sName.." ha provato a deregistrarti")
else
SendPmToNick(usr, BotName, "Sei stato deregistrato da: "..user.sName)
DelRegUser(usr)
SendPmToOps(BotName, "L'utente "..usr.." ? stato deregistrato da: "..user.sName)
end
end
Ptokax tell me..... Syntax Error: attempt to concat local `usr' (a table value).
QuoteOriginally posted by DorianG
Ptokax tell me..... Syntax Error: attempt to concat local `usr' (a table value).
usr is a table so if you want delete that you got 2 grab the right thing from the table.
usr.sName in your case.
plop
Excuse me but i haven't understood. Can you write me the solution at my problem. Sorry But i'm at the first experience with LUA. :)
user:SendPM(BotName, "Non puoi deregistrare "..usr.." fa parte di una classe protetta")
"..usr.."
should be
"..usr.sName.."
oh yes. Now is ok! :D Thanks you are very glad ;)