Forum

> > CS2D > Scripts > Script Request
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script Request

5 replies
To the start Previous 1 Next To the start

old Script Request

Jhony
User Off Offline

Quote
How to mute the usgn of Player?

example :
1
@mute [ID or USGN] and @unmute [ID or USGN]

________________________________________
How to Lock Player any team?

example :
1
@lockT [ID or USGN] , @lockCT [ID or USGN] @lockspec [ID or USGN] @unlock [ID or USGN]

help?

old Re: Script Request

Apache uwu
User Off Offline

Quote
You can check if the number is greater than 32, if it is then it is a usgn and you can loop through the players to find which one to lock.

ex.

1
2
3
4
5
6
7
8
9
10
11
12
13
function mute(id)
	if id>32 then
		for _,id2 in pairs(player(0,"table")) do
			if player(id2,"usgn")==id then
				--mute player(id2) here
				return true
			end
		end
		return false
	end
	--mute player(id) here
	return true
end

Code returns false if the usgn specified was not found.

old Re: Script Request

omg
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mutes=initArray(32)

addhook("say","rofl_mao")
function rofl_mao(id,txt)
	if string.sub(txt,1,5)=="@mute" then
		mutes[tonumber(string.sub(txt,7))]=1
		msg(player(tonumber(string.sub(txt,7)),"name").." has been muted! LOL!")
		return 1
	elseif string.sub(txt,1,7)=="@unmute" then
		mutes[tonumber(string.sub(txt,9))]=0
		msg(player(tonumber(string.sub(txt,9)),"name").." has been unmuted! LOL!")
		return 1
	else
		if mutes[id]==1 then
			msg2(id,"You are muted! LOL!")
			return 1
		end
	end
end

addhook("leave","vanilla_ice_cream")
function vanilla_ice_cream(id)
	mutes[id]=0
end
oh HA this is for player id
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
27
28
29
30
31
32
33
34
35
36
37
38
39
mutes={}

addhook("say","pepperoni_pizza")
function pepperoni_pizza(id,txt)
	if string.sub(txt,1,5)=="@mute" then
		local usgn=tonumber(string.sub(txt,7))
		if usgn<33 then
			usgn=player(usgn,"usgn")
		end
		table.insert(mutes,usgn)
		return 1
	elseif string.sub(txt,1,7)=="@unmute" then
		local usgn=tonumber(string.sub(txt,9))
		for i,v in ipairs(mutes) do
			if v==usgn then
				table.remove(mutes,i)
				return 1
			end
		end
	else
		for _,usgn in pairs(mutes) do
			if usgn==player(id,"usgn") then
				msg2(id,"You are muted! LOL!")
				return 1
			end
		end
	end
end

addhook("leave","banana_bonanza")
function banana_bonanza(id)
	local usgn=player(id,"usgn")
	for i,v in ipairs(mutes) do
		if v==usgn then
			table.remove(mutes,i)
			return
		end
	end
end
k should be working
edited 7×, last 23.07.12 02:23:04 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview