Dateien

> > CS2D > Lua Scripts > RestrictedTeam
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch RestrictedTeam >

20 Kommentare456 b, 614 Downloads

alt 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
1× editiert, zuletzt 26.07.10 16:05:59
Zugelassen von GeoB99

Download Download

456 b, 614 Downloads

Kommentare

20 Kommentare
Zum Anfang Vorherige 1 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt @a d e vrs

Hank2417
User Off Offline

did u put ure USGN ID on the script? ID not name
Ich mag es!

alt

a d e vrs
BANNED Off Offline

im in my server,im not a admin !

alt

SuLeeh
COMMUNITY BANNED Off Offline

is good for role play maps thanks
Ich mag es!

alt

Surplus
User Off Offline

MasterX did you enter a USID or a USGN? You must enter USID's.
Ich mag es!

alt

MasterX
User Off Offline

I do everything as you explained it but it does not work!
Ich mag es!

alt

rawreddie
User Off Offline

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

alt

Slater
User Off Offline

Thank you... i need only that Script for my Happy Town
Ich mag es!

alt

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.

alt

Orion-Pyro
User Off Offline

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

alt

HaRe
User Off Offline

Not realy he stole the script

alt

Amaguya
User Off Offline

Omg.. = =
You are pro scripter.
Ich mag es!

alt

Orion-Pyro
User Off Offline

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

alt

HaRe
User Off Offline

I have the same as u schinken

Txt file are better

alt

TimeQuesT
User Off Offline

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

alt

The Camo
User Off Offline

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

alt

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

alt

kyle5471
User Off Offline

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

alt

Mirash
User Off Offline

Easy and nice!
Ich mag es!

alt

HaRe
User Off Offline

Oo my boy Orion from WFW, Its me HaRe

cool script u got

alt

senar
User Off Offline

COOL for town maps (like happy town)
Ich mag es!
Zum Anfang Vorherige 1 Nächste Zum Anfang