Forum

> > CS2D > Scripts > !usgn <id>
Forums overviewCS2D overview Scripts overviewLog in to reply

English !usgn <id>

2 replies
To the start Previous 1 Next To the start

old !usgn <id>

Paulo49
User Off Offline

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

old Re: !usgn <id>

Dousea
User Off Offline

Quote
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.
edited 1×, last 16.09.15 02:23:52 pm

old Re: !usgn <id>

THEMUD
User Off Offline

Quote
user Paulo49 has written
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview