Forum

> > CS2D > Scripts > Wannabe's Requests
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Wannabe's Requests

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Wannabe's Requests

Bobakrome
User Off Offline

Zitieren
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
Zitat
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
Zitat
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 :
Zitat
128128128 RGB : You can't spawn for 1 minute , you are punished!


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

alt Re: Wannabe's Requests

Anti-Grav
User Off Offline

Zitieren
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.
1× editiert, zuletzt 04.01.12 20:34:22

alt Re: Wannabe's Requests

EP
User Off Offline

Zitieren
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
1× editiert, zuletzt 05.01.12 19:12:02

alt Re: Wannabe's Requests

MikuAuahDark
User Off Offline

Zitieren
untested >

alt Re: Wannabe's Requests

DannyDeth
User Off Offline

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

alt Re: Wannabe's Requests

MikuAuahDark
User Off Offline

Zitieren
@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 >
1× editiert, zuletzt 05.01.12 14:41:00
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht