Author Topic: Help with Syntax Error in my Delete function  (Read 721 times)

Here is what my console said:
>>> Some error context, with ## on sides of error halt:

function servercmdDelete(%client, %name)
{
 if(%client.isadmin)
 {
  FCBN(%name).player.delete;##
##}
}
>>> Error report complete.

What should be there or not be there?

delete();

also unless FCBN is stated elsewhere it's findclientbynamev

also unless FCBN is stated elsewhere it's findclientbynamev
Except without the v at the end

I know FCBN works because I changed my sisters clan tag with it, It was FCBN(Marti).ClanSuffix = ("Cube");

I am by no means an expert, but it sounds right about changing FCBN.
Another thing that you could do is this.

function servercmdDelete(%client, %name)
{
          if(%client.isAdmin)
          {
                    findclientbyname(%name);
                    %name.player.delete();
          }
}

I believe you were missing the parentheses after delete, and that is also a problem.

Except without the v at the end

HEHEHE

I pressed V.

I didn't mean to.  :cookieMonster:

I just tested it myself, FCBN is not a default function, you have some add-on defining for you.

FCBN("Marti").ClanSuffix = "Cube";
fixed

function servercmdDelete(%client, %name)
{
          if(%client.isAdmin)
          {
                    %name = findclientbyname(%name);
                    %name.player.delete();
          }
}
fixed

I just tested it myself, FCBN is not a default function, you have some add-on defining for you.
fixed
fixed
wouldn't it just be easier to do
Code: [Select]
function servercmdDelete(%client, %name)
{
          if(%client.isAdmin)
          {
                    findclientbyname(%name).player.delete();
          }
}

Thank you everyone! Its works now, I will be realising this in an add-ons (With other functions, of course).