Blockland Forums > Modification Help
Warning script. Line 37 Syntax error.
(1/3) > >>
Wordy:
I have made this warning script for me to try out what I know. But unfortunately I am getting a syntax error on line 37.


--- Code: ---

//////////////////////////////////////////////
///////////Warn Clients              ///////////
///////////By Darren         ///////////
//////////////////////////////////////////////

package WarningScript
{
function ServerCmdWarnClient(%cl,%name)
        {
                if(%cl.isAdmin)
                        {
                            if(%name.isWarned=1)
                            {
                                MessageClient(%cl,"This user has already been warned.");
                            }
                            else
                            {
                                MessageClient(%name,"\c3You have been warned by a member of the moderating team.");
                                MessageClient(%name,"\c3Fail to come to terms with your warning and therefore will result in a \c4ban\3.");
                                %name.isWarned=1;
                            }
}
        }

function ServerCmdUnwarnClient(%cl,%name)
        {
               if(%cl.isAdmin)
{
                        MessageClient(%name,"\c3 You have been unwarned.");
                        %name.isWarned=0;
}
       }

Function ServerCmdCheckWarning(%cl,%name)   // LINE 37 STARTS HERE.
        {
                if(%cl.isAdmin)
{
                        if(%name.isWarned=1)
{
                                MessageClient(%cl," "@%name@"is on a warning");
}
                else
{
                                MessageClient(%cl," "@%name@"is not on a warning."); // ...
}
}
        }
        
function ServerCmdCheckStatus(%cl)
        {
                if(%cl.isWarned=1)
                {
                        messageclient(%cl,"\c3You are on a warning. \c7Be careful upon your next actions.");
                }
                else
                {
                        Messageclient(%cl,"\c3You're not on a warning.");
                }
        }
};
ActivatePackage(WarningScript);

function deactivatewarningscript()
    {
        deactivatePackage(WarningScript);
    }


--- End code ---

They may be many errors in here, but this is my first script I have made.

Thank you.
Khepri:
Your formatting is wat
heedicalking:
i think it's because you capitalized function
Wordy:

--- Quote from: Khepri on January 29, 2012, 09:35:17 AM ---Your formatting is wat

--- End quote ---
yes, i agree. I was using titan pad at the time.

--- Quote from: heedicalking on January 29, 2012, 09:39:51 AM ---i think it's because you capitalized function

--- End quote ---
yes, it was. thank you.
Otis Da HousKat:
You shouldn't use the assignment operator for boolean expressions.
Navigation
Message Index
Next page

Go to full version