Forum

> > CS2D > Scripts > Hospital and Prison Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hospital and Prison Script

5 replies
To the start Previous 1 Next To the start

old Hospital and Prison Script

Obviously Exactly Myself
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("die","zj_hospital")
function zj_hospital(id)
	parse("spawnplayer "..id.." 5728 4320")
	parse("setmoney ".. id .." ".. (player(id, "money") - 250))
	msg2(id,"©005255255You died and paid $250 to the hospital!")
end

addhook("kill","zj_prison")
function zj_prison(id)
	parse("spawnplayer "..id.." 6000 6000")
	parse("setmoney ".. id .." ".. (player(id, "money") - 800))
	msg2(id,"©255015015You are sent to jail and paid $500!")
end

How do I fix this script? Prison works fine but I still go to jail and pay $500 when I killed myself. The Hospital, when I died, it brought me to the Hospital and I paid $250 which is what I expected but it doesn't equip the player with knife after re-spawning. When I killed myself, it shows both messages but I only want to pay $250 and be in the Hospital after suicide. I mean, why have a murder case by killing yourself?

old Re: Hospital and Prison Script

Apache uwu
User Off Offline

Quote
user Obviously Exactly Myself has written
When I killed myself, it shows both messages but I only want to pay $250 and be in the Hospital after suicide.


Hmm that means you only want a person to go to jail and pay the fee of $500 when the person they are killing is not themselves.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("die","zj_hospital")
function zj_hospital(id)
	parse("spawnplayer "..id.." 5728 4320")
	parse("setmoney ".. id .." ".. (player(id, "money") - 250))
	msg2(id,"©005255255You died and paid $250 to the hospital!")
end

addhook("kill","zj_prison")
function zj_prison(id,victim)
	if victim~=id then
		parse("spawnplayer "..id.." 6000 6000")
		parse("setmoney ".. id .." ".. (player(id, "money") - 800))
		msg2(id,"©255015015You are sent to jail and paid $500!")
	end
end

old Re: Hospital and Prison Script

Alistaire
User Off Offline

Quote
Maybe change;

1
parse("setmoney ".. id .." ".. (player(id, "money") - 800))

to;

1
parse("setmoney ".. id .." ".. (player(id, "money") - 500))

old Re: Hospital and Prison Script

EngiN33R
Moderator Off Offline

Quote
No, it's just you have 'you paid $500' in the message for jail, while $800 are really subtracted. Other than that, I think TC's script will work for you.

old Re: Hospital and Prison Script

Obviously Exactly Myself
User Off Offline

Quote
user EngiN33R has written
No, it's just you have 'you paid $500' in the message for jail, while $800 are really subtracted. Other than that, I think TC's script will work for you.

I put $800 because I don't know how to remove the $300 when you killed someone.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview