Forum

> > CS2D > Scripts > !bringall
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch !bringall

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt !bringall

Eternal
User Off Offline

Zitieren
Hello Everyone on us

i want a code of !bringall when say !bringall then bring all of players to me.

Can Someone give me that code??

alt Re: !bringall

Cure Pikachu
User Off Offline

Zitieren
This?
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("say","tome")
function tome(id,txt)
	if txt == "!bringall" then
		if player(id,"health") > 0 then
			for _, s in pairs(player(0,"tableliving")) do
				if s ~= id then
					parse("setpos "..s.." "..player(id,"x").." "..player(id,"y"))
				end
			end
		end
		return 1
	end
end
1× editiert, zuletzt 01.05.12 18:19:14

alt Re: !bringall

EP
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
addhook("say","a")
function a(id,txt)
	if txt == "!bringall" then
		for i = 1,32 do
			parse("setpos "..i.." "..player(id,"x").." "..player(id,"y"))
		end
		return 1
	end
end
pikachu you did it faster

alt Re: !bringall

MikuAuahDark
User Off Offline

Zitieren
user EP hat geschrieben
1
2
3
4
5
6
7
8
9
addhook("say","a")
function a(id,txt)
	if txt == "!bringall" then
		for i = 1,32 do
			parse("setpos "..i.." "..player(id,"x").." "..player(id,"y"))
		end
		return 1
	end
end
your code should error. user Cure Pikachu script is better

alt Re: !bringall

Sparty
Reviewer Off Offline

Zitieren
user Cure Pikachu hat geschrieben
@user EP: user MikuAuahDark is right. Your script will generate an error if you say !bringall while you are dead.

What if there r like... 25 or something.. Does it make it lag?

alt Re: !bringall

MikuAuahDark
User Off Offline

Zitieren
@user Sparty: what 25??
@user EP: i just see it and there is a must error at
user EP hat geschrieben
1
2
for i = 1,32 do
			parse("setpos "..i.." "..player(id,"x").." "..player(id,"y"))
1
for i = 1,32 do
note. you just loop the id 32 times when some of it not exists, then make error. idk what error maybe bad argument.
@user Eternal: you should use user Cure Pikachu script and not user EP script

alt Re: !bringall

Apache uwu
User Off Offline

Zitieren
of all, user Cure Pikachu's code is the best, using the playerliving table as well as checking for the user using the command to be alive and not bring the user to their self!

alt Re: !bringall

Infinite Rain
Reviewer Off Offline

Zitieren
user Cure Pikachu hat geschrieben
@user EP: user MikuAuahDark is right. Your script will generate an error if you say !bringall while you are dead.

nope it will bring you an error when server is not full (32/32)

Spectators still hacve X|Y
THe best way
1
2
3
for n, w in pairs(player(0, 'tableliving')) do
	parse('setpos '.. id ..' '.. player(id, 'x') ..' '.. player(id, 'y'))
end

alt Re: !bringall

MikuAuahDark
User Off Offline

Zitieren
user Infinite Rain hat geschrieben
1
parse('setpos '.. id ..' '.. player(id, 'x') ..' '.. player(id, 'y'))
uups it's a "id" x and y position, so it not do anything.
1
2
3
for _, pl in pairs(player(0, 'tableliving')) do
	parse('setpos '.. pl ..' '.. player(id, 'x') ..' '.. player(id, 'y'))
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht