Blockland Forums > Modification Help
Need help with Serverconnection.chasecam(99999);
<< < (3/4) > >>
David819:
yup :/
console error line 15

--- Code: ---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



--- End code ---

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

--- Quote from: jes00 on November 23, 2011, 06:16:42 PM ---$prev.chasecam(Access Granted);
$(Client) = 1;

--- End quote ---
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


--- Quote from: David819 on November 23, 2011, 06:49:56 PM ---also do i need a server.cs in there or is client.cs just fine?

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

--- Quote from: Headcrab Zombie on November 23, 2011, 06:51:20 PM ---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

--- End quote ---

ok thanks

valid syntax: yes we took out that part
jes00:

--- Quote from: Headcrab Zombie on November 23, 2011, 06:51:20 PM ---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

--- End quote ---
Lol I just found that out before you posted it, fixing...
Headcrab Zombie:
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.
Navigation
Message Index
Next page
Previous page

Go to full version