Author Topic: Limit Looking  (Read 2132 times)

Not sure if this really works.

package LookLimits
{
   function Armor::onAdd(%data,%this)
   {
      Parent::onAdd(%data,%this);   
      if($Pref::Server::LookLimits)
         %this.setLookLimits($Pref::Server::LookLimits[1],$Pref::Server::LookLimits[2]);
   }

   function Armor::onNewDatablock(%data,%this)
   {
      Parent::onAdd(%data,%this);   
      if($Pref::Server::LookLimits)
         %this.setLookLimits($Pref::Server::LookLimits[1],$Pref::Server::LookLimits[2]);
   }
};
activatepackage(LookLimits);

function serverCmdsetLookLimits(%this, %looklimit1, %looklimit2)
{
   if(%looklimit1 < 0) return;
   if(%looklimit1 < 1) return;
   if(!%this.isAdmin) return;
   $Pref::Server::LookLimits = !$Pref::Server::LookLimits;
   $Pref::Server::LookLimits[1] = %looklimit[1];
   $Pref::Server::LookLimits[2] = %looklimit[2];
   if(!$Pref::Server::LookLimits) %a = "\c2ON\c6. Max Lookup limit is \c4" @ %looklmit @ "\c6 while look down limit is \c4" @ %looklimit2 @ "\c6."; else %a = "\c0OFF";
   messageAll('',"\c6Look limts are " @ $Pref::Server::LookLimits @ %a);
    for(%i = 0; %i < ClientGroup.getCount(); %i++)
        if(isObject(%pl=ClientGroup.getObject(%i).player))
           %pl.setLookLimits(%looklimit1, %looklimit2);
}

Basically this will set it most of the time to whatever look limit it was set to.


            if(isObject(%pl = ClientGroup.getObject(%i).player;

Syntax error.



Wow, thanks. How did I miss that lol. Fixed.
It's still a syntax error.

Not sure if this really works.

-snip-
Basically this will set it most of the time to whatever look limit it was set to.
Why does it toggle every time it's called, and still require a value for up/down? If there's no first value, turn it off. If there's a positive first but no second, second is -first, and turn it on. If there's a first and second, turn it on.
« Last Edit: June 30, 2014, 12:00:01 AM by Chrono »


I did not see that at all.
It's still a syntax error.
And I fixed it. I was owning up to my mistakes because it was honestly a bad one. What's your point?

I was just giving him an idea. He could probably add that stuff if he wanted to anyways. And I'm not handicapped, I know I didn't check if the player exists.
Anyways, if you really want me to do that:

function serverCmdsetAllLookLimits(%client, %look1, %look2)
{
    if(%client.isSuperAdmin)
    {
        for(%i = 0; %i < ClientGroup.getCount(); %i++)
        {
            if(isObject(%pl = ClientGroup.getObject(%i).player));
                %pl.setLookLimits(%look1, %look2);
         }
    }
    else
        messageClient(%client, '', "\c6You must be Super Admin to use this command.");
}

Better?
Syntax error. No ; after an if statement.

What's your point?
He was just showing you that there is still a syntax error..