Forum

> > CS2D > Scripts > !usgn <id>
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch !usgn <id>

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt !usgn <id>

Paulo49
User Off Offline

Zitieren
If say !usgn <id>
msg
Usgn player name is usgn
code pls?

alt Re: !usgn <id>

Dousea
User Off Offline

Zitieren
What are you trying to say? I guess this is what you want.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say", "sayhook")

function sayhook(id, message)
	if (message:sub(1, 5) == "!usgn") then
		local targetid = tonumber(message:sub(7, #message))
		
		if (targetid) then
			msg2(id, "U.S.G.N. of ID " .. targetid .. ": " .. player(targetid, "usgn"))
		else
			msg2(id, "\169255000000ID parameter must be number, can't contain any other character!@C")
		end
		
		return 1
	end
end
This is the structure that you want, right?
1
!usgn <id>
My code is pretty limited so you can do this and still work,
1
!usgnB19
since my code only check the 7th to the last character for ID parameter.
1× editiert, zuletzt 16.09.15 14:23:52

alt Re: !usgn <id>

THEMUD
User Off Offline

Zitieren
user Paulo49 hat geschrieben
Usgn player name is usgn

Alright.
Anyways, is that what do you need? A script does that when you say "!usgn <id>", shows an USGN of the written ID?
1
2
3
4
5
6
7
8
9
addhook("say", "_say")
function _say(id, txt)
	if(string.sub(txt, 1, 5) == "!usgn")
		then
		local plid = string.sub(txt, 6)
		msg2(id, "\169000204102[USGN]: \169240240240"..player(plid, "usgn"))
		return 1;
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht