Forum

> > CS2D > Scripts > Healing player from the list
Forums overviewCS2D overview Scripts overviewLog in to reply

English Healing player from the list

9 replies
To the start Previous 1 Next To the start

old closed Healing player from the list

Ayudon
User Off Offline

Quote
Hi again, im back LOL! I was just looking for a script that.. well, an example:
If a player joins the server with the usgn #12345 (previously listed in lua), then that player can be healed if being hit by a wrench! (+3 hp per hit).
That was all

old Re: Healing player from the list

Dovahkin
User Off Offline

Quote
Here i hope it works for you

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
citizen={43653} -- and the people who come before please write it here.

addhook("join","lolz")
function lolz(id)
	for _,usgn in ipairs (citizen) do
		if player(id,'usgn') == usgn then
			msg (player(id,"name").." is back!@C")
		end
	end
end

addhook("hit","lol")
function lol(id,source,weapon,hpdmg)
	if(weapon==74) then
		parse("sethealth "..id.." "..player(id,"health")+3)
	end
end

addhook("minute","lolc")
function lolc(id)
	for _,usgn in ipairs (citizen) do
		if player(id,'usgn') == usgn then
			msg (player(id,"name").." Was here before!!@C") --put the people who come before!
		end
	end
end

Im sure it well work!
edited 2×, last 28.04.11 05:05:03 am

old Re: Healing player from the list

Starkkz
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Heal_Victims = {12345}

function table.find(array,value)
	for k, v in pairs(array) do
		if v == value then
			return k
		end
	end
	return false
end

addhook("hit","onHit")
function onHit(id,source,wpn,hpdmg,apdmg)
	if wpn == 74 then
		if table.find(Heal_Victims,player(id,"usgn")) then
			parse("sethealth "..id.." "..player(id,"health")+3)
		end
	end
end

old Re: Healing player from the list

Yates
Reviewer Off Offline

Quote
Man, didn't you see the spam violations they got? If you had any brain you would have not just posted that.

Admin/mod comment

That was unnecessary.

old Re: Healing player from the list

Starkkz
Moderator Off Offline

Quote
That's not nice, please follow the rules. Do NOT spam

Admin/mod comment

please follow the rules. do not behave like a moderator... oh man...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview