Author Topic: Invalid Script Extension Error  (Read 1435 times)

I am quite new at scripting and I understand almost everything but I'm having a hard time
I saw the thread about making vehicles shoot and i tried it out.
For advanced users - look at the tank turret code
For beginner users - http://forum.blockland.us/index.php?topic=51249.0
I tried the beginner one but it didn't work.
When i tried to execute Support_ShootOnClick it said:
Quote
exec: invalid script file name -1.#IND - extension must be .cs or .mis or .gui
It does this for all my scripts and i don't know why!

Are you executing files like this?
exec("path/to/file/support_shootOnClick");

You must specify the .cs extension.
exec("path/to/file/support_shootOnClick.cs");

Are you executing files like this?
exec("path/to/file/support_shootOnClick");

You must specify the .cs extension.
exec("path/to/file/support_shootOnClick.cs");
No no I put the .cs

It would help considerably if we actually saw your code.

It would help considerably if we actually saw your code.
Wait

Quote
function test()
{
  if(%client.isAmdin)
    {
      messageClient("You're an Admin");
     }
  else(!%client.isAdmin)
    {
      messageClient("You're not an Admin");
     }
}
I was reading your explanations Iban and I wanted to try it out for myself and well it don't work.

There is so much, so wrong about that script and it has nothing to do with the original question.

There is so much, so wrong about that script and it has nothing to do with the original question.
Eh?

My question is that why is it my scripts make that error pop up.
I tried other scripts of mine and they worked for a short while then the error started poping up.
EDIT: Oh and Iban while your here tell me whats wrong with my script it peeked my curiosity.
« Last Edit: March 09, 2011, 05:48:01 PM by Aide33 »

Well I fixed this for you.. Although it won't fix the extension error...
Code: [Select]
function servercmdtest(%client)
{
  if(%client.isAdmin)
    {
      messageClient(%client,'', "You're an Admin");
     }
  else if(!%client.isAdmin)
    {
      messageClient(%client,'', "You're not an Admin");
     }
}

are you saving the script as a .cs?
are you using the right extension?

please post the command you are using to execute the script.

I am saving as a .cs
and this is what I use:
Quote
exec("Addons/Script_Me/server.cs");

Code: [Select]
exec("Add-Ons/Script_Me/server.cs");

I am saving as a .cs
and this is what I use:

While the path is wrong like Bauklotz pointed out, you do not seem to have the quotations around it in your actual script. Explanation: When it wants to evaluate exec(Add-Ons/Script_Me/server.cs), it essentially treats the slashes as "divide". 0/0/0 results in -1.#IND, hence the error.