Author Topic: Limit Looking  (Read 2133 times)

This is an add-on where it would set how high you can look up and how low you can look.
So instead of looking directly up you would still have some space that you can't look up at. Also works for looking down.

I hope this makes sence

I believe this is default. setLookLimits(%arg1, %arg2);

I believe this is default. setLookLimits(%arg1, %arg2);
Okay, but how do you use it?
*I don't know Torque

Okay, but how do you use it?
Open your console using the ~ key, type in setLookLimits(number,number); Obviously the numbers are w/e you want.

I thought it was on a per player or datablock basis
not for the whole server?

I thought it was on a per player or datablock basis
not for the whole server?

Just because you use the console doesn't make it server-based. How do you think client-side mods work?

But it's Player::setLookLimits(%lookUpLimit, %lookDownLimit); and not a client sided function.

Just because you use the console doesn't make it server-based. How do you think client-side mods work?
u wot m8

hope all of the above makes sence

Just because you use the console doesn't make it server-based. How do you think client-side mods work?
I think you need to rethink what you said
and who you're talking to as well
and what you're talking about

Do those events work on every player in a server?

If you want to set the two numbers for everyone on the server:

function serverCmdsetLookLimitsall(%client, %looklimit1, %looklimit2)
{
    for(%i = 0; %i < ClientGroup.getCount(); %i++)
    {
        %player = ClientGroup.getObject(%i).player;
        %player.setLookLimits(%looklimit1, %looklimit2);
    }
}

and then anybody who knows that you have that command can play with it and set peoples limits way up/down/everywhere

If you want to set the two numbers for everyone on the server:

function serverCmdsetLookLimitsall(%client, %looklimit1, %looklimit2)
{
    for(%i = 0; %i < ClientGroup.getCount(); %i++)
    {
        %player = ClientGroup.getObject(%i).player;
        %player.setLookLimits(%looklimit1, %looklimit2);
    }
}
no stop

1.  This command is public. Anyone could use it on the server.
2.  You didn't check if %player exists. That will cause errors.

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?
« Last Edit: June 30, 2014, 07:35:41 AM by Ninjaman 4 »