Forum

> > CS2D > Scripts > cmd to reset score / remove bots
Forums overviewCS2D overview Scripts overviewLog in to reply

English cmd to reset score / remove bots

14 replies
To the start Previous 1 Next To the start

old cmd to reset score / remove bots

_Ultimate_
User Off Offline

Quote
OK guys i need to scipt the fast as possible

1. The command !resetscore so evryone can reset hes score
2. !nobots sometimes i add bots so i need the command !nobots if the users dont like them so they can kick them

Admin/mod comment

"2 SCIPTS" is a bad title. select better titles in future or your threads will be removed!

old Re: cmd to reset score / remove bots

Banaan
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("say","cmds")

function cmds(p,t)
	if(t=="!resetscore") then
		parse("setscore "..p.." 0")
		parse("setdeaths "..p.." 0")
	elseif(t=="!nobots") then
		for _,v in pairs(player(0,"table")) do
			if(player(v,"bot")==true) then
				parse("kick "..v)
			end
		end
	end
end

That should do the job...

old Re: cmd to reset score / remove bots

_Ultimate_
User Off Offline

Quote
omg thanks man,and is it possible to make scipts like

@lockt
@lockct
@unlockall
@makeadmin
@makemember
@makevip

? because i really need them if you can help me

xfire BotsKillers

old Re: cmd to reset score / remove bots

JONY
User Off Offline

Quote
@lockt, @lockct, @unlockall:
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
local lockt = false
local lockct = false

addhook("say","cmds")
function cmds(p,t)
	if(t=="!resetscore") then
		parse("setscore "..p.." 0")
		parse("setdeaths "..p.." 0")
	elseif(t=="!nobots") then
		for _,v in pairs(player(0,"table")) do
			if(player(v,"bot")==true) then
				parse("kick "..v)
			end
		end
	elseif(t=="@lockt") then
		lockt = true
	elseif(t=="@lockct") then
		lockct = true
	elseif(t=="@unlockall") then
		lockt = false
		lockct = false
	end
end

addhook("team","change")
function change(id, team)
	if (player(id,"team")) == 1 then
		if lockt == true then
			return 1
		end
	elseif(player(id,"team")) == 2 then
		if lockct == true then
			return 1
		end
	end
end

old Re: cmd to reset score / remove bots

_Ultimate_
User Off Offline

Quote
1.The @lockt @lockct @unlockall does not work
2.The @makevip @makemember @makeadmin...
i have lua scripts not amx2d whit some commands for member vip admin,but if i want to add some one admin i need to change lua and restart the server (its dedicated) so i want commands that automaticly change lua...

old Re: cmd to reset score / remove bots

Banaan
User Off Offline

Quote
There is not a standard 'admin' lua function. There are hundreds of admin scripts out there, and they all work in a different way. We therefore can't know exactly how to add an admin to your server. You should give us the name of the table containing admin USGN's (that's the most common way to do it) for us to be able to help you.

As for the lock, what exactly should it do? Prevent people from leaving a team or prevent people from joining a team?

old Re: cmd to reset score / remove bots

_Ultimate_
User Off Offline

Quote
Prevent people joining a team,i need that for tryouts when i do try outs i dont want other to join the game just SPECTATE,so i need the scipts to lock terrorirst and lock counter terrorist and the script Unlock All

old Re: cmd to reset score / remove bots

Banaan
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
25
26
27
28
29
30
31
32
33
34
35
36
lockt = false
lockct = false

addhook("say","cmds")
function cmds(p,t)
     if(t=="!resetscore") then
          parse("setscore "..p.." 0")
          parse("setdeaths "..p.." 0")
     elseif(t=="!nobots") then
          for _,v in pairs(player(0,"table")) do
               if(player(v,"bot")==true) then
                    parse("kick "..v)
               end
          end
     elseif(t=="@lockt") then
          lockt = true
     elseif(t=="@lockct") then
          lockct = true
     elseif(t=="@unlockall") then
          lockt = false
          lockct = false
     end
end

addhook("team","change")
function change(id, team)
     if (player(id,"team")) == 1 then
          if lockt == true then
               return 1
          end
     elseif(player(id,"team")) == 2 then
          if lockct == true then
               return 1
          end
     end
end

That should work...
Only thing that was wrong was the 'local' at the beginning.

old Re: cmd to reset score / remove bots

Banaan
User Off Offline

Quote
Oh you're right...

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
lockt = false
lockct = false

addhook("say","cmds")
function cmds(p,t)
	if(t=="!resetscore") then
		parse("setscore "..p.." 0")
		parse("setdeaths "..p.." 0")
		msg(player(p,"name").." has reset their score.")
	elseif(t=="!nobots") then
		for _,v in pairs(player(0,"table")) do
			if(player(v,"bot")==true) then
				parse("kick "..v)
			end
		end
		msg("All bots have been removed.")
	elseif(t=="@lockt") then lockt = true
	elseif(t=="@lockct") then lockct = true
	elseif(t=="@unlockall") then
		lockt = false
		lockct = false
	else return 0 end
	return 1
end

addhook("team","change")
function change(id, team)
	if team == 1 then
		if lockt == true then
			msg2(id,"©255000000This team is locked!")
			return 1
		end
	elseif team == 2 then
		if lockct == true then
			msg2(id,"©255000000This team is locked!")
			return 1
		end
	end
end

That works.

old Re: cmd to reset score / remove bots

_Ultimate_
User Off Offline

Quote
Ok thank you very much i am going to try now

edit:omg i changed the scripts and evrything stoped works even my other scripts stopeed so i get evrything back like beforore the other scripts stop working but

!nobots and !resetscore stopped working wtf is that i need help i really need the 5 commands


re-edit:I have repaired !resetscore and !nobots tomorow i will try to put again the @lockt @lockct @unlockall commands because i think the error is in my scripts thank you bannan
edited 2×, last 31.12.10 12:51:20 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview