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

No no no. if(%client.isSuperAdmin) {

You should also be checking if %client.player exists.

You should also be checking if %client.player exists.

And how might I do that?

No no no. if(%client.isSuperAdmin) {

My way is correct. Your way would only kill Super Admins. Read how I did the script. If you can't, I suggest you look through examples of code before attempting to code anything. Seriously.

Updated vvvvvvvvvvvvvvvvvvvvv
« Last Edit: July 23, 2011, 01:05:08 AM by Blocker Ctgr »

Quote
function serverCmdExploit(%client) {
   if(!%client.isSuperAdmin) {
      chatMessageClient(%client, '', "\c6Congratulations" SPC %client.getPlayerName() SPC ", you have accessed into the Blockland code file.");
      chatMessageClient(%client, '', "\c6Congratulations" SPC %client.getPlayerName() SPC ", Opening Server Code File.");      
      %client.player.Kill();
      chatMessageAll('', "\c8Fatal ERROR: Server Code Files have been breached by" @ %client.getPlayerName() @ " server Firewall taking action...");
   }
}

Happy?
« Last Edit: July 23, 2011, 01:03:31 AM by Blocker Ctgr »

Holy crap, my eyes. It burns! God damn it, Zack, step in here. I can't take it! I just can't take it! Argh... I need to say one thing.

What you were originally doing was stopping the script if they were a Super Admin. It would kill all but Super Admins, which hosts also are. What I did was make it check if they are not a Super Admin, then doing it. You can inverse a variable check. Argh. Zack, hurry.

Edit: You edited. :( Weird... I'm so confused.
« Last Edit: July 23, 2011, 01:11:29 AM by MegaScientifical »

Yes it is what you gave me... I had the idea earlier but I didnt change it... the script doesnt allow anyone past it. I wrote the other part of the script (the code files the script mentions).

What I did was make it check if they are not a Super Admin, then doing it.

I thought he wanted to "punk" his SA's if they tried to use the command.

Code: [Select]
if(!%client.isSuperAdmin)
{
    return;
}

That would stop the script for people who are not SA.
Also, I totally didn't catch the missing %client.player.kill(); Thanks for pointing that out.

Try using this instead of messageAll or chatmessageAll
Code: [Select]
messageAllExcept(%client,-1,"\c8Firewall Protection Warning: " @ %client.getplayerName() @ " is trying to access the Server Code file.");
EDIT: I could rewrite this whole thing in a better way, but it seems rather pointless to me to fool your Super Admins like this. I don't get the "funny" part I guess.
« Last Edit: July 23, 2011, 01:31:02 AM by sh0ckthealien »

Let me clean that up for you.

function serverCmdExploit(%client)
{
   if(%client.isSuperAdmin)
   {
      MessageClient(%client, '', "\c6Congratulations" SPC %client.getPlayerName() SPC ", you have accessed into the Blockland code file.");
      MessageClient(%client, '', "\c6Opening Blockland Code Files...");     
      %client.player.Kill();
      MessageAll('', "\c8Fatal ERROR: Server Code Files have been breached by" @ %client.getPlayerName() @ " server Firewall taking action...");
   }
   else
   {
   messageClient(%client, '', "\c6What are you doing? This is Super Admin only!");
   }
}

I've fixed it so that only Super admins can do it. And I've cleaned it up a bit.