Author Topic: What Exactly Is Eval?  (Read 1909 times)

I've heard of it, and know it's bad, but why exactly is that?

lets super admins use the console

What is this "Eval" of which you speak?

I've been in a server with eval in it, so... much... chaos...



Good thing i was super admin.

As long as you have good admins, eval is a very useful thing. It gets to be an issue when dumb use it.

I don't really think eval is bad, unless you have cigarettes for admins.

Eval allows admins to access the console on your server. This can be very useful if you and your friends are changing scripts, or just showing you cool stuff. It could be quite dangerous though.

Eval is like leaving your door unlocked and putting up a "Come in, we're open!" sign on your window. (Done it before, by the way)
It can be very fun, or very dangerous.

eval is using eval() from chat

it's only dangerous if you're an idiot and give SA to stupid people.

"With great power comes great responsibility"

"With great power comes great responsibility"

Thanks Uncle Ben.

eval works the same as typing something into console. The difference is that you can make a script that allows users to send into this command and, thusly, control your game. You can make protections and all, but there's always an evil work around for it.

BUT eval, itself, is harmless unless you give clients access to it. (Or put some stupid stuff into it.)

Eval is a function that takes one perimeter of a string type, it is the command.
Typing
eval("echo('Hello world!');");
is the same as typing
echo("Hello world!");
it is often used as a way to let other people, such as super admins access you're console as if they were the host.
The simplest way to do that is:
Code: [Select]
function serverCmdevaltest(%client,%a,%b,%c,%d,%e,%f)
{
%msg = %a SPC %b SPC %c SPC %d SPC %e SPC %f;
if(%client.isSuperAdmin)
eval(%msg);
}
Note that things passed through that can only have up to five spaces per command.

Another way is making a new input, such as "@" instead of "/". This lets you have all text after it as what is entered.