Forum

> > CS2D > Scripts > Whats wrong? 2
Forums overviewCS2D overview Scripts overviewLog in to reply

English Whats wrong? 2

9 replies
To the start Previous 1 Next To the start

old Whats wrong? 2

Cons
User Off Offline

Quote
1
2
local rcon1 = tonumber(txt:sub(6))	
				parse("..rcon1")

Easy thing, but i am anoyyed with that!

old Re: Whats wrong? 2

Cons
User Off Offline

Quote
user archmage has written
1
parse(rcon1)


no no no no

1
2
3
4
if txt:lower():sub(1, 5) == "@rcon" then
	local rcon1 = tonumber(txt:sub(6))	
				parse("..rcon1")
			end

://////

old Re: Whats wrong? 2

archmage
User Off Offline

Quote
1
2
3
4
if txt:lower():sub(1, 5) == "@rcon" then
     	local rcon1 = tonumber(txt:sub(6))     
     	parse(tostring(rcon1))
end

What problem are you having? OP was so descriptive

old Re: Whats wrong? 2

sheeL
User Off Offline

Quote
user Devil-Thanh has written
1
parse(rcon1)
man


or

1
2
3
4
if txt:lower():sub(1, 5) == "@rcon" then
     local rcon1 = tonumber(txt:sub(6)) 
     parse("..rcon1)
end

old Re: Whats wrong? 2

Lee
Moderator Off Offline

Quote
Don't be a dick to other people on here, they're just trying to help you, if you need to vent and fuck someone's day up, do it somewhere else.

There's two problems with your code snippet. First of all, you're not closing off the parse string properly, neither are you supplying a parse command which is needed to properly execute anything meaningful on the server.

My guess is, you want to grant rcon privileges to the player that said @rcon pwd

1
parse("rcon_pw "..rcon1)

Which brings me to the crux of your problem. Parse is executed by the server, which means you're granting administrative privileges to the server... the user that gave the command will see absolutely no effects.

CS2D cannot take care of this for you. You will need to figure out a way such that whenever you say "@rcon pwd", if the supplied password is valid, to add the id of the player to a list somewhere that keeps track of authorized administrators, and whenever a say command is issued that requires authorization, to check whether the user is on that list or not.

You're not going to be able to use "rcon cmd" here because CS2D only allows a single rcon password, so no such validation technique exists. There is a way to bypass this but it's extremely hackish and you're better off just using chat commands.

old Re: Whats wrong? 2

Cons
User Off Offline

Quote
user Lee has written
More >


Hum i am sorry, than... What i want is really simple, and i already fixed.. I just wanted this:

@rcon >Rcon Cmd<

Only, but now its okay.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview