Forum

> > CS2D > Scripts > medikite drop
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch medikite drop

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt medikite drop

Flame
BANNED Off Offline

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

alt Re: medikite drop

Yates
Reviewer Off Offline

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

alt Re: medikite drop

Necr0
User Off Offline

Zitieren
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

alt Re: medikite drop

Flame
BANNED Off Offline

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

alt Re: medikite drop

Yates
Reviewer Off Offline

Zitieren
user Necr0 hat geschrieben
1
if player(id,"usgn")== then  --admin usgn here

Then you could only add 1 admin.
user Necr0 hat geschrieben
1
prase

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

Seriously?

alt Re: medikite drop

Necr0
User Off Offline

Zitieren
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

alt Re: medikite drop

Yates
Reviewer Off Offline

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

alt Re: medikite drop

Yates
Reviewer Off Offline

Zitieren
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.
1× editiert, zuletzt 17.09.11 18:30:22
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht