Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2204 205 206338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Sudden Death
User Off Offline

Quote
eh i can't make lua, ok i now make other idea more simple, who can make "When player stand x-10 and y-10 then player speedmod is 20":d i know its simple but i don't understand it..
edit: The "10" is title or pixels??

old Re: Lua Scripts/Questions/Help

DRoNe
User Off Offline

Quote
try this :
1
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,"x"), player(id,"y") = player pixel pos
player(id,"tilex"), player(id,"tiley") = player tile pos

x,y can be sometimes tile pos

edited 3×, last 25.05.10 08:42:32 pm

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Hey!, I made a little code wich when you join the game with two clients or more, if you try to vote with some client (except with the first) you are kicked.
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
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 26.05.10 01:40:26 am

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Why not just:
1
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
?

old Re: Lua Scripts/Questions/Help

siuL
User Off Offline

Quote
Spoiler >

isnt working ... some 1 could help ?

old Re: Lua Scripts/Questions/Help

Trotskygrad
User Off Offline

Quote
IF you want to do admin-authing by USGN, I recommend you make a list, auth on join and de-auth on leave, that way you're only checking a single param in that function.

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Flacko has written
Why not just:
1
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

old LUA Request

iCe4147
User Off Offline

Quote
Can anyone help me out?
I need LUA where killer gets spawned to a certain place

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
Spoiler >

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 11:42:42 pm

old Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Quote
How to make the bot randomly go to the teleport if it stand close to it? (then make it just keep going, not return to the tele again and again)

edited 1×, last 29.05.10 04:26:43 am

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
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?

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

old Re: Lua Scripts/Questions/Help

iCe4147
User Off Offline

Quote
Dark Byte has written
Spoiler >


2480 1425

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Yamato4147 has written
Dark Byte has written
Spoiler >


2480 1425


put that number in x and y

1
2
3
4
5
addhook("kill", "hook_kill")

function hook_kill (k, v, w, x y)
	parse("spawnplayer "..k.." 2480 1425")
end

old work???

Promaster
User Off Offline

Quote
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?

BY Alex

old Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Quote
To use lua-files rewrite/delete/whatever your server.lua in [b]sys/lua/server.lua[b] - The lua script which is saved as server.lua can now be used in your server

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
Alexkiller2895 has written
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?

BY Alex

i can't help you because i don't understand you,pls explain better.
To the start Previous 1 2204 205 206338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview