and how to make admin certain people and where to put it?
Forum
CS2D Scripts Lua Scripts/Questions/Helpand how to make admin certain people and where to put it?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook([[build]],[[builder]]) function builder(id,type,x,y,mode,objectid) 	if type == 8 then 		menu(id,[[Turret,Normal Turret,Double Turret,Tripple Turret]]) 		return 1 	end end addhook([[menu]],[[menuer]]) function menuer(id,men,sel) 	if men == [[Turret]] then 		local rot = player(id,"rot") 		local team = player(id,"team") 		local x = player(id,"tilex") 		local y = player(id,"tiley") 		if sel == 1 then 			parse([[spawnobject 8 ]]..x..[[ ]]..y..[[ ]]..rot..[[ 0 ]]..team..[[ ]]..id) 		elseif sel == 2 then 			parse([[spawnobject 11 ]]..x..[[ ]]..y..[[ ]]..rot..[[ 0 ]]..team..[[ ]]..id) 		elseif sel == 3 then 			parse([[spawnobject 12 ]]..x..[[ ]]..y..[[ ]]..rot..[[ 0 ]]..team..[[ ]]..id) 		end 	end end
try this ...
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("ai_goto","zmgo") function zmgo(id,x,y) [and i should write here other stuff (which i dont know)] end or addhook("ai_goto","zmgo") function zmgo(id,32,64) end
like when i use:
NewMember(15101,"orange","ViP")
when i say anything it will be like that:
RyceR [ViP]: Hi
plz help, here is your script but edited...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Script By Blazzingxx Colors = { grey = "195195195", orange = "255090000", green = "105255000", purple = "190000190" } AdminTable = { } addhook("say","AdminSay") function NewMember(USGN,COLOR,RANK) AdminTable[USGN] = { C = COLOR, R = RANK} local A = AdminTable[USGN] end function AdminSay(P,T) local A = AdminTable[player(P,"usgn")] if A then msg("©"..Colors[string.lower( A.C )]..player(P,"name").." ["..string.upper( A.R ).."]: "..T) return(1) end return(0) end NewMember(15101,"orange","Admin")
1
string.upper( A.R )
1
A.R
Though, it should be VIP instead of ViP.
1
NewMember("15933",Color[grey],"VIP")
on another script ?
like script builder IN the server
1
2
3
2
3
FILE = io.open (filename , "r+") O_FILE = io.output(FILE) O_FILE:write("YOUR_CODE_GOES_HERE")
That should do the job correctly, I think. Didn't test it though.
1
2
3
2
3
file = io.open("FILE PATH","a") file:write("CODE") file:close()
think this should work, i'm using it like this
BureX has written
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("ai_goto","zmgo") function zmgo(id,x,y) [and i should write here other stuff (which i dont know)] end or addhook("ai_goto","zmgo") function zmgo(id,32,64) end
Can i make "ai_goto" more of them ? like every random bot goes to random "ai_goto" and starts to attack when destination is reached ? (nvm i forgot to copy paste)
edited 2×, last 23.12.10 12:18:38 pm
does it make "new line"
like if the script has 10 lines
it makes one more line but writed with the script that i want
We aren't ignoring u neccisarily
And yes, the code should work, since there isn't much to make bugs anyway.
@TDShuft:
It's DannyDeth
And what will happen is this:
File before writing:
1
2
3
4
5
2
3
4
5
------------------ -- TEST -- ------------------ msg "B4 Writing to file"
1
msg "Now it is after :P"
The file should look like this:
1
2
3
4
5
6
2
3
4
5
6
------------------ -- TEST -- ------------------ msg "B4 Writing to file" msg "Now it's after :P"
1
2
3
4
5
2
3
4
5
------------------ -- TEST -- ------------------ msg "B4 Writing to file"msg "Now it's after :P"
So when you are writing to the file it is best to put a "\n" before the rest of your code to be sure
like this > ?
1
2
3
2
3
FILE = io.open (filename , "/n") O_FILE = io.output(FILE) O_FILE:write("YOUR_CODE_GOES_HERE")
I will show you a working example.
1
2
3
2
3
FILE = io.open("THE_FILENAME.lua", "THE_MODE ( I reccomend "a" or "r+" )") FILE:write('\n msg "the \ n thing makes a newline before your code "') FILE:close()
admins={"1,2,3,4,5"} and like that (obvious ill puted not 1-5 usgns lol)
how can i edit to put ,6 and is there any how ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Script By Blazzingxx Colors = { grey = "195195195", orange = "255090000", green = "105255000", purple = "190000190" } AdminTable = { } addhook("say","AdminSay") function NewMember(USGN,COLOR,RANK) 	AdminTable[USGN] = { C = COLOR, R = RANK} 	local A = AdminTable[USGN] end function AdminSay(P,T) 	local A = AdminTable[player(P,"usgn")] 	if A then 		msg("©"..Colors[string.lower(A.C )]..player(P,"name").." ["..string.upper( A.R ).."]: "..T) 	return(1) 	end 	return(0) end NewMember(15101,"orange","Admin")