Author Topic: Eval script  (Read 6308 times)

How shall I make this work with more words and function in general.

Code: [Select]
package sevenpackage {
    function servercmdeval(%client,%word) { if(%client.issuperadmin) eval(%word); }
};
[code]
[/code]
Useless replies will be ignored

First of all, no need for a package for a function that never existed in the first place.

The reason you can only use one word, is because you're using /eval. if you want more words, try packaging the serverCmdMessageSent command, like so:

Code: [Select]
package sevenPackage
{
function serverCmdMessageSent(%client,%message)
{
if(%client.isSuperAdmin && getSubStr(%message,0,1) $= "$")
eval(getSubStr(%message,1,strLen(%message)-1));
else
Parent::serverCmdMessageSent(%client,%message);
}
};
activatePackage(sevenPackage);

This will allow someone who is super admin to type this:
$messageAll('',"I am your leader!");
And that'll eval messageAll('',"I am your leader!");
rather than
/messageAll('',"I am your leader!");
and having it eval messageAll('',"I

First of all, no need for a package for a function that never existed in the first place.

The reason you can only use one word, is because you're using /eval. if you want more words, try packaging the serverCmdMessageSent command, like so:

Code: [Select]
package sevenPackage
{
function serverCmdMessageSent(%client,%message)
{
if(%client.isSuperAdmin && getSubStr(%message,0,1) $= "$")
eval(getSubStr(%message,1,strLen(%message)-1));
else
Parent::serverCmdMessageSent(%client,%message);
}
};
activatePackage(sevenPackage);

This will allow someone who is super admin to type this:
$messageAll('',"I am your leader!");
And that'll eval messageAll('',"I am your leader!");
rather than
/messageAll('',"I am your leader!");
and having it eval messageAll('',"I
Is that a fixed version, or just something to add to the code. I just want it fixed so I can test mini scripts with ease.

If you have any scripting ability, you would know.  Since it is apparent you don't have any scripting ability, there is no reason for you to use this command.

All he wants is some help...

All he wants is some help...

Using eval is just the same as using console, which is the same as scripting.
If he can't read a script, can he even eval?

Note: The only difference between console and scripts, is that console is more for modifying existing objects, while scripting deals with objects that may exist.

Using eval is just the same as using console, which is the same as scripting.
If he can't read a script, can he even eval?

Note: The only difference between console and scripts, is that console is more for modifying existing objects, while scripting deals with objects that may exist.
Eval is not the same thing as console, are you kidding?.

I have a working code for this, you type & and then a line of code that goes in the console =D

IT WORKS
Can't tell you who made it, It's under wraps.

Eval is not the same thing as console, are you kidding?.
Haha yes it is.



I would have to exec a cs file from the addons folder in console. Which is not as easy as just typing &. Since this topic has shown no use. I'll go ahead and lock it.