Forum

> > CS2D > Scripts > !bringall
Forums overviewCS2D overview Scripts overviewLog in to reply

English !bringall

12 replies
To the start Previous 1 Next To the start

old !bringall

Eternal
User Off Offline

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

old Re: !bringall

Cure Pikachu
User Off Offline

Quote
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
edited 1×, last 01.05.12 06:19:14 pm

old Re: !bringall

EP
User Off Offline

Quote
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

old Re: !bringall

MikuAuahDark
User Off Offline

Quote
user EP has written
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

old Re: !bringall

Sparty
Reviewer Off Offline

Quote
user Cure Pikachu has written
@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?

old Re: !bringall

MikuAuahDark
User Off Offline

Quote
@user Sparty: what 25??
@user EP: i just see it and there is a must error at
user EP has written
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

old Re: !bringall

Apache uwu
User Off Offline

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

old Re: !bringall

Infinite Rain
Reviewer Off Offline

Quote
user Cure Pikachu has written
@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

old Re: !bringall

MikuAuahDark
User Off Offline

Quote
user Infinite Rain has written
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview