Forum

> > CS2D > Scripts > [Request] JailGun
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [Request] JailGun

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [Request] JailGun

ItsLullas
User Off Offline

Zitieren
Hi guys,
I was searching for a JailGun Mod, but I didn't find one.
So now I'm asking you to help me.

The JailMod should work like this:

• The JailGun should teleport you into a Jail, for a certain amout of time
• The position of the Cell(s) should be configurable
• There is a defineable weapon that is used as JailGun
• Only Admins can use it of course

> If somebody has/makes a script like this, please PN me.
Thanks!

alt Re: [Request] JailGun

Chingy
User Off Offline

Zitieren
Do you mean a script made for a specific gun (Laser as example) which teleports a player to a preset XY when the gun hits him?

alt Re: [Request] JailGun

EngiN33R
Moderator Off Offline

Zitieren
I won't PM you the script, I will write it here, for the sake of other people who will visit this thread. I will also not make a whole administration script for you, use an existing one and incorporate this code into it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
jailgun = 5 --weapon type of the jail gun
jail = {5,5} --position to teleport ot
jaildur = 30 --duration of jail time in seconds

addhook("hit","jailplayer")
function jailplayer(id,src)
	if true then --check if src is an admin here!
		if player(src,"weapontype")==jailgun then
			local oldx,oldy=player(id,"x"),player(id,"y")
			parse("setpos "..id.." "..jail[1]*32+16 .." "..jail[2]*32+16)
			timer(jaildur*1000,"parse","setpos "..id.." "..oldx.." "..oldy)
		end
	end
end

This won't work well if you shoot a player who's already in jail.

alt Re: [Request] JailGun

Chingy
User Off Offline

Zitieren
user EP hat geschrieben
@user Chingy: No... the prisoner will back to his old position, which is the jail. Read the code

Read his last sentence again.

alt Re: [Request] JailGun

EngiN33R
Moderator Off Offline

Zitieren
user Chingy hat geschrieben
@user EngiN33R: You mean it will end into a crash?


It won't crash, but if you shoot a player while they're in prison, they will be teleported to the jail position again, then after the initial 30 seconds the player will be teleported back where they were prisoned, and then after a while they'll be teleported back to the prison, this time irreversibly (unless someone manually teleports them away from there). You can try it yourself and see.

That can be avoided by preventing a player from being teleported if they're in jail already, which we can implement by means of an in jail variable.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht