edit: The "10" is title or pixels??
Forum
Scripts
Lua Scripts/Questions/Helpedit: The "10" is title or pixels??
1
2
3
4
5
6
7
2
3
4
5
6
7
function speed(id)
local plx = player(id,"tilex")
local ply = player(id,"tiley")
	if plx == 10 and ply == 10 then
		parse ("speedmod "..id.." 20")
	end
end
player(id,"tilex"), player(id,"tiley") = player tile pos
x,y can be sometimes tile pos
edited 3×, last 25.05.10 06:42:32 pm
This is the code:
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
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
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
clon = initArray(32)
addhook("join","onjoin")
function onjoin(id)
	clon[id] = 0
	local setip = player(id,"ip")
	for i = 1,32 do
		if not i == id then
			if player(i,"ip")==setip then
				clon[id] = 1
			end
		end
	end
end
addhook("vote","onvote")
function vota(id,mode,param)
	if clon[id]==1 then
		parse("kick "..id)
	end
end
But for a reason it doesn't work.
IS like when you join with a new client your ip changes, but i made a test, so when i said "!ip" it telled me the ip, and both had the same ip :S.
Any help?
edited 1×, last 25.05.10 11:40:26 pm
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("vote","onvote")
function onvote(id,mode,param)--BTW, you wrote vota instead of onvote
	if mode ~= 1 then return true end--Punishment only for votekicks
	local ip = player(id,"ip")
	for k,p in pairs(player(0,"table")) do
		if player(p,"ip") == ip and id ~= p then
			parse("kick "..id)
		end
	end
end
isnt working ... some 1 could help ?
Flacko has written
Why not just:
?
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("vote","onvote")
function onvote(id,mode,param)--BTW, you wrote vota instead of onvote
	if mode ~= 1 then return true end--Punishment only for votekicks
	local ip = player(id,"ip")
	for k,p in pairs(player(0,"table")) do
		if player(p,"ip") == ip and id ~= p then
			parse("kick "..id)
		end
	end
end
Thanks Flacko
I need LUA where killer gets spawned to a certain place
I do not know where you want them to spawn so it just spawns them at there current position.
Edit:
Is it possible without running through CS2D to make Lua play a sound, and not wxLua just Lua?
edited 1×, last 28.05.10 09:42:42 pm
edited 1×, last 29.05.10 02:26:43 am
Dark Byte has written
I do not know where you want them to spawn so it just spawns them at there current position.
Edit:
Is it possible without running through CS2D to make Lua play a sound, and not wxLua just Lua?
Edit:
Is it possible without running through CS2D to make Lua play a sound, and not wxLua just Lua?
As far as I know Lua hasn't got any audiovisual facilities, you should look for a library or run your media player with some parameters so it loads your file
Dark Byte has written
2480 1425
Yamato4147 has written
put that number in x and y1
2
3
4
5
2
3
4
5
addhook("kill", "hook_kill")
function hook_kill (k, v, w, x y)
	parse("spawnplayer "..k.." 2480 1425")
end
BY Alex
Alexkiller2895 has written
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?
BY Alex
BY Alex
What do you mean?
Open "sys/lua/server.lua" (with notepad)
Type 'dofile ("sys/lua/<lua file>.lua")'
If you want to learn Lua go to
www.lua.org
Alexkiller2895 has written
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?
BY Alex
BY Alex
i can't help you because i don't understand you,pls explain better.
Lua Scripts/Questions/Help


Offline
