Help please !!!
 

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

Help please !!!

Started by juda, 17 February, 2005, 09:58:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

juda

I run script that must have users [prefix]before nick....
When user come into hub,get message:

MOTD__________________________________________
This is alowed prefixes:
[xxx]
[xxx]
[xxx]
[xxx]
[xxx]
[xxx]
[xxx]
and more....
_______________________________________________
Now it show this prefixes in single line,but I want that be
show in "paralel" line.....like:

MOTD__________________________________________
This is alowed prefixes:
[xxx],[xxx],[xxx],[xxx],[xxx],[xxx],[xxx],[xxx],[xxx],
[xxx],[xxx],[xxx],[xxx],[x[xxx],[xxx],[xxx],xx],[xxx],
...and more
_______________________________________________

This is line that must be change in script:
_______________________________________________
Copy from script "PrefixCheck by bastya_elvtars"

pref ={
"[EU]",
--"(HUN)",
--"(EU)",
}
___________________________________________________

I try all kind off different changes and still put all in single line !!!

Please for any tips !!!
juda

blackwings

post the whole script please


juda

____________________________________________
-- PrefixCheck by bastya_elvtars (the rock n' roll doctor)
-- based on AllowNick by Mutor
-- checks the prefix, it must be in right the beginning of the nick

-- // config

-- the next option defines who GET prefix checked, if checknick is set to 1.
cnlevel=3               -- 5:all users
                                -- 4 ops & below
                                -- 3 vips & below
                                -- 2 registered users & below
                                -- 1 guests only

pref ={
"[HUN]",
--"[EU]",
--"(HUN)",
}

-- // end of config

function DataArrival(user,data)
   if strsub(data, 1, 13) == "$ValidateNick" then
      local sdata=strsub(data,1,strlen(data)-1)
      local _,_,nm=strfind(sdata,"$ValidateNick%s+(%S+)")
      determineprefix(nm)
   end
end

function NewUserConnected(user)
   if CheckUserLevel(user) <= cnlevel then
      if checkprefix(user)=="shit" then  return 1 end
   end
end

function determineprefix(data)
   _,_,prefix = strfind(data, "^([%[%{%(]%S+[%)%}%]])%S+")
end

function checkprefix(user)
local p=function()
   local mess="\r\n====================\r\n"
   sort(pref)
   for b=1,getn(pref)do
      mess=mess..pref.."\r\n"
   end
   mess=mess.."====================\r\n\r\nNote that the check is case sensitive, a.k.a. [prefix] and [PREFIX] are different."
   return mess
   end
   if not prefix then
      user:SendData("NickNameCheck", "\r\nNo prefix specified, use one of these:"..p())
      user:Disconnect() return "shit"
   else
      local prefixes={}
      for a=1,getn(pref) do
         prefixes[pref[a]]=1
      end
      if not prefixes[prefix] then
         user:SendData("NickNameCheck", "\r\nBad prefix, use one of these:"..p())
         user:Disconnect() prefixes=nil return "shit"end
   end prefixes={}
end

function CheckUserLevel(user)
   if user.iProfile==0 then
      return 5
   elseif user.iProfile==1 then
      return 4
   elseif user.iProfile==3 then
      return 2
   elseif user.iProfile==2 then
      return 3
   else
      return 1
   end
end
_____________________________________________
juda

blackwings

#3
change this line (line 45) =
mess=mess..pref[b].."\r\n"

to this=
mess=mess..pref[b].." , "

this should work.


juda

work... !!! thanks m8 for your time...by
juda

SMF spam blocked by CleanTalk