Forum

> > CS2D > Scripts > Give Admin CMD
Forums overviewCS2D overview Scripts overviewLog in to reply

English Give Admin CMD

18 replies
To the start Previous 1 Next To the start

old closed Give Admin CMD

superpegamento
User Off Offline

Quote
I need to say this word !give_admin [ID]
automatically add the user to the list of administrators
no need Functions for admin...

1
2
3
4
5
6
7
8
9
10
11
12
13
eg:

adms={}

addhook("say","say",317)
function say(id,t)
if t:sub(1,11)=="@dadm" then
local id=tonumber(t:sub(13))
table.insert(adms,player(id,"usgn"))
msg2(id,player(id,"name").." promoted to ADM.")
msg2(id,"You have been promoted to ADM!")
end
end
edited 5×, last 03.07.13 01:05:42 am

old Re: Give Admin CMD

EP
User Off Offline

Quote
that won't work because string.sub(TXT,1,5) will get only 5 characters from the put text... in that case (the command) , it will get only "!give" which is 5 chars long (1,5)..

make sure the substring is set correctly, let me correct it for you.. change t:sub(1,5) to t:sub(1,11) and then change t:sub(7) to t:sub(13)

remember that this script will TEMPORALLY make admins, because that table will be reset to default after you close the server.. you should implement an input/output system that saves your admins to a file blablabla

old Re: Give Admin CMD

superpegamento
User Off Offline

Quote
user EP has written
that won't work because string.sub(TXT,1,5) will get only 5 characters from the put text... in that case (the command) , it will get only "!give" which is 5 chars long (1,5)..

make sure the substring is set correctly, let me correct it for you.. change t:sub(1,5) to t:sub(1,11) and then change t:sub(7) to t:sub(13)

remember that this script will TEMPORALLY make admins, because that table will be reset to default after you close the server.. you should implement an input/output system that saves your admins to a file blablabla



thenks!
but I'm looking for that exactly
one that I save data from admin
edited 2×, last 03.07.13 01:06:27 am

old Re: Give Admin CMD

Homura Kami
User Off Offline

Quote
Don't forgot to add nil valus to you lua
For you lua use these nil(i hope it work) or you lua don't have index
Spoiler >

and change you addhook to
Spoiler >

and you function to
Spoiler >

becuz only adms is you index in nil
Other psart i just going to say IDK
and most important part is too add someting in adms command it look like these
Spoiler >

and i will work like these(if all part work correct)
Spoiler >
edited 1×, last 03.07.13 01:25:53 am

old Re: Give Admin CMD

Xirot
User Off Offline

Quote
user Chingy:
Quote
Probaly

Shit.
Well , you just respond when I make a comment otherwise you'll never comment.
Spoiler >
edited 1×, last 03.07.13 01:26:52 pm

old Re: Give Admin CMD

Dartex
User Off Offline

Quote
user Chingy has written
@user Xirot: Something called Brain. You probaly never had one.

the only one who haven't got Brain are plants , there is no point of your comment.

old Re: Give Admin CMD

Rainoth
Moderator Off Offline

Quote
user Dartex has written
user Chingy has written
@user Xirot: Something called Brain. You probaly never had one.

the only one who haven't got Brain are plants , there is no point of your comment.


Oh the irony.

@user Xirot: I'm a BIT similar to google. I see keywords then ASSUME what the person wants. I don't really know if that's what he needs and/or if I understood it correctly, while google takes keywords and then just searches for the most searched sites.
Except* Sunshine* (and I'll assume you tried to recite some kind of poem)
@user Homura Kami: I doubt that will work.
P.S. you forgot an "if"

old Re: Give Admin CMD

Homura Kami
User Off Offline

Quote
Sorry i am newbie so i don't know everything about addhook but for me i will try my best to help other people

old Re: Give Admin CMD

Shawni
User Off Offline

Quote
user Dartex has written
user Chingy has written
@user Xirot: Something called Brain. You probaly never had one.

the only one who haven't got Brain are plants , there is no point of your comment.

Animals don't have brains.

old Re: Give Admin CMD

Xirot
User Off Offline

Quote
user Shawni: You are talking about yourself? I agree.
Spoiler >

old Re: Give Admin CMD

Shawni
User Off Offline

Quote
user Xirot has written
user Shawni: You are talking about yourself? I agree.
Spoiler >

Hey, You 14years old skid, I don't have problems with you.
But, Seriously animals don't have brains.

old Re: Give Admin CMD

Chingy
User Off Offline

Quote
@user Xirot: You're just a conceited, arrogant 14 years old girl. We got enough of them in German citys. And you act even more worse. Congratz.
Btw: I have holidays therefore I have a lot of time since I won't be in Russia this summer.

@user Shawni: You probaly didn't understood my comment before. Therefore you have to be a plant. A very genious one.

old Re: Give Admin CMD

Shawni
User Off Offline

Quote
user Chingy has written
@user Xirot: You're just a conceited, arrogant 14 years old girl. We got enough of them in German citys. And you act even more worse. Congratz.
Btw: I have holidays therefore I have a lot of time since I won't be in Russia this summer.

@user Shawni: You probaly didn't understood my comment before. Therefore you have to be a plant. A very genious one.

Loled and still, I understood your comment and my message was to user Dartex:

old Re: Give Admin CMD

Xirot
User Off Offline

Quote
user Chingy: You have no reason to say that I'm a girl or I don't know what are you saying.
You talk to say nothing you just want to reply.
user Shawni: Keep back b*tch.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview