Author Topic: Syntax error ("CityRPG_getRandomMailbox(##)##;")  (Read 481 times)

Code: [Select]
function requestMailSend(%to,%from,%str)
{
   if(getSubStr(%to,0,4) $= "SYS:")
   {
      %sys=getSubStr(%to,4,strLen(%to));
      %obj=nametoid("CityRPG_GAME_SYS_" @ %sys);
      if(!isObject(%obj))
         return;
      %to=%obj;
   }
   else
   {
      %obj=findclientbyname(%to);
      if(!isObject(%obj))
         return;
      %to=%obj;
   }
   if(getSubStr(%from,0,4) $= "SYS:")
   {
      %sys=getSubStr(%from,4,strLen(%from));
      %obj=nametoid("CityRPG_GAME_SYS_" @ %sys);
      if(!isObject(%obj))
         return;
      %from=%obj;
   }
   else
   {
      %obj=findclientbyname(%from);
      if(!isObject(%obj))
         return;
      %from=%obj;
   }
   if(%from.getClassName() $= GameConnection)
   {
      if(isObject(%from.player))
         %mailbox=CityRPG_findClosestMailbox(%from.player.getPosition();
      else
         %mailbox=CityRPG_findRandomMailbox();
   }
   else
   {
      if(strLen(%from.scriptPos) > 0)
         %mailbox=CityRPG_findClosestMailbox(%from.scriptPos);
      else
         %mailbox=CityRPG_findRandomMailbox();
   }
   if(!isObject(%mailbox))
      return;
   %mailbox.addMail(%from,%to,%msg);
}

Syntax error report:
Code: [Select]
   }
   if(%from.getClassName() $= GameConnection)
   {
      if(isObject(%from.player))
         %mailbox=CityRPG_findClosestMailbox(%from.player.getPosition();
      else
         %mailbox=CityRPG_findRandomMailbox(##)##;
   }
   else
   {

Really?

I'll give you a clue - It's between lines 4 and 6 of the error report.

Pew: If you don't encourage them to work it out for themselves they'll never learn.
« Last Edit: October 12, 2010, 05:23:11 AM by Ephialtes »

Pew: If you don't encourage them to work it out for themselves they'll never learn.

True... :o
« Last Edit: October 12, 2010, 05:26:44 AM by Pew446 »

Syntax error report:
Code: [Select]
  }
   if(%from.getClassName() $= GameConnection)
   {
      if(isObject(%from.player))
         %mailbox=CityRPG_findClosestMailbox(%from.player.getPosition()[MISSING )];
      else
         %mailbox=CityRPG_findRandomMailbox(##)##;
   }
   else
   {

Found it. Oh forget, I hate small errors that I don't see when I code late at night.