Forum

> > CS2D > Scripts > Auth
Forums overviewCS2D overview Scripts overviewLog in to reply

English Auth

37 replies
Page
To the start Previous 1 2 Next To the start

old Auth

Marcell
Super User Off Offline

Quote
Someone could fix this script.. i don't get any error...
So i don't know what is that!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
addhook("join","_join")
file_location="sys/lua/usgn.cfg"
function file_exists(name)
 local f=io.open(name,"r")
 if f~=nil then
  io.close(f)
  return true
 else
  return false
 end
end
function _join(id)
 if file_exists(file_location)==false then
  print(string.char(169).."255000000sys/lua/usgn.cfg does not exist. Please create it.")
  return 0
 end
 local num=1
 for line in io.lines("sys/lua/usgn.cfg") do
  if tonumber(line)~=nil then
   if player(id,"usgn")==tonumber(line) then
    msg(string.char(169).."000255000You was found in databse! Welcome on the server!.")
    return 0
   end
  else
   print(string.char(169).."255000000sys/lua/usgn.cfg:"..num.." had a malformed usid, please correct it.")
  end
  num=num+1
 end
 timer(200,"parse","kick "..id.." \""..string.char(169).."255000000Sorry but you are not in database!\n")
end

old Re: Auth

Seekay
Reviewer Off Offline

Quote
user Marcell has written
Someone could fix this script.. i don't get any error...



Well, if there's no error, then why do you want that people fix the script?

old Re: Auth

kalis
User Off Offline

Quote
this script like kick someone dont have usgn in usgn.cfg will be kick !
right ?@ @

old Re: Auth

KimKat
GAME BANNED Off Offline

Quote
Perhaps if you declare a function for the kick part it'll be easier to execute the script as a whole?

old Re: Auth

kalis
User Off Offline

Quote
i found it from info
may it help you ?
1
2
3
4
5
6
- timer(time,"func",["p"],[c])	Create a timer which will call the Lua function "func" after a
				certain time in milliseconds (time).
				Moreover it can pass a string parameter (p) to this function.
				The timer calls the function once by default. However you can call
				it several times by entering a count value (c). Using 0 or lower
				count values will make the timer call the function infinite times.

old Re: Auth

Marcell
Super User Off Offline

Quote
user KimKat has written
Perhaps if you declare a function for the kick part it'll be easier to execute the script as a whole?


could you explain it?

old Re: Auth

KimKat
GAME BANNED Off Offline

Quote
Sort of like this...
1
2
3
4
5
6
7
8
9
10
function kick(p)
	if (p) then
		parse("kick "..p)
	end
end

function kick_pl(p)
	local t = 1000
	timer(t,kick(p))
end
edited 3×, last 21.10.12 02:32:56 pm

old Re: Auth

Marcell
Super User Off Offline

Quote
ohh, about some month ago the script worked.. so i don't know what's the problem

old Re: Auth

KimKat
GAME BANNED Off Offline

Quote
@user KimKat: It's;
1
timer(time,"parse","kick "..p)
The last two are optional values I think.
user Marcell
Perhaps you altered a file and somehow ended up like this.

old Re: Auth

Marcell
Super User Off Offline

Quote
as i said... already worked.. but now nothing..

old Re: Auth

EngiN33R
Moderator Off Offline

Quote
user KimKat has written
Sort of like this...
1
2
3
4
5
6
7
8
9
10
function kick(p)
	if (p) then
		parse("kick "..p)
	endif
end

function kick_pl(p)
	local t = 1000
	timer(t,kick(p))
end


Please, refrain from writing in a language that looks like a bastard child of pseudocode, C and Lua.

Spoiler >


@user Marcell:

I fixed it a little, but I don't see why it doesn't work. Didn't test it yet though.

More >

old Re: Auth

KimKat
GAME BANNED Off Offline

Quote
I thought func was able to accept a function though indirectly and execute it with it's parameter value, but I guess I was wrong.
1
timer(time,"func",["p"],[c])

old Re: Auth

Livia
User Off Offline

Quote
user KimKat:
That could be done with a little tweaking.

timer.lua >

old Re: Auth

Starkkz
Moderator Off Offline

Quote
Spoiler >


hope it works

old Re: Auth

UnkN
User Off Offline

Quote
user kalis has written
i found it from info
may it help you ?
1
2
3
4
5
6
- timer(time,"func",["p"],[c])	Create a timer which will call the Lua function "func" after a
				certain time in milliseconds (time).
				Moreover it can pass a string parameter (p) to this function.
				The timer calls the function once by default. However you can call
				it several times by entering a count value (c). Using 0 or lower
				count values will make the timer call the function infinite times.

Of course
Use
1
timer(200,"parse","kick ["..id.."] \"["..string.char(169).."]255000000Sorry but you are not in database!\n")
Spoiler >
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview