Forums Index >> Modding >> Script Syntax--is there really an error?



Page : <1> :


The error report is here:

 

                                        
game/server/Admin Script/AdminCodes.cs Line: 1601 - Syntax error.
>>> Advanced script error report. Line 3201.
>>> Some error context, with ## on sides of error halt:
if(IsMinister(%sender,"You're not a Minister or Dictator"))
loadkick(%sender,##%##msg);
return;
}
else
{centerprint(%sender,%code SPC "is not a code",4,4);
>>> Error report complete.

 


Can anyone find an error in this codeblock? I couldn't. Thanks in advance for any help.

Sunday, January 01, 2006 at 1:00:08 PM

Could you copy and paste that including more lines above and beneath from the file?
If my assumtion is correct you have too many else ifs
I can fix that but I need to make sure that is the problem

 

 

 

 

Sunday, January 01, 2006 at 1:19:04 PM

AHA!!! Too many else ifs! I had had that problem before when I tried to add other "humane" kicking codes! THE MYSTERY IS SOLVED! WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOTTTT!!!!! XD XD XD I'll send the codes, too, just in case.

Sunday, January 01, 2006 at 1:26:27 PM

Lol, okay monica :)
If you need any help just holler

 

 

 

 

Sunday, January 01, 2006 at 1:27:27 PM

Hmm...now TT manages to find another error...

 

                                        
if(IsMinister(%sender,"You're not a Minister or Dictator"))
loadkick(%sender,%msg);
return;
}
else
##
## {centerprint(%sender,%code SPC "is not a code",4,4);
return;
}
}

 


Sunday, January 01, 2006 at 1:40:14 PM

Like I thought...
Monica... Take out the last couple codes and put this instead

 

                                        
else
{
AdminCodes2(%sender,%a2);
}

 

Then make a new function named AdminCodes(%sender,%a2) and carry on with the codes you took out just like you do with the first AdminCodes function
make sure you end it with the "Thats Not a Code!" junk :)

 

 

 

 

Last edited: Sunday, January 01, 2006 at 1:50:12 PM

Sunday, January 01, 2006 at 1:44:23 PM

Interesting... I'll try it if I can't find any more useless codes.

Sunday, January 01, 2006 at 1:45:54 PM

Monica can you go back to my thread and help me please. :)

Sunday, January 01, 2006 at 1:50:35 PM

IT WORKS!! Thanks a lot! I never knew there could be too many else if statements... :o

Sunday, January 01, 2006 at 1:53:44 PM

Yes... Eventually torque gets tired of else ifs....
glad to be of service :)

 

 

 

 

Sunday, January 01, 2006 at 1:54:45 PM

One more thing before you run away:
I added this function:

 

                                        
function dlkick(%sender,%msg)
{
%match = matchClientName(%msg);
%client = firstword(%match);
%status_message = restwords(%match);
if(%client == -1)
{
bottomprint(%sender,%status_message,4,4);
return;
}

if(isObject(%client.ai))
{
centerprint(%sender,"Bots never load missions! ",4,4);
return;
}
%client.delete($Admin::Messages::OnLoadKick);
}

 


It had a problem here:

 

                                        
Executing game/server/Admin Script/AdminCodes.cs.
game/server/Admin Script/AdminCodes.cs Line: 395 - Syntax error.
>>> Advanced script error report. Line 789.
>>> Some error context, with ## on sides of error halt:
centerprint(%sender,"Bots never load missions! :P",4,4);
return;
}
function ##d##lkick(%sender,%msg)
{
%match = matchClientName(%msg);
%client = firstword(%match);
>>> Error report complete.

 


I can't seem to find the error! Are there too many functions? :o

Sunday, January 01, 2006 at 2:46:25 PM

You are most likely missing { or } or ; somewhere in that general vicinity

 

 

 

 

Sunday, January 01, 2006 at 3:45:08 PM

W00t TY Warfare! Forgot the whole part about %client.delete in the previous function. :P
@All
Feel free to post your script errors here, and WF or I will try to fix them. (Doesn't it seem really hard to fix your own script errors? It's probably because you have this ubiquitous belief that you are always right and no one is as smart as you.)

Sunday, January 01, 2006 at 3:55:57 PM


 

(Doesn't it seem really hard to fix your own script errors? It's probably because you have this ubiquitous belief that you are always right and no one is as smart as you.)

 

What if its true? :P

EDIT: I dont think that... There are others smarter than me... I am just the one with the most time :)

 

 

 

 

Last edited: Sunday, January 01, 2006 at 5:22:09 PM

Sunday, January 01, 2006 at 5:21:27 PM

If(IsMinister(%sender,"You're not a Minister or Dictator"))
loadkick(%sender,%msg);
return;
}

See that? Just simple, you were missing a {!
it should be
if(IsMinister(%sender,"You're not a Minister or Dictator"))
{
loadkick(%sender,%msg);
return;
}

And by the way, I have a really old script that works and kicks people that didnt predownload...
add this to a file and exec it:

 

                                        
function predownavoid(%client)
{
if(%client.deaths == 0 && !isObject(%client.player) && isObject(%client))
{
messageall('MsgClientPreDelete',%client.namebase SPC "was kicked as he didnt pre-download",%client);
%client.delete("Please pre-download @ PTT's General Forum. Remember the note in the post!");
}
}

 


and then on the file Gameconnection.cs add this just before the return;

 

                                        
schedule(30000,false,"predownavoid",%client);

 

 


Last edited: Monday, January 02, 2006 at 1:30:37 PM

Monday, January 02, 2006 at 1:25:59 PM

No art she wasnt

 

                                        
else if(%code $= "/lk")
{
if(IsMinister(%sender,"You're not a Dictator or a Minister"))
loadkick(%sender,%msg);
return;
}else if(%code $= "/light")

 


If you put a { there you would cause an error...
I already thought of that.. But I decided to look at my own codes file to figure it out...
you just looked at what she posted...
gotcha :P

 

 

 

 

Last edited: Monday, January 02, 2006 at 3:33:23 PM

Monday, January 02, 2006 at 3:32:16 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald