In my script
there is something like this :
if victim.iProfile == 3 then
but i want from profile 2 to 4
how you guys write that ??
thanks
an easy way is to make it something like
if victim.iProfile == 2 or victim.iProfile == 3 or victim.iProfile == 4 then
it is better to define the scope for the if conditions with parenthesis....
if ( (victim.iProfile == 2) or (victim.iProfile == 3) or (victim.iProfile == 4) ) then
I find it is nicer to read it this way ... and it is usefull for something else that I dont recall right now,...
but I think there has to be a nicer way to do it ... post the script or show us where from .. :)
a better way of the thing mutor posted.
profiles = { 0, 1 , 2 }
for i=1, getn(profiles) do
if user.iProfile == profiles[i] then
user:SendData(bot, "you may acces this command!")
local t =1
break
end
end
if t == nil then
user:SendData(bot, "you may NOT acces this command!")
end
but a much nicer way is the next 1.
profiles = { [0]=1, [1]=1 , [2]=1 }
if profiles[user.iProfile] then
user:SendData(bot, "you may acces this command!")
else
user:SendData(bot, "you may NOT acces this command!")
end
plop
so would the same thing work in a bcdc script? (fresh stuff, to be exact ?)
The method would work yes .. but the iProfile is a PtokaX thing ...so it wouldn't work
-----------------------------
.. so it wouldn't work
-------------------------------
:0(
but thanks for the quick reply..
you are welcome .. :)