Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 264 65 66338 339 Next To the start

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Flacko has written
1- Use addhook("msg","your_function"), and parse it

msg hook...
You meant something else? Right?

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Blazzingxx has written
Flacko has written
1- Use addhook("msg","your_function"), and parse it

msg hook...
You meant something else? Right?


Yea, I'm failing today, it's parse.

old List of Admins?

Toa Hero 92
User Off Offline

Quote
Hi...

I would like to know how to make a single list of USGN ID NUMBERS instead of what I am doing now. The purpose is that on my server I have made a script that when someone joins my server and their U.S.G.N. id number matches the one I have declared, it declares the to be an Administrator for my server along with giving various boosts and items. What I am currently doing is making each number into an individual hook/function block and I would like to know how I can have a list of numbers and if it matches any of the listed it declares them to be admins, etc...

OK, now here is what I have written...

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
addhook("spawn","adminspawn")
function adminspawn(id)

  --Adminspawns
  
adminid = usgnidnum

if (id>0)then
if (player(id, "usgn") == adminid) then
parse("speedmod "..id.." 50; equip "..id.." 88; equip "..id.." 83; equip "..id.." 74; equip "..id.." 45")
parse("setmaxhealth "..id.." 250; sethealth "..id.." 250")
parse("msg ©135013208 "..player(id,"name").." is an Administrator for this Server! @C")
end
end
end

addhook("spawn","adminspawn1")
function adminspawn1(id)

  --Adminspawns
  
adminid1 = usgnidnum

if (id>0)then
if (player(id, "usgn") == adminid1) then
parse("speedmod "..id.." 50; equip "..id.." 88; equip "..id.." 83; equip "..id.." 74; equip "..id.." 45")
parse("setmaxhealth "..id.." 250; sethealth "..id.." 250")
end
end
end


I would also appreciate it if you could tell me how to make my own, I believe they are called "tables" at least if that is what I am requesting.
I would like to know how to make on my own so that i could do that in any situation.

I am also look for a script that will make a server message whenever anyone types rcon, rcon_pw, & rcon_password.
I believe it is like the "badwords" script. And I would also like to know if I should type for example "rcon speedmod 1 50" that it would register that I typed rcon. I must also be clear that I do not want it to declare what was typed after rcon (I don't want it to display for all to see, my rcon password).
If you could also tell me how to make a word list for myself, as well as tell me how to make the advertise script alternate between a number different messages, that would also be appreciated.

Thank You.

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Just use something like that:
1
2
3
4
5
6
7
8
9
[b]adminid = {1232,4231,4324} -- USNG ids list[/b]

[b]for i = 1,#adminid do[/b]
	if (player(id, "usgn") == [b]adminid[i][/b]) then
		parse("speedmod "..id.." 50; equip "..id.." 88; equip "..id.." 83; equip "..id.." 74; equip "..id.." 45")
		parse("setmaxhealth "..id.." 250; sethealth "..id.." 250")
		msg("©135013208 "..player(id,"name").." is an Administrator for this Server! @C")
	end
[b]end[/b]

I marked parts which you should use for your script.

old What does this do?...

Toa Hero 92
User Off Offline

Quote
OK, but my request had multiple parts.

1: Tell me how to make lists for myself (in any situation I might need them)

2:
Toa Hero 92 has written
I am also look for a script that will make a server message whenever anyone types rcon, rcon_pw, & rcon_password.
I believe it is like the "badwords" script. And I would also like to know if I should type for example "rcon speedmod 1 50" that it would register that I typed rcon. I must also be clear that I do not want it to declare what was typed after rcon (I don't want it to display for all to see, my rcon password).

This as well.

3:
Toa Hero 92 has written
tell me how to make a word list for myself

This too.

4:
Toa Hero 92 has written
tell me how to make the advertise script alternate between a number different messages

This too.

If anyone could help me with all or some of these I would be very grateful.

Thank you

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
(Script) Type usgnlist in console to see list of ppl with usgn id:
1
2
3
4
5
6
7
8
9
10
11
12
addhook("parse","parses")
function parses(cmd)
	if (cmd=="usgnlist") then
		for i=1,32 do
			if (player(i,"exists") and player(i,"usgn") > 0) then
				print("©000255000"..player(i,"name").." with usgn ID: "..player(i,"usgn"))
			end
		end
		return 2
	end
	return 0
end

What you mean with wordlist anyway?
List in console?

Advertise (you need to use dedicaded to test it):
1
2
3
4
5
6
7
8
9
10
11
message = {'this is first message','2nd message','3RD message!'}
msg = 1
addhook("join","joins")
function joins(p)
	if (msg >= 1 and msg<= #message) then
		msg = msg + 1
	else
		msg = 1
	end
	msg2(p,message[msg]..'@C')
end
edited 1×, last 09.10.09 10:43:34 pm

old Word list

Toa Hero 92
User Off Offline

Quote
A word list like the one used in this script
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
--------------------------------------------------
-- Simple Badwords Filter by Unreal Software    --
-- 22.02.2009 - www.UnrealSoftware.de           --
--------------------------------------------------

if sample==nil then sample={} end
sample.badwords={}

--------------------------------------
-- BADWORDS TABLE (LOWERCASE)       --
--------------------------------------
sample.badwords.words = {"lol","a","mad","am","i"}


--------------------------------------
-- HANDLE BADWORDS IN SAY MESSAGES  --
--------------------------------------
addhook("say","sample.badwords.say")
function sample.badwords.say(p,t)
	t=string.lower(t)
	for i = 1,#sample.badwords.words do
		if (string.find(t,sample.badwords.words[i])~=nil) then
			msg(player(p,"name").." said a bad word!")
			parse("kick "..p)
			break
		end
	end
end

And yes i want it to register what is typed into console, because this script only handles the words typed in "say"
And pls read this
Toa Hero 92 has written
And I would also like to know if I should type for example "rcon speedmod 1 50" that it would register that I typed rcon. I must also be clear that I do not want it to declare what was typed after rcon (I don't want it to display for all to see, my rcon password)


Thank you

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Bad words list will be shown at server start (In console):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if sample==nil then sample={} end
sample.badwords={}

sample.badwords.words = {"I","cant","show","bad","words","here"}
print('== List Of Bad Words ==')
for i = 1, #sample.badwords.words do
	print(i..'. '..sample.badwords.words[i])
end
addhook("say","sample.badwords.say")
function sample.badwords.say(p,t)
	t=string.lower(t)
	for i = 1,#sample.badwords.words do
		if (string.find(t,sample.badwords.words[i])~=nil) then
			msg(player(p,"name").." said a bad word!")
			parse("kick "..p)
			break
		end
	end
end

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
how can i make a console command with parses
Example:
setmaxhealth <id> <ammount>


that is only example

also isn't there a hook for team kills i looked in info.txt but did not see it

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
playa slaya has written
also isn't there a hook for team kills i looked in info.txt but did not see it

Team Kill Thing :
1
2
3
4
5
6
addhook("kill","kills")
function kills(p,v)
	if (player(p,"team") == player(v,"team")) then -- Checks If Teamkill
		msg(player(p,"name")..' Team killed '..player(v,"name")..'@C')
	end
end

@Toa Hero 92
You should explain me more clear about that rcon thing...
I think that's not possible to make this until next version.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
playa slaya has written
how can i make a console command with parses
Example:
setmaxhealth <id> <ammount>


that is only example

also isn't there a hook for team kills i looked in info.txt but did not see it


WTF i spent 4 minutes writing a reply to your question

old Re: Lua Scripts/Questions/Help

Night Till Death
User Off Offline

Quote
is there a possibility to create 2 supplys from 1 player?

i mean for example: i want to create 2 supplys 1 for CT with m4a1 and second next to the CT 1 with Ak47 is that possible?

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
NTD has written
is there a possibility to create 2 supplys from 1 player?

i mean for example: i want to create 2 supplys 1 for CT with m4a1 and second next to the CT 1 with Ak47 is that possible?

Yes, you can use building mode for that.
To the start Previous 1 264 65 66338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview