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

ok so ingame if you are  in 3rd person and go n the console and type

"Serverconnection.chasecam(99999);

it does a chasecam type of setting.

"serverconnection.chasecam(0);"

but to deactivate and activate it how would it work with keybind?

Code: [Select]
//Script_chasecam

   $remapDivision[$remapCount] = "Chasecam-Mod";
   $remapName[$remapCount] = "Activate-Chasecam";
   $remapCmd[$remapCount] = "Activate";
   $remapCount++;
   $remapName[$remapCount] = "De-activate-Chasecam";
   $remapCmd[$remapCount] = "Deactivate";
   $remapCount++;
}

function Activate-Chasecam(%Client)
{
$prev.chasecam(Acsess Granted);
   $(Client) = 1;
   $Serverconnection.chasecam(99999);
}

{
function De-activate-chasecam(%Client)

$prev.chasecam(Acsess Denied);
   $(client) = 0;
   $Serverconnection.chasecam(0);
}
};
« Last Edit: November 23, 2011, 06:26:22 PM by David819 »

Should work:

just push the same keybind to toggle it.
Code: [Select]
//Script_chasecam

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

function ToggleDeChasecam(%Client, %down)
{
if(!%down)
{
if($ChaseCam::isOn == 1)
{
$prev.chasecam(Acsess Granted);
$(Client) = 1;
$Serverconnection.chasecam(99999);
}

else if($ChaseCam::isOn == 0)
{
$prev.chasecam(Acsess Denied);
$(client) = 0;
$Serverconnection.chasecam(0);
}
}
}


Oh and just so you know; what you put in $remapCmd[$remapCount] = ""; is the function called when you push the keybind.

You spelled Access wrong

You spelled Access wrong
Fixed.
Code: [Select]
//Script_chasecam

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

function ToggleDeChasecam(%Client, %down)
{
if(!%down)
{
if($ChaseCam::isOn == 1)
{
$prev.chasecam(Access Granted);
$(Client) = 1;
$Serverconnection.chasecam(99999);
}

else if($ChaseCam::isOn == 0)
{
$prev.chasecam(Access Denied);
$(client) = 0;
$Serverconnection.chasecam(0);
}
}
}

Hhmm.Still not showing up in the controlls list hold on.......

Hhmm.Still not showing up in the controlls list hold on.......
It should be under Chasecam-Mod.

It should be under Chasecam-Mod.
Nope not there.Let me try something.
« Last Edit: November 23, 2011, 06:34:58 PM by David819 »

Nope not there.Let me try something.
Found problem. Hold on I'ma fix it.(hopefully)

EDIT: I think I've got it, testing...

DOUBLE EDIT: It works now:

RAGE EDIT!!!: I gotta fix it again -_-
« Last Edit: November 23, 2011, 06:45:36 PM by jes00 »

yup :/
console error line 15
Code: [Select]
Client checking Add-On: Script_Chasecam
Loading Add-On: Script_Chasecam (CRC:1549998383)
Add-Ons/Script_Chasecam/client.cs Line: 15 - Syntax error.
>>> Some error context, with ## on sides of error halt:
   $remapName[$remapCount] = "Toggle Chasecam";

   $remapCmd[$remapCount] = "ToggleDeChasecam";

   $remapCount++;



function ToggleDeChasecam(%Client, %down)

{

^if(!%down)

^{

^^if($ChaseCam::isOn == 0)

^^{

^^^Serverconnection.chasecam(99999);

^^^$ChaseCam::isOn 1;##
##
^^}



^^else if($ChaseCam::isOn == 1)

^^{

^^^Serverconnection.chasecam(0);

^^^$ChaseCam::isOn 0;

^^}

^}

}
>>> Error report complete.

ADD-ON "Script_Chasecam" CONTAINS SYNTAX ERRORS



also do i need a server.cs in there or is client.cs just fine?

$prev.chasecam(Access Granted);
$(Client) = 1;
Neither of these are valid syntax.
I have no idea what you're trying to do in the first one, but change the second one to $ChaseCam::isOn = 1;
And do the same thing to the second set of them

also do i need a server.cs in there or is client.cs just fine?
server.cs for a serverside add-on, client.cs for a clientside addon. This is a client-side addon, so just a client.cs
« Last Edit: November 23, 2011, 06:53:44 PM by Headcrab Zombie »

Neither of these are valid syntax.
[/qoute]
yes we took out that part

server.cs for a serverside add-on, client.cs for a clientside addon. This is a client-side addon, so just a client.cs

ok thanks

valid syntax: yes we took out that part
« Last Edit: November 23, 2011, 06:55:43 PM by David819 »

Neither of these are valid syntax.
I have no idea what you're trying to do in the first one, but change the second one to $ChaseCam::isOn = 1;
And do the same thing to the second set of them
Lol I just found that out before you posted it, fixing...

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.