Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2204 205 206338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Sudden Death
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

DRoNe
User Off Offline

Zitieren
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

3× editiert, zuletzt 25.05.10 20:42:32

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
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?
1× editiert, zuletzt 26.05.10 01:40:26

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

siuL
User Off Offline

Zitieren
Spoiler >

isnt working ... some 1 could help ?

alt Re: Lua Scripts/Questions/Help

Trotskygrad
User Off Offline

Zitieren
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.

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
Flacko hat geschrieben
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

alt LUA Request

iCe4147
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
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?
1× editiert, zuletzt 28.05.10 23:42:42

alt Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Zitieren
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)

1× editiert, zuletzt 29.05.10 04:26:43

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
Dark Byte hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

iCe4147
User Off Offline

Zitieren
Dark Byte hat geschrieben
Spoiler >


2480 1425

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
Yamato4147 hat geschrieben
Dark Byte hat geschrieben
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

alt work???

Promaster
User Off Offline

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

BY Alex

alt Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Zitieren
Alexkiller2895 hat geschrieben
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.
Zum Anfang Vorherige 1 2204 205 206338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht