Files

> > CS2D > Lua Scripts > RestrictedTeam
Files overviewCS2D overviewLua Scripts overview

English RestrictedTeam >

20 comments456 b, 635 Downloads

old RestrictedTeam

Orion-Pyro
User Off Offline

This script is to make a team impossible to join except if your USGN-ID is written in a table. Its useful for RPs for exemple.
If your USGN-ID isn't allowed to join the protected team, you'll can't join it and a message in the chatbox will appear (You cant join CT team because you are not Admin on this server !)
Here is the script with comments :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cts = {58099,23527} --Enter here the CT's USGN IDs
addhook("team","AdminJoin")
function AdminJoin(id,team)
	index = #cts
	if team == 2 then -- If the player choos CT team
		while index < #cts +1 and index > 0 do -- Indef of the table
			if player(id,"usgn")==cts[index] then -- Check if the USGN correspond to a value in the table
				return 0 -- If yes accept the changeteam
			else
				index = index -1
			end			
		end
		msg2(id,"You cant join CT team because you are not Admin on this server !")
		return 1 -- Else return 1
	end		
end
Put this script in ./sys/lua/ and change the ./sys/lua/server.lua with adding this line :
1
dofile("sys/lua/the_name_of_the_script_here")
At the line 5, change the 2 by :
0 to protect Spectator team
1 to protect Terrorists team
2 to protect Counter-Terrorists team

If you want to change the negation message (You can't join the team), just change it at the line 13)

If you want to add or remove some IDs, just do it on the table written at the first line. That's the only thing you have to do. Easy isn't it ?

Please comment and rate
edited 1×, last 26.07.10 04:05:59 pm
Approved by GeoB99

Download Download

456 b, 635 Downloads

Comments

20 comments
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old @a d e vrs

Hank2417
User Off Offline

did u put ure USGN ID on the script? ID not name
I like it!

old

a d e vrs
BANNED Off Offline

im in my server,im not a admin !

old

SuLeeh
COMMUNITY BANNED Off Offline

is good for role play maps thanks
I like it!

old

Surplus
User Off Offline

MasterX did you enter a USID or a USGN? You must enter USID's.
I like it!

old

MasterX
User Off Offline

I do everything as you explained it but it does not work!
I like it!

old

rawreddie
User Off Offline

I LOVE your script. If it was in real life I'd ask it on a date
I like it!

old

Slater
User Off Offline

Thank you... i need only that Script for my Happy Town
I like it!

old

TimeQuesT
User Off Offline

i think i has not stole the script,because kyle5471 is using a "for" command and orion-pyro uses "while".
that are 2 extreeemee diffrent commands.

while --> only boolean(true /false) bzw(1,0)
for --> counts up bzw down with an integer type (a number value) etc.

Orion-Pyro gets the last bzw the range of the array.
via "#cts" --> a bit longer way

kyle5471 uses ipairs to get them ,2 but i an other way ... --> fast way

Orion-Pyro used a complex way and kyle5471 a little faster way.

old

Orion-Pyro
User Off Offline

I didn't stole it
Stop say that, my script is completely diferent than his script.

old

HaRe
User Off Offline

Not realy he stole the script

old

Amaguya
User Off Offline

Omg.. = =
You are pro scripter.
I like it!

old

Orion-Pyro
User Off Offline

No on the kyle's script you need to add a query for every Admin USGN...

old

HaRe
User Off Offline

I have the same as u schinken

Txt file are better

old

TimeQuesT
User Off Offline

my script loads it out of a text file
but i won#t upload it(private)

old

The Camo
User Off Offline

I checked kyle5471's script, its same as yours, you just added the message.

old

Orion-Pyro
User Off Offline

Mine is better than yours because we don't need to add a lot of queries, we just add the CTs USGN in the table and that's all

old

kyle5471
User Off Offline

YOU JUST copied my script that i uploaded. sorry 1/5

old

Mirash
User Off Offline

Easy and nice!
I like it!

old

HaRe
User Off Offline

Oo my boy Orion from WFW, Its me HaRe

cool script u got

old

senar
User Off Offline

COOL for town maps (like happy town)
I like it!
To the start Previous 1 Next To the start