Forum

> > CS2D > Scripts > Setpos Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Setpos Script

15 replies
To the start Previous 1 Next To the start

old Setpos Script

glebec
User Off Offline

Quote
Hi all!I need script to setpos players.
When Admins strike by p228 or elite or five-7 player setpos to Prison.
Pleese give me this script

old Re: Setpos Script

Anti-Grav
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
addhook("kill","playerkill")

function playerkill(killer,victim,weapon)
   if player(killer,"usgn") == Admin ID then
      if weapon == 4 or 5 or 6 then
           parse("setpos "..victim.." X Y")
      end
   end
end

This should work.

old Re: Setpos Script

Anti-Grav
User Off Offline

Quote
Hit Hook:

1
2
3
4
5
6
7
8
9
10
addhook("hit","hitplayer")

function hitplayerl(id,source,weapon)
if player(source,"usgn") == Admin ID then
if weapon == 4 or 5 or 6 then
parse("setpos "..id.." X Y")
return 1 -- For no damage, 0 for normal damage
end
end
end

old Re: Setpos Script

glebec
User Off Offline

Quote
Anti may be i do wrong?Give me pleese all script.I think i worst scripter.
Admin ID list can be re-name Admins?
Pleese do all script.
P228 weapon.
x y : 109 76

old Re: Setpos Script

Anti-Grav
User Off Offline

Quote
Admin ID=USGN ID of the Admin (View Profile for ID)

parse("setpos "..id.." X Tile of a Position in the Prison, Same for Y")

old Re: Setpos Script

Bowlinghead
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
admin = {USGNID}
damage= 1 -- If its "1" then the player GETS Damage
addhook("hit","lol")
function lol(id,source,weapon)
for _,usgn in ipairs(admin) do
if player(source,"usgn")==usgn then
if weapon==4 or weapon==5 or weapon==6 then
parse("setpos "..id.." 109 76")
if damage==0 then
return 1 -- For no damage
else
return 0
end
end
end
end
end

old Re: Setpos Script

Apache uwu
User Off Offline

Quote
lol random, you could just have no damage when the source is using the weapon (4,5,6)+is admin and damage when it's not.

old Re: Setpos Script

Cure Pikachu
User Off Offline

Quote
@ user Anti-Grav
The x and y parameters in cs2d cmd setpos are in pixels, not tiles.

Because of that, here's the full patch (Assuming 109 and 76 are tile positions). Click More for the script.
More >
edited 1×, last 25.08.11 03:58:10 pm

old Re: Setpos Script

Apache uwu
User Off Offline

Quote
Edit: ahhh you sent your reply when I was typing. Yeah that way is wayy more efficient.

Lua needs in_array()

old :***

glebec
User Off Offline

Quote
Pikachu thx.But i know my place in pixels ;*
Big Thx Guys!

old say func

iBRhackCsD2servr
BANNED Off Offline

Quote
How i can make then i say !setjail is the setpos then i shoot player come where i have say !setjail pls give me a answer i search for this one mothn !

old Re: Setpos Script

Happy eyes
User Off Offline

Quote
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
29
30
31
32
jail={109*32+16,76*32+16}
adminusgn={33020}
function admin(id)
	for n,w in pairs (adminusgn) do
		if w==player(id,"usgn") then
			return true
		end
	end
	return false
end

addhook('say','say')
function say(id,t)
	local text = string.lower(t)
	if t == "!setjail" and admin(id) then
		jail={player(id,'x'),player(id,'y')}
		msg2(id,"Jail coordinates was set to X: "..player(id,"x")..", y: "..player(id,'y'))
		return 1
	end
end

addhook('hit','hit')
function hit(id,source,weapon,hpdmg,apdmg,rawdmg)
	if admin(source) and id > 0 then
		if weapon == 4 or weapon == 5 or weapon == 6 then
			parse('setpos '..id..' '..jail[1]..' '..jail[2])
			msg2(source,"You've jailed "..player(id,"name"))
			msg2(id,"You has been jailed by "..player(source,"name"))
			return 1
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview