Blockland Forums > Modification Help
Need help with Serverconnection.chasecam(99999);
jes00:
--- Quote from: Headcrab Zombie on November 23, 2011, 06:55:37 PM ---Try this
--- Code: ---//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);
}
}
}
--- End code ---
By the way, I think you'll find that 99999 is far too high of a number to use for this.
--- End quote ---
D: Just got it working.
--- Code: ---//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;
}
}
}
--- End code ---
@Headcrab Zombie P.S. All you did was take my code and change it a little -_-
David819:
D: this error happens:
--- Code: ---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
--- End code ---
Serverconnection.chasecam(99999);
or
Serverconnection.chasecam(9999);
David819:
It works THanks for the help guys!
Headcrab Zombie:
--- Quote from: jes00 on November 23, 2011, 07:01:53 PM ---@Headcrab Zombie P.S. All you did was take my code and change it a little -_-
--- End quote ---
If by 'change it a little' you mean 'fix it', then yeah.
It's not like there's very many ways to do this