Author Topic: Is this incorrect?  (Read 1331 times)

my friend wanted me to help him with his script...

Quote
function serverCmdExploit(%client)
{
    if(%client.isSuperAdmin)
    }
    else
    {
    MessageClient(%client, '', '\c6Congratulations SuperAdmin, %1 you have accessed into the Blockland code file.');
    MessageClient(%client, '', '\c8Fatal ERROR: Server Firewall taking action.');
    %player.Kill();
    }
  }
}

is this correct?

Yes.

In the superadmin check, you have a closing bracket but no opening one.

In the function itself, you have 3 closing brackets at the end, but only two are needed. Figure out which you don't need. syntax is vital.
I'm not sure that it makes a difference, but to be safe, you should change the messageclient opening and closing quotes from ' to ". Not the ones directly after %client, though.
Also, though I'm not sure about this, the %1 might show up as "%1". Try changing it to this:

Quote
MessageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " you have accessed into the Blockland code file.");

I cant check the syntax due to me not being able to get on blockland because I need to update me video drivers but I cant due to dxdiag not showing what Drivers I have...

Quote
function serverCmdExploit(%client)
{
    if(%client.isSuperAdmin)
    }
    else
    {
    MessageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " you have accessed into the Blockland code file.");
    MessageClient(%client, '', '\c8Fatal ERROR: Server Firewall taking action.');
    %player.Kill();
    }
  };

is that correct? or is it
                                   }
                                   return;
                                   {

Though this isn't really the forums section for this...
There's plenty of online tools to check and update your video drivers.
Does the graphics section of dxdiag just have blank results? Either way, you should be able to find what you have in the control panel.

Intel also has a nice tool for checking your video drivers, but that might only apply to intel chips.

I know for a fact that its Nvidia drivers but when i open dxdiag and go to Display it shows n/a for all the listings that I would need for The driver download look up.

is that correct? or is it
                                   }
                                   return;
                                   {

Under the if(%client.isSuperAdmin), change the "}" to "{"(new line, same justification) "}".

I also might recommend that you change it to if(!%client.isSuperAdmin), and then swap out the else{<stuffhere>} and put it under the first if.
also, at the end, take off the ";" and move the last bracket over so it's aligned with the very first.

So
Quote
function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin)
    {
    }
    MessageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " you have accessed into the Blockland code file.");
    MessageClient(%client, '', '\c8Fatal ERROR: Server Firewall taking action.');
    %player.Kill();
    }
  };

??? That doesnt look right at the {
                                                     }
part

function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin)
    {
       What exactly do you want to happen if the client is not Super Admin? There is nothing happening in this admin check.
    }
    MessageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " you have accessed into the Blockland code file.");
    MessageClient(%client, '', '\c8Fatal ERROR: Server Firewall taking action.');
    %player.Kill();
    }
  };You don't need a semicolon here.

I think what you want, if this function is actually going to do something other than message and kill the player is:

Code: [Select]
function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin)
    {
    messageClient(%client,'', "\c6Congratulations SuperAdmin, " @ %client.name @ " \c6you have accessed into the Blockland code file.");
    messageClient(%client,'', "\c8Fatal ERROR: Server Firewall taking action.");
    %player.Kill();
    return:
    }
       // Do Stuff Here
}
« Last Edit: July 22, 2011, 09:03:28 PM by sh0ckthealien »

I dont want it to do anything if your not SA acting as if its not even existing as a command...

Quote
function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin)
    {
    messageClient(%client,'', "\c6Congratulations SuperAdmin, " @ %client.name @ " \c6you have accessed into the Blockland code file.");
    messageClient(%client,'', "\c8Fatal ERROR: Server Firewall taking action.");
    %player.Kill();
    return;
    }

}

That is what I want it to be if that works...
« Last Edit: July 22, 2011, 09:16:33 PM by Blocker Ctgr »

EDIT:
Quote
function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin)
    {
    messageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " \c6you have accessed into the Blockland code file.");
    messageClient(%client, '', "\c8Fatal ERROR: Server Firewall taking action.");
    %player.Kill();
    return;
    }
   messageAll(%client, '', "\c6Firewall Protection Warning: @ %client.name @ \c6 is trying to access the Server Code file.");
}

Does that work??

function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin) //You said you don't want it to do anything if you're not SA. Therefore, drop the "!", which means "not". Ex: if(!%client.isSuperAdmin) translates to "If the client is not super admin".
    {
    messageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " \c6you have accessed into the Blockland code file.");
    messageClient(%client, '', "\c8Fatal ERROR: Server Firewall taking action.");
    %player.Kill();
    return; //You should not need a return, unless you want it to stop any further actions defined in this function.
    }
   messageAll(%client, '', "\c6Firewall Protection Warning: @ %client.name @ \c6 is trying to access the Server Code file."); //MessageAll Messages everyone. therefore, take out the first argument, "%client,". Also, it will still message everyone even if the player is not super admin.
}

Okay then..

Code: [Select]
function serverCmdExploit(%client)
{
    if(!%client.isSuperAdmin)
    {
    return;
    }
    messageClient(%client,'', "\c6Congratulations SuperAdmin, " @ %client.name @ " \c6you have accessed into the Blockland code file.");
    messageClient(%client,'', "\c8Fatal ERROR: Server Firewall taking action.");
    %player.Kill();
   messageAll('', "\c6Firewall Protection Warning:" @ %client.name @ "\c6 is trying to access the Server Code file.");
}
« Last Edit: July 22, 2011, 09:45:53 PM by sh0ckthealien »

Ok so function serverCmdExploit(%client)
{
    if(%client.isSuperAdmin)
    {
    return;
    }
    messageClient(%client,'', "\c6Congratulations SuperAdmin, " @ %client.name @ " \c6you have accessed into the Blockland code file.");
    messageClient(%client,'', "\c8Fatal ERROR: Server Firewall taking action.");
    %player.Kill();
   messageAll('', "\c6Firewall Protection Warning:" @ %client.name @ "\c6 is trying to access the Server Code file.");
}

works?

You didn't define %player. I've heard "getPlayerName()" is preferred. You're re-defining \c6 for no reason.

Code: [Select]
function serverCmdExploit(%client) {
if(!%client.isSuperAdmin) {
chatMessageClient(%client, '', "\c6Congratulations SuperAdmin," SPC %client.getPlayerName() SPC "you have accessed into the Blockland code file.");
chatMessageClient(%client, '', "\c8Fatal ERROR: Server Firewall taking action.");
%client.player.Kill();
chatMessageAll('', "\c6Firewall Protection Warning:" @ %client.getPlayerName() @ " is trying to access the Server Code file.");
}
}

"chat" part might need adjustment.