Forum

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

English Admin Script

4 replies
To the start Previous 1 Next To the start

old Admin Script

Marcell
Super 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
37
38
39
40
Rank = 
   {
   [0] = 0, --// users not logged to USGN will be treated like a player with rank 0
   [6943] = 1338
	}
	
	RankNames = {
    [0] = "Usual Player",
    [1] = "VIP",
    [2] = "Admin's Helper",
    [3] = "Admin 1",
    [4] = "Admin 2",
    [5] = "Admin 3",
    [6] = "Admin 4",
    [7] = "Admin 5",
    [8] = "Super Admin",
    [9] = "Admin Controller",
	[1337] = "Scripter",
	[1338] = "Owner"
--// you can add more in the future and simply operate with >=, =, <=, <, >
}



CheckRank = function(id)
return (Rank[player(id, "usgn")] or 0)
end

addhook("startround","OnRestart")
function OnRestart()
parse("trigger quake_start")
parse("trigger haarp_demon")
end

addhook("join","OnOwnJoin")
function OnOwnJoin()
	if Rank == 1338 then
		msg2(id,""..cRED.."Welcome "..player(id).."! You loggined as owner on your server.")
	end  
end

I haven't got any error, but still not work, why?

old Re: Admin Script

Rainoth
Moderator Off Offline

Quote
This is just a blind guess as to why it might not be working but I'm fairly sure that it's because you're checking like you know nothing about tables or how to use them.

Let me show you your mistake.

Line 37
1
if TABLE "Rank" is equal to number 1338 then
Cool huh ?

// "loggined". Priceless.

old Re: Admin Script

Marcell
Super User Off Offline

Quote
yeah i know its logged as...

anyway if TABLE "Rank" is equal to number 1338 then
really not works...

old Re: Admin Script

Rainoth
Moderator Off Offline

Quote
I'm sorry but did you get hit in the head ?
Of course it wouldn't work. Those are words without meaning in a script. I just rephrased your line 37 if you can't read when I say "Line 37"

Read what line 37 means (I WROTE IT in my past comment) and realize what nonsense it is. Then try changing your script and learning your mistake

old Re: Admin Script

Avo
User Off Offline

Quote
1
2
3
4
5
6
addhook("join","OnOwnJoin")
function OnOwnJoin(id)
     if CheckRank(id) == 1338 then
          msg2(id,cRED.."Welcome "..player(id, "name").."! You loggined as owner on your server.")
     end  
end
Not sure if it gonna work since join hook is called instantly when player joins.

Using my script I see.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview