Profile
 

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

Profile

Started by Vntalk, 04 August, 2004, 19:12:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vntalk

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

Herodes

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

plop

#2
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
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 <----<<

UwV

so would the same thing work in a bcdc script? (fresh stuff, to be exact ?)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Herodes

The method would work yes .. but the iProfile is a PtokaX thing ...so it wouldn't work

UwV

-----------------------------
.. so it wouldn't work  
-------------------------------
:0(

but thanks for the quick reply..
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Herodes

you are welcome .. :)

SMF spam blocked by CleanTalk