I would want to set LVL, but RegOP doesn't work that, I would want. Also if I tell it that RegOp can be equal to 5 or to 6. If I go to record a user with one of these levels, the Bot doesn't record me it.
I mistake something?
RegOp = {"5","6"}
function AddRegOp(user, data)
s,e,cmd,str,pwd,lvl = strfind(data, "%b<>%s(%S+)%s(%S+)%s(%S+)%s(%S+)")
if cmd ~= nil and str ~= nil and pwd ~= nil and lvl ~= nil then
local usr = GetItemByName(str)
if lvl == RegOP then
if (usr.iProfile == -1) then
AddRegUser(str,pwd,lvl)
user:SendPM(BotName, "User "..usr.sName.." is registered with success, by " ..user.sName)
else
user:SendPM(BotName, "User "..usr.sName.." was registered")
end
else
user:SendPM(BotName, "you are not allowed to register this user level")
end
else
user:SendPM(BotName, "Plaese, put this command !addreg " )
end
return 1
end
?ou are comparing the lvl with the table structure..
To getinto a specific place in a table you can do in many ways, here's one
RegOp = {"6","5"}
--// print(RegOp) Bad Code
Result = "table: 0x8063cb0"
good one :
print(RegOp[1])
Result: "6"
good luck!
Sorry but i haven't understood..
if you write me a code I would be more contented ;)
Ok i have understood now
THank you very much :)