Forum

> > CS2D > Scripts > medikite drop
Forums overviewCS2D overview Scripts overviewLog in to reply

English medikite drop

13 replies
To the start Previous 1 Next To the start

old medikite drop

Flame
BANNED Off Offline

Quote
How to make a lua that only admins write !medicine
And they drop a medikit

old Re: medikite drop

Yates
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Admins = {USGN(s)HERE}

function inusgn(id)
	local us = player(id,"usgn")
	for i, v in pairs(Admins) do
		if us == tonumber(v) then
			return true
		end
	end
	return false
end

addhook("say","hp")
function hp(id,text)
	if inusgn(i) then
		if (text=="!medicine") then
			parse("spawnitem 64 "..player(id,"tilex").." "..player(id,"tiley"))
		end
	end
end
Not tested, should work.
Edit: Forgot to add that admins only thing.

old Re: medikite drop

Necr0
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
--UNTESTED

addhook("say","md")
function md(id,txt)
if txt=="!medicine" then
if player(id,"usgn")== then  --admin usgn here
parse("spawnitem 64 "..player(id,"x").." "..player(id,"y"))
else
prase('msg2 '..id..' '"you aren't admin"')
end
end
end
i think so its right

old Re: medikite drop

Flame
BANNED Off Offline

Quote
Yates you're didint work and team speak you're didint work too ;/

old Re: medikite drop

Yates
Reviewer Off Offline

Quote
user Necr0 has written
1
if player(id,"usgn")== then  --admin usgn here

Then you could only add 1 admin.
user Necr0 has written
1
prase

Wai- Wha?
user Flame has written
Yates you're didint work and team speak you're didint work too ;/

Seriously?

old Re: medikite drop

Necr0
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
--TESTED!!!

addhook("say","md")
function md(id,txt)
if txt=="!medicine" then
if player(id,"usgn")==0 then	--change 0 to admin usgn
parse("spawnitem 64 "..player(id,"tilex").." "..player(id,"tiley"))
end
end
end

old Re: medikite drop

Yates
Reviewer Off Offline

Quote
Haha, mine doesn't work because of this:
1
if inusgn(i) then
It should be id instead of i. My bad. If you want to have multiple admins, just change it. If you just want yourself, you're better off using TeamSpeak's lua.

old Re: medikite drop

Yates
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Admins = {USGN(s)HERE}

function inusgn(id)
	local us = player(id,"usgn")
	for i, v in pairs(Admins) do
		if us == tonumber(v) then
			return true
		end
	end
	return false
end

addhook("say","hp")
function hp(id,text)
	if inusgn(id) then
		if (text=="!medicine") then
			parse("spawnitem 64 "..player(id,"tilex").." "..player(id,"tiley"))
		end
	end
end

-- Tested and works.
edited 1×, last 17.09.11 06:30:22 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview