Forum

> > CS2D > Scripts > Whats wrong? 2
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Whats wrong? 2

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Whats wrong? 2

Cons
User Off Offline

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

Easy thing, but i am anoyyed with that!

alt Re: Whats wrong? 2

Cons
User Off Offline

Zitieren
user archmage hat geschrieben
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

://////

alt Re: Whats wrong? 2

archmage
User Off Offline

Zitieren
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

alt Re: Whats wrong? 2

sheeL
User Off Offline

Zitieren
user Devil-Thanh hat geschrieben
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

alt Re: Whats wrong? 2

Lee
Moderator Off Offline

Zitieren
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.

alt Re: Whats wrong? 2

Cons
User Off Offline

Zitieren
user Lee hat geschrieben
Mehr >


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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht