Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: Dejv on Nov 19, 2016, 02:14 PM

Title: problem script
Post by: Dejv on Nov 19, 2016, 02:14 PM
WTF?

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fk9pBFDA.png&hash=8dda51715922d749ac8da50694004b47c49a7b84)

:( error, I have newest versions client or server...
Title: Re: problem script
Post by: vito on Nov 19, 2016, 02:39 PM
the index 'Script' does not exist
Title: Re: problem script
Post by: EK.IceFlake on Nov 19, 2016, 02:54 PM
The '::' operator inserts a function into a class.
You don't have the class 'Script', as it does not exist within the plugin and you didn't create it yourself.
You also don't have the class 'Console', nor the function 'Print' within a class.

tl;dr You are attempting to use client side scripts on server side. Move this file to /store/script/main.nut.
Or change it to this:
function onScriptLoad()
{
    print("test!");
}

Also don't use pawno, use something such as Visual Studio code
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F9t8t8j9.png&hash=fef4aedc99952d09274e6097f03b9141c503b0f5)
Title: Re: problem script
Post by: KAKAN on Nov 19, 2016, 04:07 PM
Dejv, put that file in youserverdir/store/scripts
I guess you're trying to use client side scripting, if so, use that path.
Title: Re: problem script
Post by: Dejv on Nov 19, 2016, 07:26 PM
I have.
Title: Re: problem script
Post by: . on Nov 19, 2016, 07:39 PM
Quote from: Dejv on Nov 19, 2016, 07:26 PMI have.

Then why are you trying to load it in the server? It is a CLIENT script, wouldn't it make sense that it was meant to be loaded by the CLIENT and not the SERVER?
Title: Re: problem script
Post by: Dejv on Nov 19, 2016, 07:43 PM
And you explain to me how to load it?

Sorry for my bad English.
Title: Re: problem script
Post by: . on Nov 19, 2016, 08:29 PM
Unfortunately the structure of this whole forum is a cluster f*. So I can't blame it on you. I had issues with this myself (go figure). To find the exact information you have to go back through the change-log and pay very close attention to single line of text. And only because I know that already. For something this important you'd think it'll be in plain sight. But oh well.

Either way, you name it `main.nut` and place it in `store/scripts` when you connect to the server, your client will download whatever is in that folder automatically. Once the client finished downloading the files. It'll look for a file named `main.nut`. And if it finds that file it'll attempt to load it. From inside `main.nut` you can further load other files.

Was that clear enough?
Title: Re: problem script
Post by: Thijn on Nov 20, 2016, 04:20 PM
Quote from: Dejv on Nov 19, 2016, 07:43 PMAnd you explain to me how to load it?

Sorry for my bad English.
Just put the file in store/scripts and when you join it will automatically be loaded.