Forum

> > CS2D > Scripts > lua request
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch lua request

28 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt lua request

loldlold123
User Off Offline

Zitieren
i wanted to make that but couldnt find how to,lemme show you what im trying to make

(i just dont know how im gonna call that threat so i wrote lua request to title)

Player wrote something
his writing > goes to table or etc i cant know how you gonna do that>txt file>lua which reads what is in txt file >it shows up his writings 1 sec later

just dont tell me that why you want that meaningless thing,if i can get lua which is something like that im gonna make something...

alt Re: lua request

Avo
User Off Offline

Zitieren
Dafuq? I think you used translator...

Thing of you are talking about is useless.

alt Re: lua request

loldlold123
User Off Offline

Zitieren
ok ok i already knew you guys would think this is useless but i'll tell you what im gonna do,im gonna make general chat for 5 servers... so i'll need that piece of code that will write Players writings to txt and other server's piece of code that will read it and show up in that server get it?

alt Re: lua request

Yates
Reviewer Off Offline

Zitieren
We never said it was useless, I was already planning to make this. Problem is, I do not know how the Lua will open a file in a completely different CS2D folder.

alt Re: lua request

Avo
User Off Offline

Zitieren
If you want it you need all 5 servers on the same machine (easiest method). BTW, it's quite easy.

@user Yates: Did you read "ReadMe.txt" file?

ReadMe >

-sys PATH (Use alternative "sys"-folder for settings)
-path PATH (Use alternative working directory)**
1× editiert, zuletzt 05.07.12 13:09:59

alt Re: lua request

Jynxxx
User Off Offline

Zitieren
So when a player says something in the server it saves it to a text file?

alt Re: lua request

loldlold123
User Off Offline

Zitieren
just can anyone write code that will write player's writings to txt file and the other code which shows up his writings?

alt Re: lua request

Yates
Reviewer Off Offline

Zitieren
user Avo hat geschrieben
@user Yates: Did you read "ReadMe.txt" file?

Do you read the "Terms of use" when you agree to something? - I don't think so ;P

Thanks, this should help.

alt Re: lua request

Jynxxx
User Off Offline

Zitieren
user loldlold123 hat geschrieben
just can anyone write code that will write player's writings to txt file and the other code which shows up his writings?


Still not understanding what your saying, use proper english.
1× editiert, zuletzt 05.07.12 13:25:01

alt Re: lua request

Yates
Reviewer Off Offline

Zitieren
user loldlold123 hat geschrieben
and im still loooking for code

I will try and make one for the both of us, you can edit if it even gets completed

user loldlold123 hat geschrieben
btw @user Yates: why your mode is idiot?

Well, it would make more sense to call the mode "Asshole" instead as only me and eXploits have it. But I posted in a random thread "Inb4 anyone cares" and got this mode.

user Jynxxx hat geschrieben
'Sill not understanding what your saying, use proper english.

When a player says something it gets written down in a text file and then it gets read so it can be used in the chat on many servers.

Correct me if I'm wrong, HeaDHunTeR.

alt Re: lua request

loldlold123
User Off Offline

Zitieren
@user Jynxxx:
look i'll tell you step by step
Player joined to game
Player wrote something
LUA:save what he written to asd.txt
Lua:load what he written to asd.txt
Lua:shows up what he written to asd.txt


@user Yates: totally right...

btw would it make server laggy?,but fu** it we would see that when script is done...
2× editiert, zuletzt 05.07.12 13:29:51

alt Re: lua request

Avo
User Off Offline

Zitieren
@user loldlold123: It's easy, 'cause he's an idiot, but it doesn't mean he's an idiot in real life. I want to meet user Yates .
Wait, I'm working with script for you. Easiest way is to run all 5 servers from the same directory. (same pc/server)

alt Re: lua request

Jynxxx
User Off Offline

Zitieren
So let me get this straight, he wants a lua that saves the text in which the player says in the server to a .txt file then opens it up into another server?
Example:

Player: Hello.
Saving to servertxt.txt file.
Opening text file in all servers.
Player from Server #1 says: Hello.

Something like this?

alt Re: lua request

EngiN33R
Moderator Off Offline

Zitieren
You most likely want to make a shared chat between different servers, as user Jynxxx said.

Receiving module:
1
2
3
4
5
6
7
8
9
10
11
addhook("say","savetext")
function savetext(id,t)
	local f=assert(io.open("/root/cs2d/chat.txt","r")) --change the address, just a placeholder
	local txt=f:read()
	f:close()
	f=assert(io.open("/root/cs2d/chat.txt","w"))
	f:write("["..game("sv_name").."] "..player(id,"name")..": "..t.."\n"..txt)
	f:close()
	f=nil
	txt=nil
end

Writing module:
1
2
3
4
5
6
7
8
9
10
11
lastline=""

addhook("second","parsemessages")
function parsemessages()
	local f=assert(io.open("/root/cs2d/chat.txt"))
	local txt=f:read("*line")
	if txt~=lastline then
		msg(txt)
		lastline=txt
	end
end

I can't really come up with a better solution at the moment, if someone can - please do share.

alt Re: lua request

Alistaire
User Off Offline

Zitieren
He wants multi-server chat. Just don't read OP's post, THIS is his real question.
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht