PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Kyoya on 17 January, 2004, 02:12:53

Title: New to scripting
Post by: Kyoya on 17 January, 2004, 02:12:53
I thought I had this all figured out.

But while the command works, anyone can run the command.

My profiles go down. Meaning owner=0, admin =1, op = 2, scanner = 3, vip = 4, reg = 5.

Can someone show me what I'm doing wrong?

-----Begin Code
if(cmd==prefix.."mass") then -- Mass Message all online users
   if user.iProfile < 5 and user.iProfile ~= nil then
      arg=GetArgML(data)
      if arg~= nil then
         SendPmToAll(botName, user.sName.." sent you the messag : "..arg..".|")
         user:SendData(botName,"Mass Message sent.|")
      else
         user:SendData(botName,"usage is !mass . |")
      end
   else
      user:SendData(botName,"You know you don't have access to this command! |")
      SendPmToOps(botName, user.sName.."thinks they're funny and tried to run the "..cmd.."command." )
   end
   return 1
end


Thank you in advance.

Kyoya
Title:
Post by: plop on 17 January, 2004, 02:23:39
your forgetting that unregistered users have the profile number -1.
try changing this:
 if user.iProfile < 5 and user.iProfile ~= nil then
for
 if user.iProfile < 5 and user.iProfile > -1 then

plop
Title:
Post by: kepp on 17 January, 2004, 02:27:31
if user.iProfile is equal to then
...

Etc: you only want Admin to use it

if user.iProfile == 0 then

   if (cmd==Pre.."mass") then
   ...
end
Title:
Post by: Kyoya on 17 January, 2004, 02:57:51
*smacks head*

Yeah that was it. so much for having it figured out. Thanks!

I decided to redo my profiles to make it simplier on me.


Kyoya