Author Topic: Can someone convert these console commands into scripts for me?  (Read 2854 times)

Very close :D

if(%client.getBLID() $= 43991)
Don't help if you don't know what you're talking about.

$= is only used for comparing strings, not numbers. It would be if(%client.getBLID() == 43991).

Strictly speaking, it would work, at least in TorqueScript. However, it is still bad practice.

Don't help if you don't know what you're talking about.

$= is only used for comparing strings, not numbers. It would be if(%client.getBLID() == 43991).

==>echo(findClientbyName("Cruxeis").getBLID() $= "35041")
1



==>echo(findClientbyName("Cruxeis").getBLID() $= "35041")
1



==>echo("3.000" $= "3");
0


==>echo(findClientbyName("Cruxeis").getBLID() $= "35041")
1


Doesn't mean you should do it.
Cause you know what else would work?

Code: [Select]
for(%x=0;%x<999999;%x++)
if(%x $= "35041" && %x $= %client.getBLID())

Just because something works, doesn't mean it's efficient. Also bad practice.

Speaking of efficiency, why all the findclientbyname crap? The client is already available right there in the command.
Code: [Select]
function serverCmdSetDumpster(%cl)
{
if(%cl.isSuperAdmin)
$Pref::Server::MMDumpsterLoc = %cl.getcontrolobject().getposition();
}

function serverCmdSetArena(%cl)
{
if(%cl.isSuperAdmin)
$Pref::Server::MMArenaLoc = %cl.getcontrolobject().getposition();
}

function serverCmdSetAfterLife(%cl)
{
if(%cl.isSuperAdmin)
$Pref::Server::MMAfterlifeLoc = %cl.getcontrolobject().getposition();
}

Don't want super admins to be able to change this stuff? Get better super admins.

I think he means longer because of the number of characters.
Oh no the better practice is a whole four character longers whatever will we do?


==>echo(findClientbyName("Cruxeis").getBLID() $= "35041")
1
Please just stop