Forum

> > CS2D > Scripts > Wannabe's Requests
Forums overviewCS2D overview Scripts overviewLog in to reply

English Wannabe's Requests

9 replies
To the start Previous 1 Next To the start

old Wannabe's Requests

Bobakrome
User Off Offline

Quote
Hi , buds there will be my list of requests that i need.

[#1]----------------

Expliced Title: No-Spawn/ShopKill Zone
Request: Need a script that if you kill in the following zone :
1
X:2 ;Y:2 to X:12 ;Y:33
Appears a text not (@C) That will be color
Quote
128128128 RGB : s.a killed s.a2 in spawn zone.
or if its in following zone :
1
X:15 ;Y:10 to X:29 ;Y:24
then
Quote
128128128 RGB : s.a killed s.a2 in the shop.

Punish: Can't respawn 1 minute and if he clicks to respawn then following text :
Quote
128128128 RGB : You can't spawn for 1 minute , you are punished!


----------------

old Re: Wannabe's Requests

Anti-Grav
User Off Offline

Quote
A small attempt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--killzone--
killxstart=2
killystart=2
killxend=12
killyend=33
-could be smarter--

addhook("kill","killzone")

function killzone(killer, victim)

if player(killer,"tilex")>=killxstart and player(killer,"tilex")<=killxend then
	if player(killer,"tiley")>=killystart and player(killer,"tiley")<=killyend then
	-- in kill zone, killed
	msg("@128128128 RGB : ".. killer.." killed ".. victim .." in spawn zone.) -- not sure if it works!
	end
end

Edit:

Fixed: replaced id with killer, should work now!
With this script you can do the other zone yourself.
edited 1×, last 04.01.12 08:34:22 pm

old Re: Wannabe's Requests

EP
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
33
kiz = {} --do not change

kzx = {2,15}
kzy = {2,10}
kzex = {12,29}
kzey = {33,24}

function deactivatek(id)
kiz[id]=false
end

addhook("kill","a")
function a(k,v)
	if player(k,"tilex") >= kzx[1] and player(k,"tiley") >= kzy[1] and player(k,"tilex") <= kzex[1] and player(k,"tiley") <=kzey[1] then
		kiz[id]=true
		parse("killplayer "..k)
		timer(60000,"deactivatek",k)
		msg("©128128128"..player(k,"name").." killed "..player(v,"name").." in spawn zone!")
	elseif player(k,"tilex") >= kzx[2] and player(k,"tiley") >= kzy[2] and player(k,"tilex") <= kzex[2] and player(k,"tiley") <=kzey[2] then
		kiz[id]=true
		parse("killplayer "..k)
		timer(60000,"deactivatek",k)
		msg("©128128128"..player(k,"name").." killed "..player(v,"name").." in a shop!")
	end
end

addhook("spawn","b")
function b(id)
	if kiz[id]==true then
	msg2(id,"©255000000You can't spawn for 1 minute . You are punished!")
	return 1
	end
end
Fixed timer, untested
edited 1×, last 05.01.12 07:12:02 pm

old Re: Wannabe's Requests

MikuAuahDark
User Off Offline

Quote
untested >

old Re: Wannabe's Requests

DannyDeth
User Off Offline

Quote
If you are multiplying by 32, you are creating a false 1/32 pixel accuracy! You need to DIVIDE and FLOOR the value! Not multiply it!

1
tile_x = math.floor(pixel_x/32)

old Re: Wannabe's Requests

MikuAuahDark
User Off Offline

Quote
@user DannyDeth: that's right, but the x and y from kill hook are in pixels, so i multiply it
EDIT: umm, right too. ok thanks!
@user Bobakrome:
untested >
edited 1×, last 05.01.12 02:41:00 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview