Author Topic: Need help with Serverconnection.chasecam(99999);  (Read 1274 times)

Try this

Code: [Select]
//Script_chasecam

   $remapDivision[$remapCount] = "Chasecam-Mod";
   $remapName[$remapCount] = "Toggle Chasecam";
   $remapCmd[$remapCount] = "ToggleChasecam";
   $remapCount++;

function ToggleChasecam(%down)
{
if(%down)
{
if($ChaseCam::isOn == 1)
{
$ChaseCam::isOn = 0;
$Serverconnection.chasecam(0);
}

else if($ChaseCam::isOn == 0)
{
$ChaseCam::isOn = 1;
$Serverconnection.chasecam(99999);
}
}
}

By the way, I think you'll find that 99999 is far too high of a number to use for this.
D: Just got it working.
Code: [Select]
//Script_chasecam

if(!$Client::ChaseCam::Binds) {
   $remapDivision[$remapCount] = "Chasecam-Mod";
   $remapName[$remapCount] = "Toggle Chasecam";
   $remapCmd[$remapCount] = "ToggleDeChasecam";
   $remapCount++;
   $Client::ChaseCam::Binds = 1;
}

function ToggleDeChasecam(%down)
{
if(!%down)
{
if($ChaseCam::isOn == 0)
{
serverConnection.chasecam(99999);
$ChaseCam::isOn = 1;
}

else if($ChaseCam::isOn == 1)
{
serverConnection.chasecam(0);
$ChaseCam::isOn = 0;
}
}
}

@Headcrab Zombie P.S. All you did was take my code and change it a little -_-

D: this error happens:
Code: [Select]
Add-Ons/Script_Chasecam/client.cs (0): Unable to find object: '' attempting to call function 'chaseCam'
BackTrace: ->ToggleChasecam


Add-Ons/Script_Chasecam/client.cs (15): Unable to find object: '' attempting to call function 'chaseCam'
BackTrace: ->ToggleChasecam


Add-Ons/Script_Chasecam/client.cs (0): Unable to find object: '' attempting to call function 'chaseCam'
BackTrace: ->ToggleChasecam


Add-Ons/Script_Chasecam/client.cs (15): Unable to find object: '' attempting to call function 'chaseCam'
BackTrace: ->ToggleChasecam


Add-Ons/Script_Chasecam/client.cs (0): Unable to find object: '' attempting to call function 'chaseCam'
BackTrace: ->ToggleChasecam
Serverconnection.chasecam(99999);
or
Serverconnection.chasecam(9999);
« Last Edit: November 23, 2011, 07:09:14 PM by David819 »

It works THanks for the help guys!

@Headcrab Zombie P.S. All you did was take my code and change it a little -_-
If by 'change it a little' you mean 'fix it', then yeah.
It's not like there's very many ways to do this