Jump to content

Recommended Posts

Posted

Well, I've been stuck with a little problem for a while, I can get C# Server Side scripting working fully and have tested it but when it comes to client side I have a bit of a problem. I've created the "cs_packages" folder in the 'client_resources' folder. When it comes to actually loading the script which is in its own folder inside cs_packages and yes it is not compiled into a .dll file.

The problem is when I connect to my local server it grabs all the dll packages inside the cs_packages folder but doesn't start my "Main.cs" script which has a little output with "Loading Clientside".

I've looked at YouTube videos like "Stuyk" and it worked for him, for me no.

Any help would be appreciated, I'll leave the code in the Main.cs in a picture below.

9wtj6Es.jpg

Posted (edited)

Yes I did, I've looked through most videos and forums but it still doesn't work. When I looked at how JS do it they use an "Index.js" file, I thought it would work the same but it doesn't from what I could tell it looks like cs_packages and anything in it gets loaded automatically and that's what seems to be the problem loading the actual "Main.cs" file.

The "enable-clientside-cs.txt" also has "true" set in it.

Edited by Crossy1998
Posted

Got it sorted in the end, it was the "enable-clientside-cs.txt" for some reason my computer was taking it as a text file but only with the extension .txt, I put it into Visual studio code changed it to a text file when saving and it removed the .txt part at the end. Working fully now!

  • 2 months later...
Posted
5 hours ago, T0xicPo1nter said:

I have the same problem! How did you fixed it?

Create enable-clientside-cs.txt file inside the rage directory. If not working, you may have extensions hidden from windows and you manually put .txt at the end of the file which with the hidden extension would make .txt.txt

Show us a screenshot of the contents inside main RAGE directory.

Posted (edited)
vor 2 Stunden schrieb T0xicPo1nter:

I fixed it. Thanks

Got the same problem. Can you tell me how you solved it?

I definitly named it "enable-clientside-cs.txt" without hidden extensions.

Edited by iDavidGB
  • 7 months later...
Posted (edited)

In case anyone comes across this issue too and they've verified that they have done what the above comments suggest then check if your client class has 'using RAGE.Game' , if it does remove it and derive class from Events.Script not just Script. For some reason that won't load your script.

Hope that helps!

Edited by Simon9608
clearer formatting
Posted
2 minutes ago, Simon9608 said:

In case anyone comes across this issue too and they've verified that they have done what the above comments suggest then check if your client class has 'using RAGE.Game' , if it does remove it and derive class from Events.Script not just Script. For some reason that won't load your script.

Hope that helps!

It's not the same class, they're RAGE.Events.Script and RAGE.Game.Script, you need the first one as you said.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...