Author Topic: My scripting problems: 0  (Read 4248 times)

Post the entire script.

Why would that be relevant? Anyway, here it is:
Code: [Select]
$specialmode = 0;

function serverCmdSpecialmode(%client)

{
if ($specialmode==0)
{
messageAll('', "Special Mode has been turned \c3ON.");
$specialmode = 1;
}
else

//Problem
{
messageAll('', "Special mode has been turned \c3OFF.");
$specialmodet = 0;
} //Comes up with syntax error here - I have checked


$specialmode = 0;

function serverCmdSpecialmode(%client)
{
if ($specialmode==0)
{
messageAll('', "Special Mode has been turned \c3ON.");
$specialmode = 1;
}
else

//Problem
if ($specialmode==1)
{
messageAll('', "Special mode has been turned \c3OFF.");
$specialmodet = 0;
} //Comes up with syntax error here - I have checked

Why would that be relevant? Anyway, here it is:
$specialmode = 0;

function serverCmdSpecialmode(%client)

{
if ($specialmode==0)
{
messageAll('', "Special Mode has been turned \c3ON.");
$specialmode = 1;
}
else

//Problem
{
messageAll('', "Special mode has been turned \c3OFF.");
$specialmodet = 0;
} //Comes up with syntax error here - I have checked
}



Maybe the fact that you didn't close the function would be a problem?

Maybe the fact that you didn't close the function would be a problem?

It is closed, theres a bracket right above the one you added.

It is closed, theres a bracket right above the one you added.

Let me put this in better detail:

$specialmode = 0;

function serverCmdSpecialmode(%client)
{
    if ($specialmode==0)
    {
    messageAll('', "Special Mode has been turned \c3ON.");
    $specialmode = 1;
    }
    else
    {
    messageAll('', "Special mode has been turned \c3OFF.");
    $specialmodet = 0;
    } //Comes up with syntax error here - I have checked
}
« Last Edit: June 12, 2010, 01:58:11 AM by Pew446 »

Ok then. Crysist, it would not be needed to put "if ($specialmode==1)", because there is an else there. And even if you did put it there, it would not work since it is "==1" not "==0", then it would just go on then instantly go off.

Edit: Ignore
« Last Edit: June 12, 2010, 02:54:41 AM by Sammygood »

Heres another problem:

function serverCmdSpecialmode(%client)
{
    if ($specialmode==0)
    {
    messageAll('', "Special Mode has been turned \c3ON.");
    $specialmode = 1;
    }
    else
    {
    messageAll('', "Special mode has been turned \c3OFF.");
    $specialmodet = 0;
    } //Comes up with syntax error here - I have checked
}
« Last Edit: June 12, 2010, 03:15:04 AM by Pew446 »

That wasn't in my script, i must have accidentally put it there when posted. OK, problem solved.

That wasn't in my script, i must have accidentally put it there when posted. OK, problem solved.

Ah. Well good for you! :D