Forum
CS2D Scripts Lua Scripts/Questions/Help Snake_Eater has written
yes
1
2
3
4
5
2
3
4
5
addhook("say","openfile") function openfile(id,t) 	io.open("sys/lua/dayspeakfile.txt","w") 	io.write(player(id,"name").." said: "..t) 	io.close() end
hope that helped you enough
1
2
3
4
5
6
2
3
4
5
6
addhook([[say]],[[writesay]]) function writesay(id,txt) 	file = assert(io.open("sys/lua/chat/dayspeak.txt","w")) 	file:write(player(id,"name").." said : "..txt) 	file:close() end
oops HaRe was faster
anybody can help me?
1
2
3
4
5
6
2
3
4
5
6
addhook([[say]],[[writesay]]) function writesay(id,txt) 	file = assert(io.open("sys/lua/chat/dayspeak.txt","a")) 	file:write(player(id,"name").." said : "..txt.."		") 	file:close() end
now it should work but i cant make sth for the next line,just some sppaces...
Ps:thx for the first part Yasday
1
2
3
4
5
6
2
3
4
5
6
addhook([[say]],[[writesay]]) function writesay(id,txt) file = assert(io.open("sys/lua/chat/dayspeak.txt","a")) file:write(player(id,"name").." said : "..txt.."\n") file:close() end
For the new line.
tiiger87 has written
how do you want to modify it? tell me.
I want to make some things like:
!note
When someone types
!note Hi!
It send:
msg("©255255000"..player(id, "name")..": "..text.."@C")
or with more fields...
!note 255255255 Hi!
msg("©"..color.."..player(id, "name")..": "..text.."@C")
etc
Tell me how to make it have
2 fields (one for !command and one to set a variable)
3 fields (one for !command, one for something and one for something else,
4 field
5 fields
Thanks for helping in advance!
You need \ not /
Damn
DaKnOb has written
I want to make some things like:
!note
When someone types
!note Hi!
It send:
msg("©255255000"..player(id, "name")..": "..text.."@C")
or with more fields...
!note 255255255 Hi!
msg("©"..color.."..player(id, "name")..": "..text.."@C")
etc
Tell me how to make it have
2 fields (one for !command and one to set a variable)
3 fields (one for !command, one for something and one for something else,
4 field
5 fields
Thanks for helping in advance!
tiiger87 has written
how do you want to modify it? tell me.
I want to make some things like:
!note
When someone types
!note Hi!
It send:
msg("©255255000"..player(id, "name")..": "..text.."@C")
or with more fields...
!note 255255255 Hi!
msg("©"..color.."..player(id, "name")..": "..text.."@C")
etc
Tell me how to make it have
2 fields (one for !command and one to set a variable)
3 fields (one for !command, one for something and one for something else,
4 field
5 fields
Thanks for helping in advance!
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook("say","tsay") function tsay(id,txt) 	if (string.sub(txt,1,5) == "!note") then 		local t1 = string.sub(txt,7,9) 		if t1>0 and t1<9 then 			t2 = string.sub(txt,11) 			msg("©'..t1..'"..player(id,"name")..": "..t2.."@C") 		else 			msg2(id,"Wrong, You need to write !note and 9 numbers. And after that the text") 		end 	end end
i hope that works
1
2
3
4
5
6
2
3
4
5
6
addhook("kill","write_kill") function write_kill(id,victim,wpn) file = assert(io.open("sys/lua/SERVER.txt","a")) file:write(player(id,"name").." has killed "..player(victim,"name").." by "..wpn.."\n") file:close() end
Both use the next code
1
2
3
2
3
function math.factorial (n) 	return n == 0 and 1 or n * factorial(n-1) end
#1
1
2
3
2
3
function sine (x) 	return x - x^3/math.factorial(3) + x^5/math.factorial(5) - x^7/math.factorial(7) + x^9/math.factorial(9) - x^11/math.factorial(11) + x^13/math.factorial(13) - x^15/math.factorial(15) + x^17/math.factorial(17) - x^19/math.factorial(19) end
#2
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
function sine (x) 	local x2,sub = x,true 	for i = 3, 19, 2 do 		if ( sub ) then x2 = x2 - x^i/math.factorial(i) 		else x2 = x2 + x^i/math.factorial(i) end 		sub = not sub 	end 	return x2 end
@Dark Byte I would think the 1st one would take less time.
In the houses Config , how i make a house only for me and my friends ?
{pos1 = {155,175}, pos2 = {170,183}, ent = {154,178}, door = {155,179}, price = 100000000000, owner = 22068, endtime = nil, allow = {22588,25280,19571}, doors = {[1] = {22588,25280,19571}}},
isnt workin teh ENDTIME how i make it infinite , like it never end