Problem with DelRegUser command
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Problem with DelRegUser command

Started by DorianG, 24 January, 2004, 16:23:10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DorianG

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

DorianG

Ptokax tell me..... Syntax Error: attempt to concat local `usr' (a table value).

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

DorianG

#3
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.  :)

NightLitch

user:SendPM(BotName, "Non puoi deregistrare "..usr.." fa parte di una classe protetta")

"..usr.."

should be

"..usr.sName.."
//NL

DorianG

oh yes. Now is ok! :D Thanks you are very glad ;)

SMF spam blocked by CleanTalk