Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Vicky

#1
Quote from: lamkotien on Jan 30, 2026, 09:00 AMThank you, my dear friend.

I am trying to implement a client-side Laser Sniper feature on my VC:MP 0.4 server but I'm struggling to get the client script to load.

**My Setup:**
- **Server Version:** VC:MP 0.4 (Windows)
- **Plugins:** `squirrel04rel32.dll` (Stormeus build), `xmlconf04rel32.dll`
- **Server Script:** [store/script/main.nut] /vcmp/store/script/main.nut) (This works perfectly for server-side logic).
- **Client Script:** [store/laser_client.nut] /vcmp/store/laser_client.nut) (This contains the `onClientRender` code for drawing lasers).

**The Problem:**
I want the server to send [store/laser_client.nut] /vcmp/store/laser_client.nut) to players when they connect.
However, when I try to load this script inside [main.nut] /vcmp/store/main.nut) using functions like `RegisterClientScript("store/laser_client.nut")` or `Script.LoadClientScript("store/laser_client.nut")`, the server console throws errors:

`[SCRIPT] !! Error: the index 'Script' does not exist`
or
`[SCRIPT] !! Error: RegisterClientScript function not found!`

It seems my current Squirrel plugin lacks the functions to register/load client-side scripts.

**Question:**
Is there a specific way to load a separate client script file ([laser_client.nut] /vcmp/store/laser_client.nut) from the main server script ([main.nut] /vcmp/store/main.nut) in this version? Or do I need an updated Squirrel plugin that supports `RegisterClientScript`?

If an update is needed, could someone please point me to the correct plugin version for VC:MP 0.4?

Any help would be greatly appreciated!

Thank you!

As far as I know, server-side scripts should be placed in vcmp/scripts folder and client side scripts belong in vcmp/store/script folder.

And talking about that error. Use this if you want to include other scripts along with main.
https://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Functions/dofile

RegisterClientScript isn't a valid VC:MP function.
Check out VC:MP Wiki for all the information about server functions and events.

#2
Also, you can make yourself a default admin by changing to your name here in this part in function onScriptLoad()

// Add vicky as admin if not exists
local q = QuerySQL(db, "SELECT * FROM Admins WHERE Name='vicky'");
if (!q) {
QuerySQL(db, "INSERT INTO Admins (Name) VALUES ('vicky')");
}
if (q) FreeSQLQuery(q);
#3
Script Showroom / [SCRIPT] Vicky's Viceverse
Jan 25, 2026, 01:00 PM
Hello everyone! I wanted to open-source my work which I left incomplete due to irl reasons. It has basic things like account system (requires DOB to register), XP system, ranks according to the level, prefix tags in chat, Vehicle System and maybe more. Everyone's free to modify and use it. I don't have any plans returning to VC:MP right now but playing here was one of my best memories to get reminded of.

Link:
https://www.mediafire.com/file/5ih023ahhvb9yaw/main.nut/file
#4
Snippet Showroom / Simple Spectate System
Dec 19, 2025, 10:37 AM
This spectate system for VCMP is very easy to use, you just need to copy and paste the code into your server. I made it beginner-friendly so anyone can understand how it works and set it up quickly. It is simple, clean, and works well without any complicated stuff.

You can check out the snippet here:
GitHub