Blockland Forums > Modification Help
Syntax error ("CityRPG_getRandomMailbox(##)##;")
Pages: (1/1)
Bauklotz:
--- Code: ---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);
}
--- End code ---
Syntax error report:
--- Code: --- }
if(%from.getClassName() $= GameConnection)
{
if(isObject(%from.player))
%mailbox=CityRPG_findClosestMailbox(%from.player.getPosition();
else
%mailbox=CityRPG_findRandomMailbox(##)##;
}
else
{
--- End code ---
Ephialtes:
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.
Pew446:
--- Quote from: Ephialtes on October 12, 2010, 05:21:24 AM ---Pew: If you don't encourage them to work it out for themselves they'll never learn.
--- End quote ---
True... :o
Bauklotz:
--- Quote from: Bauklotz on October 12, 2010, 04:33:47 AM ---Syntax error report:
--- Code: --- }
if(%from.getClassName() $= GameConnection)
{
if(isObject(%from.player))
%mailbox=CityRPG_findClosestMailbox(%from.player.getPosition()[MISSING )];
else
%mailbox=CityRPG_findRandomMailbox(##)##;
}
else
{
--- End code ---
--- End quote ---
Found it. Oh forget, I hate small errors that I don't see when I code late at night.
Pages: (1/1)