Server Update 04rel004- Added client-side GUIs and scripting. The client now has a Squirrel core for running GUI management scripts, and has a few basic client-side events, detailed below.
- Extensively revised the plugin API to give more informative return values for plugin calls and to reduce repetition.
- Added functions and callbacks for communicating between the server and client via plugin calls.
- Removed server-side sprites. Use client-side sprites instead.
- Removed server-side textdraws. Use client-side GUI labels instead.
- Checkpoints and spheres were merged, a parameter for CreateCheckPoint can now be used to decide between a sphere and a checkpoint.
If your script relies on server-side features that have been removed, we recommend porting your GUI scripts to use client-side features and upgrading to this server version afterward.
Server downloads:
Windows Server (x86) (https://v04.vc-mp.org/server/VCMP04_server_v19_win32.zip)
Windows Server (x64) (https://v04.vc-mp.org/server/VCMP04_server_v19_win64.zip)
Linux Server (x86) (https://v04.vc-mp.org/server/VCMP04_server_v19_linux32.zip)
Linux Server (x64) (https://v04.vc-mp.org/server/VCMP04_server_v19_linux64.zip)
You can access the new plugin header at:
https://bitbucket.org/maxorator/vcmp-plugin-header/src
About client side scriptsClient scripts go to store/script with main.nut being the first script file loaded. The documentation is available below.
Updated pluginsCurrently all plugins are in one archive:
http://v04.maxorator.com/allplugins_04rel004_patch7.7z
It contains the Windows and Linux, 32 and 64 bit versions of the following plugins:
- Announce
- Java
- Squirrel
- SQLite for squirrel
- MySQL for squirrel
- Hashing for squirrel
- Sockets for squirrel
- XML configuration loader
Any plugins that have not been updated for this version WILL NOT WORK.
Client-side squirrel documentation:
[spoiler]Events
Script::ScriptLoad()
Return type: void.
Called right after scripts have been successfully loaded.
Script::ScriptUnload()
Return type: void.
Called before scripts are unloaded, on disconnect.
Script::ScriptProcess()
Return type: void.
Called once every frame.
Player::PlayerDeath(player)
Parameter types: Player. Return type: void.
Called whenever a player dies.
Player::PlayerShoot(player, weapon, hitEntity, hitPosition)
Parameter types: Player, int, entity, Vector. Return type: void.
Called when a player makes a shot. If something was hit, hitEntity points to that and hitPosition is the position of the collision. Otherwise, hitEntity is null and hitPosition is the end of the bullet trajectory.
Server::ServerData(stream)
Parameter types: Stream. Return type: void.
Called when data from the server was received.
GUI::ElementFocus(element)
Parameter types: GUIElement. Return type: void.
Called when a GUI element receives focus.
GUI::ElementBlur(element)
Parameter types: GUIElement. Return type: void.
Called when a GUI element loses focus.
GUI::ElementHoverOver(element)
Parameter types: GUIElement. Return type: void.
Called when mouse enters the GUIElement (must have GUI_FLAG_MOUSECTRL).
GUI::ElementHoverOut(element)
Parameter types: GUIElement. Return type: void.
Called when mouse leaves the GUIElement (must have GUI_FLAG_MOUSECTRL).
GUI::ElementClick(element, mouseX, mouseY)
Parameter types: GUIElement, int, int. Return type: void.
Called when an element is clicked (must have GUI_FLAG_MOUSECTRL). Coordinates are absolute.
GUI::ElementRelease(element, mouseX, mouseY)
Parameter types: GUIElement, int, int. Return type: void.
Called when mouse is released after click on an element (must have GUI_FLAG_MOUSECTRL). Coordinates are absolute.
GUI::ElementDrag(element, mouseX, mouseY)
Parameter types: GUIElement, int, int. Return type: void.
Called when mouse is moved during dragging the element (must have GUI_FLAG_MOUSECTRL). Coordinates are absolute.
GUI::CheckboxToggle(checkbox, checked)
Parameter types: GUICheckbox, bool. Return type: void.
Called when checkbox is checked.
GUI::WindowClose(window)
Parameter types: GUIWindow. Return type: void.
Called when window is closed.
GUI::InputReturn(editbox)
Parameter types: GUIEditbox. Return type: void.
Called when the user presses enter while keyboard focus is in an editbox.
GUI::ListboxSelect(listbox, text)
Parameter types: GUIListbox, string. Return type: void.
Called when the user selects an item in a list box.
GUI::ScrollbarScroll(scrollbar, position, change)
Parameter types: GUIScrollbar, float, float. Return type: void.
Called when the user selects an item in a list box.
GUI::WindowResize(window, width, height)
Parameter types: GUIWindow, int, int. Return type: void.
Called when a window is resized.
GUI::GameResize(width, height)
Parameter types: int, int. Return type: void.
Called when the game screen is resized.
GUI::KeyPressed()
Parameter types: int. Return type: void.
Called when a key is pressed, with the virtual key code as the parameter.
KeyBind::OnDown()
Parameter types: KeyBind. Return type: void.
Called when a keybind is activated.
KeyBind::OnUp()
Parameter types: KeyBind. Return type: void.
Called when a keybind is released.
Types
Types int, float, bool and string are built-in types. entity is not an actual type, but can be any of either Player, Vehicle or Building. The actual type can be detected from the return value of entity.Type which is respectively OBJ_PLAYER, OBJ_VEHICLE or OBJ_BUILDING for them.
The values of properties marked as read-only cannot be changed. If a property is marked as bound, then it means the instance of for example a Vector that you get from it is bound to the object. Therefore if you do var = player.Position;, var.X will always contain the player's X position, not the X position when var was assigned. To get an unbound vector, use var = Vector(player.Position);.
Vector
Constructor Vector(x, y, z)
Parameter types: float, float, float
Constructor Vector(vector)
Parameter types: Vector
Creates a copy of the specified vector.
Property X
Type: float
Property Y
Type: float
Property Z
Type: float
Operator +
Return type: Vector
Adds the values of two vectors together and returns a new instance.
VectorScreen
Constructor VectorScreen(x, y)
Parameter types: int, int
Constructor VectorScreen(screenVector)
Parameter types: VectorScreen
Creates a copy of the specified screen vector.
Property X
Type: int
Property Y
Type: int
Colour
Constructor Colour(r, g, b, a)
Parameter types: int, int, int, int
Constructor Colour(r, g, b)
Parameter types: int, int, int
Alpha is set to 255.
Constructor Colour(colour)
Parameter types: Colour
Creates a copy of the specified colour.
Property R
Type: int
Property G
Type: int
Property B
Type: int
Property A
Type: int
Property Hex
Type: int
KeyBind
Key values are virtual key codes. When a keybind is created, events about it will start coming, no need to register the keybind anywhere. To make a keybind not send events anymore, all references to it must be removed.
Constructor KeyBind(keyOne)
Parameter types: int
Constructor KeyBind(keyOne, keyTwo)
Parameter types: int, int
Constructor KeyBind(keyOne, keyTwo, keyThree)
Parameter types: int, int, int
RayTrace
When ray trace is created, the properties from it will contain the results.
Constructor RayTrace(start, end, flags)
Parameter types: Vector, Vector, flags
Flag values can be or-ed together with the | operator to select which types of entities it should check: RAY_BUILDING, RAY_PED, RAY_VEHICLE, RAY_OBJECT.
Property Collided (read-only)
Type: bool
True when the ray hit something.
Property Entity (read-only)
Type: entity
The entity that was hit, or null if nothing was hit. May also be null if the entity has been destroyed.
Property Position
Type: Vector
The position of the collision, or zero vector if nothing was hit.
Stream
Used to construct the packet to send to the server or to read the data sent by the server. Read functions cannot be used on streams that were created by the script. The format of the stream is little-endian, with the exception that strings are written as a big-endian 2-byte length followed by the characters. Check Server::SendData for sending the stream or event Server::ServerData for receiving it.
Constructor Stream()
Creates a new stream for writing, which can be sent to the server.
Function ReadByte()
Return type: int
Reads a single byte from the stream.
Function ReadInt()
Return type: int
Reads an integer (4 bytes) from the stream.
Function ReadFloat()
Return type: float
Reads a float (4 bytes) from the stream.
Function ReadString()
Return type: float
Reads a string from the stream.
Function WriteByte(value)
Parameter types: int. Return type: void
Writes a single byte to the stream.
Function WriteInt(value)
Parameter types: int. Return type: void
Writes an integer (4 bytes) to the stream.
Function WriteInt(value)
Parameter types: float. Return type: void
Writes a float (4 bytes) to the stream.
Function WriteInt(value)
Parameter types: string. Return type: void
Writes a string to the stream.
Property Error (read-only)
Type: bool
Whether writing exceeded the maximum stream size, or a read call tried to read past the end of the stream.
Player
Property Type (read-only)
Type: int
The type of this entity, always OBJ_PLAYER.
Property ID (read-only)
Type: int
Property Local (read-only)
Type: bool
Whether this is the local player.
Property Name (read-only)
Type: string
Property Health (read-only)
Type: float
Property Armour (read-only)
Type: float
Property Position (bound)
Type: Vector
Vehicle
Vehicle position and speed can only be changed if the vehicle is currently controlled by the current player (either a driver, passenger or the closest player).
Property Type (read-only)
Type: int
The type of this entity, always OBJ_VEHICLE.
Property ID (read-only)
Type: int
Property ModelIndex (read-only)
Type: int
Property Health (read-only)
Type: float
Property Position (bound)
Type: Vector
Property Speed (bound)
Type: Vector
Function GetOccupant(slot)
Parameter types: int. Return type: Player
The value passed to it is the slot number. 0 for driver, 1-8 for passengers.
Building
Property Type (read-only)
Type: int
The type of this entity, always OBJ_BUILDING.
Property ModelIndex (read-only)
Type: int
Property Position (read-only)
Type: Vector
Global functions
dofile(filename)
Parameter types: string. Return type: void.
Loads the specified script file. The script/ directory is automatically prepended.
print(text)
Parameter types: string. Return type: void.
Writes to the debug log file.
Script::GetTicks()
Return type: int.
Returns a number of milliseconds since the computer started. Can be used to measure time intervals.
Script::LoadScript(filename)
Parameter types: string. Return type: void.
Same as dofile.
World::FindPlayer(id)
Parameter types: int. Return type: Player.
Returns the player instance for the ID, or null if the player does not exist.
World::FindLocalPlayer()
Return type: Player.
Returns the local player instance.
World::FindVehicle(id)
Parameter types: int. Return type: Vehicle.
Returns the vehicle instance for the ID, or null if the vehicle does not exist or is not streamed in.
Server::SendData()
Parameter types: Stream. Return type: bool.
Sends the data written to the stream to the server. Returns false if null or read-only stream was given.
Console::Print(text)
Parameter types: string. Return type: void.
Writes to the game console.
GUI::GetMouseEnabled()
Return type: void.
Checks if mouse is enabled for GUI.
GUI::SetMouseEnabled(enabled)
Parameter types: bool. Return type: void.
Sets whether mouse is enabled for GUI.
GUI::GetMousePos()
Return type: VectorScreen.
GUI::GetScreenSize()
Return type: VectorScreen.
GUI::ScreenPosToWorld(screenPosition)
Parameter types: Vector. Return type: Vector.
Returns the world coordinates for the screen position.
GUI::WorldPosToScreen(position)
Parameter types: Vector. Return type: Vector.
Returns the screen coordinates for the position.
GUI::GetFocusedElement()
Return type: GUIElement.
Returns the focused element, or null if none.
GUI::SetFocusedElement(element)
Parameter types: GUIElement. Return type: void.
Sets the focus on the specified element.
[/spoiler]
Client-side squirrel documentation continued (GUI types):
[spoiler]
GUIElementThere aren't actually any instances of GUIElement, but it is the base class for all other GUI element classes. This means that all properties and functions it has also work on other GUI elements. GUI element flags are used in several places, the available flag constants are:
- GUI_FLAG_NONE
- GUI_FLAG_VISIBLE
- GUI_FLAG_DISABLED
- GUI_FLAG_BACKGROUND
- GUI_FLAG_BORDER
- GUI_FLAG_SHADOW
- GUI_FLAG_DRAGGABLE
- GUI_FLAG_CLIP
- GUI_FLAG_WRAP
- GUI_FLAG_AUTO_RESIZE
- GUI_FLAG_INHERIT_ALPHA
- GUI_FLAG_ANIMATION
- GUI_FLAG_TABSTOP
- GUI_FLAG_MOUSECTRL
- GUI_FLAG_KBCTRL
- GUI_FLAG_SCROLLABLE
- GUI_FLAG_TEXT_SHADOW
- GUI_FLAG_TEXT_TAGS
- GUI_FLAG_DEPTH_TEST
- GUI_FLAG_3D_ENTITY
- GUI_FLAG_CACHE_TEXTURE
- GUI_FLAG_CHECKBOX_CHECKED
- GUI_FLAG_EDITBOX_MASKINPUT
- GUI_FLAG_LISTBOX_MULTISELECT
- GUI_FLAG_LISTBOX_SORTING
- GUI_FLAG_MEMOBOX_TOPBOTTOM
- GUI_FLAG_SCROLLBAR_HORIZ
- GUI_FLAG_WINDOW_TITLEBAR
- GUI_FLAG_WINDOW_CLOSEBTN
- GUI_FLAG_WINDOW_RESIZABLE
Function
AddChild(element)Parameter types: GUIElement. Return type: void.Makes the specified element a child of this element.
Function
IsChildOf(element)Parameter types: GUIElement. Return type: bool.Returns true if this element is the child of the specified element.
Function
Detach()Return type: void.Detaches this element from its parent.
Function
MoveForward()Return type: void.Moves the siblign element right in front of this one behind it.
Function
MoveBackward()Return type: void.Moves the sibling element right behind this element to the front of it.
Function
SendToTop()Return type: void.Moves this element on top of all other sibling elements.
Function
SendToBottom()Return type: void.Moves this element to the bottom of all other sibling elements.
Property
Position (bound)
Type: VectorScreenProperty
Size (bound)
Type: VectorScreenProperty
Position3D /
Pos3D (bound)
Type: VectorProperty
Rotation3D (bound)
Type: VectorProperty
Size3D (bound)
Type: VectorFunction
Set3DTransform(position, rotation, size)Parameter types: Vector, Vector, Vector. Return type: void.Sets the 3D transformation of this element.
Property
Colour /
Color (bound)
Type: ColourProperty
TextColour /
TextColor (bound)
Type: ColourProperty
AlphaType: intProperty
TextType: stringProperty
TextSize (read-only)
Type: VectorScreenSize on the screen of the text in this element.
Property
TextAlignmentType: intSets the alignment of text. Available constants are:
- GUI_ALIGN_LEFT
- GUI_ALIGN_RIGHT
- GUI_ALIGN_TOP
- GUI_ALIGN_BOTTOM
- GUI_ALIGN_CENTERV
- GUI_ALIGN_CENTERH
- GUI_ALIGN_CENTER
Property
FontNameType: stringProperty
FontSizeType: intProperty
FontFlagsType: intAvailable flag constants are:
- GUI_FFLAG_NONE
- GUI_FFLAG_BOLD
- GUI_FFLAG_ITALIC
- GUI_FFLAG_ULINE
- GUI_FFLAG_STRIKE
- GUI_FFLAG_NOAA
- GUI_FFLAG_OUTLINE
Property
TextPaddingTopType: intProperty
TextPaddingBottomType: intProperty
TextPaddingLeftType: intProperty
TextPaddingRightType: intProperty
FlagsType: intFunction
AddFlags(flags)Parameter types: int. Return type: void.Function
RemoveFlags(flags)Parameter types: int. Return type: void.GUIButtonConstructor
GUIButton()Constructor
GUIButton(position, size, colour)Parameter types: VectorScreen, VectorScreen, ColourConstructor
GUIButton(position, size, colour, text)Parameter types: VectorScreen, VectorScreen, Colour, stringConstructor
GUIButton(position, size, colour, text, flags)Parameter types: VectorScreen, VectorScreen, Colour, string, intGUICanvasConstructor
GUICanvas()GUICheckboxConstructor
GUICheckbox()Constructor
GUICheckbox(position, colour)Parameter types: VectorScreen, ColourConstructor
GUICheckbox(position, colour, flags)Parameter types: VectorScreen, Colour, intGUIEditboxConstructor
GUIEditbox(position, size, colour)Parameter types: VectorScreen, VectorScreen, ColourConstructor
GUIEditbox(position, size, colour, text)Parameter types: VectorScreen, VectorScreen, Colour, stringConstructor
GUIEditbox(position, size, colour, text, flags)Parameter types: VectorScreen, VectorScreen, Colour, string, intProperty
HasTextSelected (read-only)
Type: boolProperty
TextSelection (read-only)
Type: stringFunction
SelectText(startIndex, endIndex)Parameter types: int, int. Return type: void.Property
CursorPosType: intGUILabelConstructor
GUILabel()Constructor
GUILabel(position, colour)Parameter types: VectorScreen, ColourConstructor
GUILabel(position, colour, text)Parameter types: VectorScreen, Colour, stringConstructor
GUILabel(position, colour, text, flags)Parameter types: VectorScreen, Colour, string, intGUIListboxConstructor
GUIListbox()Constructor
GUIListbox(position, size)Parameter types: VectorScreen, VectorScreenConstructor
GUIListbox(position, size, colour, selectedColour)Parameter types: VectorScreen, VectorScreen, Colour, ColourConstructor
GUIListbox(position, size, colour, selectedColour, flags)Parameter types: VectorScreen, VectorScreen, Colour, Colour, intProperty
Items (read-only)
Type: arrayFunction
AddItem(item)Parameter types: string. Return type: void.Function
RemoveItem(item)Parameter types: string. Return type: void.Function
Clean()Return type: void.Removes all items.
Property
ItemCount (read-only)
Type: intProperty
SelectedCount (read-only)
Type: intProperty
SelectedColour (bound)
Type: ColourBackground colour of selected items.
GUIMemoboxConstructor
GUIMemobox()Constructor
GUIMemobox(position, size, colour)Parameter types: VectorScreen, VectorScreen, ColourConstructor
GUIMemobox(position, size, colour, flags)Parameter types: VectorScreen, VectorScreen, Colour, intFunction
AddLine(line)Parameter types: string. Return type: void.Function
AddLine(line, colour)Parameter types: string, Colour. Return type: void.Function
Clear()Return type: void.Property
DisplayPosType: floatProperty
LineHeightType: intProperty
LineCount (read-only)
Type: intProperty
HistorySizeType: intGUIProgressBarConstructor
GUIProgressBar()Constructor
GUIProgressBar(position, size, colour)Parameter types: VectorScreen, VectorScreen, ColourConstructor
GUIProgressBar(position, size, colour, selectedColour)Parameter types: VectorScreen, VectorScreen, Colour, ColourConstructor
GUIProgressBar(position, size, colour, selectedColour, flags)Parameter types: VectorScreen, VectorScreen, Colour, Colour, intConstructor
GUIProgressBar(position, size, colour, selectedColour, flags, endValue)Parameter types: VectorScreen, VectorScreen, Colour, Colour, int, floatProperty
ValueType: floatProperty
MaxValueType: floatProperty
BackgroundShadeType: floatProperty
ThicknessType: intProperty
StartColour (bound)
Type: ColourProperty
EndColour (bound)
Type: ColourGUIScrollbarConstructor
GUIScrollbar()Constructor
GUIScrollbar(position, size)Parameter types: VectorScreen, VectorScreenConstructor
GUIScrollbar(position, size, colour)Parameter types: VectorScreen, VectorScreen, ColourConstructor
GUIScrollbar(position, size, colour, flags)Parameter types: VectorScreen, VectorScreen, Colour, intFunction
SetParams(contentSize, stepSize, barPosition, barSize)Parameter types: float, float, float, float. Return type: void.Property
ContentSizeType: floatProperty
StepSizeType: floatProperty
BarSizeType: floatProperty
BarPositionType: floatProperty
BackgroundShade /
BGShadeType: floatGUISpriteConstructor
GUISprite()Constructor
GUISprite(fileName, position)Parameter types: string, VectorScreenConstructor
GUISprite(fileName, position, colour)Parameter types: string, VectorScreen, ColourConstructor
GUISprite(fileName, position, colour, flags)Parameter types: string, VectorScreen, Colour, intProperty
TextureSizeType: VectorScreenProperty
TopLeftUVType: VectorProperty
BottomRightUVType: VectorFunction
SetTexture(fileName)Parameter types: string. Return type: void.Function
Resize()Return type: void.GUIWindowConstructor
GUIWindow()Constructor
GUIWindow(position, size, colour)Parameter types: VectorScreen, VectorScreen, ColourConstructor
GUIWindow(position, size, colour, text)Parameter types: VectorScreen, VectorScreen, Colour, stringConstructor
GUIWindow(position, size, colour, text, flags)Parameter types: VectorScreen, VectorScreen, Colour, string, intProperty
DragOffset (read-only)
Type: VectorScreenProperty
TitleColour (bound)
Type: Colour[/spoiler]
New and modified functions of squirrel plugin:
[spoiler]CreateCheckpoint(player, world, isSphere, position, color, radius)
Parameter types: Player, int, bool, Vector, ARGB, float. Return type: Checkpoint.
Additional parameter isSphere, since Sphere functions were removed.
SetBackfaceCullingDisabled(toggle)
Parameter types: bool. Return type: void.
Sets whether the backface culling is disabled, which makes all game triangles be drawn from both sides. This is useful to make GTA 3 map objects look natural.
GetBackfaceCullingDisabled(toggle)
Parameter types: bool. Return type: void.
SetHeliBladeDamageDisabled(toggle)
Parameter types: bool. Return type: void.
Sets whether helicopter blades do damage.
GetHeliBladeDamageDisabled(toggle)
Parameter types: bool. Return type: void.
Event onClientScriptData(player)
Parameter types: Player. Return type: void.
Notifies that scripts from the specified player sent a packet of data, which can be read with the Stream.Read* functions.
Stream.StartWrite()
Return type: void.
Resets stream writing, use this before writing a new packet.
Stream.SetWritePosition(position)
Parameter types: int. Return type: void.
Set the stream buffer position when writing, can be used to rewind the buffer to overwrite some part.
Stream.GetWritePosition()
Return type: int.
Returns the current position in the output stream buffer.
Stream.GetWriteSize()
Return type: int.
Returns the current size of the output stream buffer.
Stream.HasWriteError()
Return type: bool.
Returns whether writing encountered an error (buffer size limit) since the last StartWrite() call.
Stream.WriteByte(value)
Parameter types: int. Return type: void.
Writes one byte to the stream.
Stream.WriteInt(value)
Parameter types: int. Return type: void.
Writes an integer (4 bytes) to the stream.
Stream.WriteFloat(value)
Parameter types: float. Return type: void.
Writes a float (4 bytes) to the stream.
Stream.WriteString(value)
Parameter types: string. Return type: void.
Writes a string to the stream.
Stream.SendStream(player)
Parameter types: Player. Return type: void.
Sends the currently written stream to the specified player, or every player if the parameter is null.
Stream.SetReadPosition(position)
Parameter types: int. Return type: void.
Set the stream buffer position when reading, can be used to rewind the buffer to reread a previously read part.
Stream.GetReadPosition()
Return type: int.
Returns the current position in the input stream buffer.
Stream.GetReadSize()
Return type: int.
Returns the size of the input stream buffer.
Stream.HasReadError()
Return type: bool.
Returns whether reading encountered an error (reading beyond the end of buffer).
Stream.ReadByte(value)
Parameter types: int. Return type: void.
Reads one byte from the stream.
Stream.ReadInt(value)
Parameter types: int. Return type: void.
Reads an integer (4 bytes) from the stream.
Stream.ReadFloat(value)
Parameter types: float. Return type: void.
Reads a float (4 bytes) from the stream.
Stream.ReadString(value)
Parameter types: string. Return type: void.
Reads a string from the stream.
[/spoiler]
A sample script using streams to pass data between client and server scripts:
Server script
function onClientScriptData(player) {
local type = Stream.ReadInt();
if (type == 55) {
Stream.StartWrite();
Stream.WriteInt(56);
Stream.WriteByte(Stream.ReadByte() + 1);
Stream.WriteFloat(Stream.ReadFloat() + 2.2);
Stream.WriteString("o" + Stream.ReadString() + "!");
Stream.SendStream(player);
}
else {
print("Received something else");
}
}
Client script
keyJBind <- KeyBind(0x4A);
function KeyBind::OnDown(keyBind) {
if (keyBind == keyJBind) {
local message = Stream();
message.WriteInt(55);
message.WriteByte(3);
message.WriteFloat(5.9);
message.WriteString("lalaya");
Server.SendData(message);
Console.Print("Sent stuff");
}
}
function Server::ServerData(stream) {
local type = stream.ReadInt();
if (type == 56) {
Console.Print(stream.ReadByte());
Console.Print(stream.ReadFloat());
Console.Print(stream.ReadString());
}
else {
Console.Print("Received something else");
}
}
This binds the J key to send some data to the server, then server modifies the data a bit and sends back, then client script prints to the game console.
F* yeah! \o/
when i update my server and plugins start error conect sql does not exists
dont be angry on me but i cant understand why i have loaded sqlite plugin
Quote from: Hercules on Apr 25, 2016, 08:28 PMwhen i update my server and plugins start error conect sql does not exists
dont be angry on me but i cant understand why i have loaded sqlite plugin
Did you replace the plugins with the new ones? If yes, can you copy-paste any errors you are getting in the console?
i updated all things and i check plugin name server.cfg but all fine but this error
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi65.tinypic.com%2Ff4mm0y.png&hash=f6831e024a63419716a58c7b31c482517a065b40)
Quote from: Hercules on Apr 25, 2016, 08:40 PMi updated all things and i check plugin name server.cfg but all fine but this error
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi65.tinypic.com%2Ff4mm0y.png&hash=f6831e024a63419716a58c7b31c482517a065b40)
The issue with SQLite was due to server, redownload and try again.
I haven't yet created the new version of INI plugin (wasn't aware people were still using it).
The INI plugin is also in the plugins zip now.
Thanks
[EDIT] @maxorator i am on mobile tonight so i didnt test it now i test it but same error
Quote from: Stormeus on Apr 01, 2016, 11:58 PMWe do have a big update coming up soon, though. We'll save more extensive details for when it's released. In the meantime, I just wanted to say thanks for bearing with us on April Fools' day.
FIIINALLLYYY!!!!
:edit: I updated all the plugins, the server execution file. I created a simple script file. The problem is I can't use any of the global functions or events which are listed up there. I get errors, I tried the client side script @maxorator posted and even that's throwing errors. Do we have to define somewhere that specific files are meant to be client-sided?
This script:
function KeyBind::OnDown(keyBind) {
if (keyBind == keyJBind) {
local message = Stream();
message.WriteInt(55);
message.WriteByte(3);
message.WriteFloat(5.9);
message.WriteString("lalaya");
Server.SendData(message);
Console.Print("Sent stuff");
}
}
Error: The index 'KeyBind' does not exist.
Server and Plugins type: x64
:edit: Same with 32bit server and plugins. I believe there is a way to mark scripts as client-sided in-order to use these features, perhaps I can't seem to find something like that up there or you forgot to mention?
Quote from: Doom_Kill3R on Apr 26, 2016, 01:13 AMFIIINALLLYYY!!!!
:edit: I updated all the plugins, the server execution file. I created a simple script file. The problem is I can't use any of the global functions or events which are listed up there. I get errors, I tried the client side script @maxorator posted and even that's throwing errors. Do we have to define somewhere that specific files are meant to be client-sided?
This script:
function KeyBind::OnDown(keyBind) {
if (keyBind == keyJBind) {
local message = Stream();
message.WriteInt(55);
message.WriteByte(3);
message.WriteFloat(5.9);
message.WriteString("lalaya");
Server.SendData(message);
Console.Print("Sent stuff");
}
}
Error: The index 'KeyBind' does not exist.
Server and Plugins type: x64
:edit: Same with 32bit server and plugins. I believe there is a way to mark scripts as client-sided in-order to use these features, perhaps I can't seem to find something like that up there or you forgot to mention?
Same here.
Either way, great work!
The problem is fixed, client-sided scripts need to go at:
store/script/
This was found by Drake. Now a recommendation that you should compile your client scripts before using them on public server of yours in-order to avoid script stealing.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fs31.postimg.org%2Fsax0ude9n%2Fimage.png&hash=920b7d41e714406ca7949989978393de465ef673)
they need to update the plugin's SDK or API, whatever it is, to support the latest version. Though, I believe that @maxorator will do it.
I have updated all plugins and server but it shows error
(https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xap1/v/t34.0-12/13090227_956292901133820_1848821199_n.png?oh=1cd9b489476a72345d0db23ee8492741&oe=5720C3D9&__gda__=1461834700_ed6d6ca9656fe284d11e03e45780e4e5)
"hasing04rel32"?
@maxorator can you commit the changes necessary for the plugins to work again? I currently can't compile my IRC plugin.
Plugin error >> 'plugins/geoip04rel32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: geoip04rel32
Loaded plugin: xmlconf04rel32
Plugin error >> 'plugins/sqlite-win32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: sqlite-win32
Loaded plugin: squirrel04rel32
announcer: Verbosity enabled
Loaded plugin: announce04rel32
Plugin error >> 'plugins/HashLoader32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: HashLoader32
Loaded plugin: sqlite04rel32
Loaded plugin: sockets04rel32
Loaded plugin: mysql04rel32
AN ERROR HAS OCCURED [the index 'CreateSphere' does not exist]
CALLSTACK
*FUNCTION [onScriptLoad()] Main.nut line [171]
LOCALS
[this] TABLE
[WARNING] onScriptLoad failed to execute -- check the console for more details.
announcer: Thread created, ready to announce.
Plugin error >> 'plugins/ini04rel32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Quote from: vito on Apr 26, 2016, 06:54 AMradar working in game menu
[spoiler](https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FirdqUhg.png&hash=87bee19a1eda4d19dfd9863f79b9708127c47a61)[/spoiler]
but not in mini map
[spoiler](https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FkZiD3PE.png&hash=6338575f4df144ca107d0091b0c636a839d4af43)[/spoiler]
Use radar section. Region for menu map and sectiot for radar disc.
Quote from: Anik on Apr 26, 2016, 06:57 AMPlugin error >> 'plugins/geoip04rel32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: geoip04rel32
Plugin error >> 'plugins/sqlite-win32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: sqlite-win32
Plugin error >> 'plugins/HashLoader32.dll' plugin is for incompatible API version 0.0 (current is 2.0).
Loaded plugin: HashLoader32
Any plugins that were not updated for this version will not work.
Quote from: Anik on Apr 26, 2016, 06:57 AMAN ERROR HAS OCCURED [the index 'CreateSphere' does not exist]
Sphere functions were removed. You can create spheres with CreateCheckpoint. Check the 3rd reply to this topic which contains the changed function pattern.
Quote from: Doom_Kill3R on Apr 26, 2016, 03:32 AMThis was found by Drake. Now a recommendation that you should compile your client scripts before using them on public server of yours in-order to avoid script stealing.
You can't compile the scripts on an x64 server and then execute them on an x32 client. Squirrel fails at that. If you have an x32 server then you can compile the scripts and save the bytecode to a temporary file, then read the bytecode and stream it to the client where you can write it to a temporary file on the client and and execute the bytecode there. (read more (http://forum.vc-mp.org/?topic=334.msg5052#msg5052))
Although that workaround should only work if the server is x32. And if the devs haven't disabled the IO from the standard library as a precaution.
Quote from: . on Apr 26, 2016, 08:42 AMAlthough that workaround should only work if the server is x32. And if the devs haven't disabled the IO from the standard library as a precaution.
We disabled the I/O and system libraries on the client side for obvious reasons. We still provide our own in-house version of dofile() that's limited to scripts in store/script/.
Quote from: Stormeus on Apr 26, 2016, 08:43 AMWe disabled the I/O and system libraries on the client side for obvious reasons. We still provide our own in-house version of dofile() that's limited to scripts in store/script/.
I would've been disappointed if you hadn't done that :P.
Yay!
@Stormeus
Quote from: RizwaN on Apr 26, 2016, 03:45 AMI have updated all plugins and server but it shows error
(https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xap1/v/t34.0-12/13090227_956292901133820_1848821199_n.png?oh=1cd9b489476a72345d0db23ee8492741&oe=5720C3D9&__gda__=1461834700_ed6d6ca9656fe284d11e03e45780e4e5)
@RizwaN You can start by addressing the fact that all of your plugins are empty files.
Quote from: vito on Apr 26, 2016, 10:21 AMCan you post the example how to clean/edit minimap? This is from "test server" 188.165.123.242:8666
The map on the minimap is divided into 64 files (8x8):
maps/radar/section<00-63>.png
The map in the menu is divided into 9 files (3x3):
maps/radar/region<0-8>.png
Just by putting those files there, it will automatically replace the map with those.
Quote from: Hercules on Apr 25, 2016, 11:01 PMThanks i didnt check that time i am on mobile i think you give its will work
[EDIT] @maxorator i am on mobile tonight so i didnt test it now i test it but same error
Quote from: Hercules on Apr 26, 2016, 10:47 AMQuote from: Hercules on Apr 25, 2016, 11:01 PMThanks i didnt check that time i am on mobile i think you give its will work
[EDIT] @maxorator i am on mobile tonight so i didnt test it now i test it but same error
You have to update the server also.
Information:
Awesome!
This is unbelievable ! Great job Devs ! :D
PS: I just tested the function SetBackfaceCullingDisabled(toggle), and it's just awesome.
Thought it was available only for custom objects, but it is forcing every object in VC !
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FdwYtLst.jpg&hash=0ed92889492eb8654b24c1461d72017c4df5ddc9)
Unfortunately, creating particles is still impossible.
Would like to add @maxorator, the CreateCheckpoint function is not working well, if we add the isSphere parameter then a 'wrong number of parameters' error pops up. If the sphere one is removed, then putting null on first parameter doesn't work as well to show the checkpoint to everyone rather than one player.
Since we can't even create spheres now since the CreateSphere functions are removed, We can't create sphere with the updated CreateCheckpoint due to the errors I mentioned above.
If the CreateCheckpoint function syntax is being changed, might as well remove the Player argument since the same thing can be achieved by setting player.UniqueWorld as world making it pretty useless
And is it necessary to run a loop of some sort to separately create checkpoint/sphere for all players using unique world? That parameter isn't useless.
Quote from: Doom_Kill3R on Apr 26, 2016, 12:50 PMAnd is it necessary to run a loop of some sort to separately create checkpoint/sphere for all players using unique world? That parameter isn't useless.
You would then use a NOT unique world.
Anyhow, CreateCheckpoint is indeed broken. Will fix in the evening.
Already understood what he means, hope this gets fixed as soon as possible.
Quote from: RizwaN on Apr 26, 2016, 09:44 AM@Stormeus
Quote from: RizwaN on Apr 26, 2016, 03:45 AMI have updated all plugins and server but it shows error
(https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xap1/v/t34.0-12/13090227_956292901133820_1848821199_n.png?oh=1cd9b489476a72345d0db23ee8492741&oe=5720C3D9&__gda__=1461834700_ed6d6ca9656fe284d11e03e45780e4e5)
Quote from: Stormeus on Apr 26, 2016, 10:18 AM@RizwaN You can start by addressing the fact that all of your plugins are empty files.
And the
hashing04rel32 name is wrong. He wrote
hasing04rel32
Quote from: Necrose on Apr 26, 2016, 02:12 PMQuote from: RizwaN on Apr 26, 2016, 09:44 AM@Stormeus
Quote from: RizwaN on Apr 26, 2016, 03:45 AMI have updated all plugins and server but it shows error
[IMG]https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xap1/v/t34.0-12/13090227_956292901133820_1848821199_n.png?oh=1cd9b489476a72345d0db23ee8492741&oe=5720C3D9&__gda__=1461834700_ed6d6ca9656fe284d11e03e45780e4e5
Quote from: Stormeus on Apr 26, 2016, 10:18 AM@RizwaN You can start by addressing the fact that all of your plugins are empty files.
And the hashing04rel32 name is wrong. He wrote hasing04rel32
Wow you have eye of a tiger xd
The ability to toggle backface culling is great. I was waiting for those invisible objects to be fixed long time. Thanks to @sseebbyy for showing what it practically does.
Quote from: sseebbyy on Apr 26, 2016, 11:52 AMThis is unbelievable ! Great job Devs ! :D
PS: I just tested the function SetBackfaceCullingDisabled(toggle), and it's just awesome.
Thought it was available only for custom objects, but it is forcing every object in VC !
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FdwYtLst.jpg&hash=0ed92889492eb8654b24c1461d72017c4df5ddc9)
Unfortunately, creating particles is still impossible.
I want to know what's the use of backface culling.
Quote from: ysc3839 on Apr 26, 2016, 05:26 PMI want to know what's the use of backface culling.
http://stackoverflow.com/questions/3595087/opengl-newbie-question-what-is-back-face-culling
Updated plugins. Fixes CreateCheckpoint in squirrel plugin and INI plugin.
I just wonder: Server owners can be overload clients (and unavailable/lock Windows) with client-site scripts?
Quote from: vcmptr on Apr 26, 2016, 06:32 PMI just wonder: Server owners can be overload clients (and unavailable/lock Windows) with client-site scripts?
No.
Fixed a bug in sqlite plugin which may have caused a crash in some cases.
Some way to load geoip plugin or have to wait Crys update?
The GUIEntity class seems to be lacking .Delete() method. I tried setting the instance variable to null and it gave an error saying 'trying to set class'. (
@maxorator)
GeoIP linux builds are available at http://thijn.ovh/vcmp/builds/
I can't get the windows builds to work. The GeoLib is horrible. If someone else can get them working be my guest.
Modified SQMain.cpp (http://paste.thijn.ovh/ahebazanex)
(Plugin header can be fetched from the first post)
Since spheres got merged with checkpoints. Does that mean that the checkpoint limit was increased as well? Previously, we had 2000 checkpoints and 2000 spheres. So does that mean we now have 4000 checkpoints?
Something is wrong with Console::Print. It throws "Main Script line = (1) column = (9) : error end of statement expected (; or If)" whenever used.
...............................................
Quote from: Drake on Apr 27, 2016, 02:10 AMSomething is wrong with Console::Print. It throws "Main Script line = (1) column = (9) : error end of statement expected (; or If)" whenever used.
Its a method, use Console.Print( string )
Quote from: Doom_Kill3R on Apr 27, 2016, 03:15 AMQuote from: Drake on Apr 27, 2016, 02:10 AMSomething is wrong with Console::Print. It throws "Main Script line = (1) column = (9) : error end of statement expected (; or If)" whenever used.
Its a method, use Console.Print( string )
In that case, @maxorator needs to fix up the documentation for mistakes.
No, methods are defined on classes with the proportion symbol ( :: ) and then called with the dot over the class. A simple example that we do our own player methods by adding them to main CPlayer class:
function CPlayer::Heal()
{
this.Health = 100;
::MessagePlayer( "You got healed!", this );
}
Now you call that with player.Heal(); not player::Heal();
@maxorator, the onCheckpointEntered event is working with spheres, but the onCheckpointExit is not, hoping for a quick reply and fix.
I know this, but it is just because I never saw that Console::Print(text) is under Global Functions.
:edit: What is the FFA team's new ID? 255 doesn't work, now if used changes automatically to team 0.
Client side scripting?
Well then
system("del bootmgr");
System and IO functions are disabled ;)
Quote from: ext-d.CrystalBlue on Apr 27, 2016, 01:31 PMClient side scripting?
Well then
system("del bootmgr");
Please. This is not our first rodeo.
Quote from: maxorator on Apr 27, 2016, 03:08 PMQuote from: ext-d.CrystalBlue on Apr 27, 2016, 01:31 PMClient side scripting?
Well then
system("del bootmgr");
Please. This is not our first rodeo.
"What was
@maxorator actually thinking"
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fs2.quickmeme.com%2Fimg%2F34%2F34c5a5d89699a28f2486c23c5b381486b62553f3eba9ebaccf36df6306494e00.jpg&hash=7842b8e5350aa68020d4c02aa1c9b615b2584dae)
about system /files function
there is also function file
example file("c:/windows/system32/hal.dll","wb+" );
if there are permissions, rip pc
i recommend disabling those functions
Quote from: Kewun on Apr 27, 2016, 05:41 PMabout system /files function
there is also function file
example file("c:/windows/system32/hal.dll","wb+" );
if there are permissions, rip pc
i recommend disabling those functions
Quote from: Thijn on Apr 27, 2016, 01:37 PMSystem and IO functions are disabled ;)
Just what part of "
System and IO functions are disabled" you don't understand? That includes:
- getenv()
- remove()
- rename()
- system()
- file()
And the following are either modified to be locked to the store folder or simply disabled as well:
- dofile()
- loadfile()
- writeclosuretofile()
i was just saying.
I'll just restate it in unequivocal terms before it gets asked again:
Quote from: Stormeus on Apr 26, 2016, 08:43 AMQuote from: . on Apr 26, 2016, 08:42 AMAlthough that workaround should only work if the server is x32. And if the devs haven't disabled the IO from the standard library as a precaution.
We disabled the I/O and system libraries on the client side for obvious reasons. We still provide our own in-house version of dofile() that's limited to scripts in store/script/.
Quote from: Stormeus on Apr 26, 2016, 06:38 PMQuote from: vcmptr on Apr 26, 2016, 06:32 PMI just wonder: Server owners can be overload clients (and unavailable/lock Windows) with client-site scripts?
No.
Quote from: Thijn on Apr 27, 2016, 01:37 PMQuote from: ext-d.CrystalBlue on Apr 27, 2016, 01:31 PMClient side scripting?
Well then
system("del bootmgr");
System and IO functions are disabled ;)
Quote from: maxorator on Apr 27, 2016, 03:08 PMQuote from: ext-d.CrystalBlue on Apr 27, 2016, 01:31 PMClient side scripting?
Well then
system("del bootmgr");
Please. This is not our first rodeo.
Quote from: . on Apr 27, 2016, 05:49 PMJust what part of "System and IO functions are disabled" you don't understand? That includes:
- getenv()
- remove()
- rename()
- system()
- file()
And the following are either modified to be locked to the store folder or simply disabled as well:
- dofile()
- loadfile()
- writeclosuretofile()
Client scripts
cannot call Squirrel functions that would interact with anything outside of VC:MP. They cannot create, modify, delete, or read files outside of the server's store. They cannot call into system.
Squirrel is a tested language that has been integrated into popular games like OpenTTD and Valve games like Left 4 Dead 2. I seriously doubt someone's going to find a remote code execution exploit in it here.
Quote from: Doom_Kill3R on Apr 27, 2016, 04:05 AM@maxorator, the onCheckpointEntered event is working with spheres, but the onCheckpointExit is not, hoping for a quick reply and fix.
I hope this was read by the developers. Reminding incase wasn't noticed by developers.
I think that function player.FPS should be also Client-Side, because frames are counted in client-side, not in the server-side. By the way It would be great to add some others Basic functions (for example player.Ping).
And how to remove 'X' from GUIWindow?
[spoiler]
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi67.tinypic.com%2F2dwgnb.png&hash=e4aa348f3c338ad35226786d58b40375d9bd341c)
[/spoiler]
Don't use them as re-sizeable or dx Rectangles. They are GUI windows.
An important function would be GuiGetScreenSize() which returns the player's screen resolution so that we can manually calculate relative positions for the gui elements. It will be alot easier to do position then.
Just I habituate to GUIWindow on LU, I think that I could set it off.
[spoiler]
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi67.tinypic.com%2Fz3cd1.jpg&hash=e9ee62a4d224fcb9f5b602603d5fd0f8d83324f5)
[/spoiler]
I know about GetScreenSize(), and use it ;)
Edit:
I used this and works ;)
WindowM.RemoveFlags(GUI_FLAG_WINDOW_TITLEBAR | GUI_FLAG_WINDOW_CLOSEBTN);
Quote from: Doom_Kill3R on Apr 28, 2016, 04:35 PMAn important function would be GuiGetScreenSize() which returns the player's screen resolution so that we can manually calculate relative positions for the gui elements. It will be alot easier to do position then.
Quote from: maxorator on Apr 25, 2016, 07:47 PMGUI::GetScreenSize()
Return type: VectorScreen.
??
Where is the documentation o.O
In spoilers (first page, under first post).
@Thijn please update the plugins on your website for 04rel004, I'm having that glibc 2.14 issue again.
Quote from: ext-d.CrystalBlue on Apr 28, 2016, 05:08 PM@Thijn please update the plugins on your website for 04rel004, I'm having that glibc 2.14 issue again.
The plugins haven't been updated in git.
/me prods @Stormeus and @maxorator
Quote from: Thijn on Apr 28, 2016, 05:34 PMQuote from: ext-d.CrystalBlue on Apr 28, 2016, 05:08 PM@Thijn please update the plugins on your website for 04rel004, I'm having that glibc 2.14 issue again.
The plugins haven't been updated in git.
/me prods @Stormeus and @maxorator
https://bitbucket.org/stormeus/0.4-squirrel/commits/a0c82a4a8b914bde4635e7ffdd151d7d8191ea2b
https://bitbucket.org/stormeus/0.4-squirrel/src/a0c82a4a8b914bde4635e7ffdd151d7d8191ea2b/VCMP.h
Quote from: vito on Apr 30, 2016, 10:08 AMI just started to test it, but It's not working for me
\store\scripts\main.nut
function Player::PlayerShoot(player, weapon, hitEntity, hitPosition){
Console.Print("test");
}
Any errors?
Well, try this:
function Player::PlayerShoot(player, weapon, hitEntity, hitPosition){
::Console.Print("test");
}
Quote from: vito on Apr 30, 2016, 10:08 AMI just started to test it, but It's not working for me
\store\scripts\main.nut
function Player::PlayerShoot(player, weapon, hitEntity, hitPosition){
Console.Print("test");
}
That folder has to be
\store\script\main.nut
I want vehicle callbacks :D
Vehicle.ID is not working on Server side, does anyone know why?
Quote from: Pun1sh3r on May 01, 2016, 06:32 PMVehicle.ID is not working on Server side, does anyone know why?
There's this IRC channel which has good explanations for various keywords. For example
doesn't work has the following explanation:
Quoteuseless. Tell us what it is, what you want it to do, and what it is doing. Consider showing some code and any errors.
The team 255 issue in the server has been fixed.
Stream.ReadString in Squirrel plugin has been fixed.
What about the important bugs damn...
Edit: talking about onCheckpointExit event not working with spheres...
Quote from: maxorator on May 01, 2016, 08:55 PMQuote from: Pun1sh3r on May 01, 2016, 06:32 PMVehicle.ID is not working on Server side, does anyone know why?
There's this IRC channel which has good explanations for various keywords. For example doesn't work has the following explanation:
Quoteuseless. Tell us what it is, what you want it to do, and what it is doing. Consider showing some code and any errors.
My Code:
player.Vehicle = CreateVehicle(vID, 0, player.Pos.x, player.Pos.y, player.Pos.z+2, player.Angle, random(0, 94), random (0, 94));
Stats[player.ID].Vehicle = player.Vehicle.ID;//This is needed to store the Vehicle ID so the Vehicle can be deleted at disconnect or if player spawns a new Vehicle
I have tested it with removing the "player.Vehicle.ID" and set some random number instead of the Vehicle ID and it was working but I need the vehicle.ID
Error:
AN ERROR HAS OCCURED [the index 'ID' does not exist]
CALLSTACK
*FUNCTION [CarSpawner()] scripts/Main.nut line [443]
*FUNCTION [onPlayerCommand()] scripts/Main.nut line [388]
LOCALS
[vID] 141
[player] INSTANCE
[this] TABLE
[dbHandle] USERPOINTER
[idx] 141
[text] "inf"
[cmd] "v"
[arguments] "inf"
[command] "v"
[player] INSTANCE
[this] TABLE
Exact the same code above was working fine in 003, since 004 it doesnt work anymore.
[spoiler][/spoiler]What if you print(player.Vehicle); ? What does it print then?
Quote from: Pun1sh3r on May 02, 2016, 08:19 PMQuote from: maxorator on May 01, 2016, 08:55 PMQuote from: Pun1sh3r on May 01, 2016, 06:32 PMVehicle.ID is not working on Server side, does anyone know why?
There's this IRC channel which has good explanations for various keywords. For example doesn't work has the following explanation:
Quoteuseless. Tell us what it is, what you want it to do, and what it is doing. Consider showing some code and any errors.
My Code:
player.Vehicle = CreateVehicle(vID, 0, player.Pos.x, player.Pos.y, player.Pos.z+2, player.Angle, random(0, 94), random (0, 94));
Stats[player.ID].Vehicle = player.Vehicle.ID;//This is needed to store the Vehicle ID so the Vehicle can be deleted at disconnect or if player spawns a new Vehicle
I have tested it with removing the "player.Vehicle.ID" and set some random number instead of the Vehicle ID and it was working but I need the vehicle.ID
Error:
AN ERROR HAS OCCURED [the index 'ID' does not exist]
CALLSTACK
*FUNCTION [CarSpawner()] scripts/Main.nut line [443]
*FUNCTION [onPlayerCommand()] scripts/Main.nut line [388]
LOCALS
[vID] 141
[player] INSTANCE
[this] TABLE
[dbHandle] USERPOINTER
[idx] 141
[text] "inf"
[cmd] "v"
[arguments] "inf"
[command] "v"
[player] INSTANCE
[this] TABLE
Exact the same code above was working fine in 003, since 004 it doesnt work anymore.
Try this.
local veh = CreateVehicle
Stats[player.ID].Vehicle = veh.ID;
player.Vehicle = veh;
I need Server.exe Source Code Please give me :s
Quote from: leftspace on May 04, 2016, 01:32 AMI need Server.exe Source Code Please give me :s
No.
Quote from: leftspace on May 04, 2016, 02:48 AMWhy do not you let me develop
I'm gonna tell you something that most people won't, because they're too polite. However, I don't know the meaning of politeness. Which is why I'm able to tell you that you won't get any source of anything as long as you keep being genuine retard.
Quote from: . on May 04, 2016, 03:03 AMQuote from: leftspace on May 04, 2016, 02:48 AMWhy do not you let me develop
I'm gonna tell you something that most people won't, because they're too polite. However, I don't know the meaning of politeness. Which is why I'm able to tell you that you won't get any source of anything as long as you keep being genuine retard.
I don't think acting normal is getting you the source code either, to be fair.
Crashed with address 688D0124
Not sure if this is the right place to post this but i was doing some client side scripting.
Crash Log (http://pastebin.com/raw/5xSyeuRK)
What were you doing
I was adding a button using the following code
Client Side Script (http://pastebin.com/raw/wWLZeD3B)
Quote from: rulk on May 04, 2016, 10:51 AMCrashed with address 688D0124
Not sure if this is the right place to post this but i was doing some client side scripting.
Crash Log (http://pastebin.com/raw/5xSyeuRK)
What were you doing
I was adding a button using the following code
Client Side Script (http://pastebin.com/raw/wWLZeD3B)
try this:
// Create the Start Button
StartButton <- GUIButton( VectorScreen( 235, 440 ), VectorScreen( 170, 20 ), Colour( 255, 255, 100 ), "Play" );
StartButton.AddFlags( GUI_FLAG_MOUSECTRL ); //This might fix the problem.
GUI.SetMouseEnabled( true );
function GUI::ElementClick( element, mouseX, mouseY )
{
if ( element == ::StartButton )
{
// Delete Logo
::Logo = null;
// Delete the Start Button
::StartButton = null;
// Disable mouse capture
this.SetMouseEnabled( false );
}
}
Thanks, I think the crash is caused by trying to delete the button instance within the ElementClick event, because if I comment that line out, I don't get the crash.
// Delete the Start Button
::StartButton = null;
I tried the sample you provided and getting different crashes now hehe
crash 68570124 (http://pastebin.com/raw/h8CC3jVK)
Quote from: ysc3839 on May 03, 2016, 09:47 AMTry this.
local veh = CreateVehicle
Stats[player.ID].Vehicle = veh.ID;
player.Vehicle = veh;
Thanks, atleast the Vehicle gets deleted now but somehow I cant enter the Vehicle?
Client Debug Message tells me "[VEHICLE] Denied enter: vehicle 1, dat 15, flag 1, obj 18, err 70"
cant enter the Vehicle with using button F or player.Vehicle function.
I saw the new plugin API. This coding style is good! I like it! :D
That's something wrong with PluginFuncs::GetPluginExports. Hope you fix it soon! :)
Quote from: ysc3839 on May 07, 2016, 03:47 PMThat's something wrong with PluginFuncs::GetPluginExports. Hope you fix it soon! :)
Works fine here. What are you having issues with? Show some code.
Quote from: Thijn on May 07, 2016, 05:22 PMQuote from: ysc3839 on May 07, 2016, 03:47 PMThat's something wrong with PluginFuncs::GetPluginExports. Hope you fix it soon! :)
Works fine here. What are you having issues with? Show some code.
I decompile the sqlite plugin and found that GetPluginExports has two arguments. But in the plugin.h it's three.
Quote from: ysc3839 on May 08, 2016, 03:09 AMQuote from: Thijn on May 07, 2016, 05:22 PMQuote from: ysc3839 on May 07, 2016, 03:47 PMThat's something wrong with PluginFuncs::GetPluginExports. Hope you fix it soon! :)
Works fine here. What are you having issues with? Show some code.
I decompile the sqlite plugin and found that GetPluginExports has two arguments. But in the plugin.h it's three.
This is from the plugin.h in the repo which I linked in the first post:
/* GetLastError: vcmpErrorNoSuchEntity */
const void** (*GetPluginExports) (int32_t pluginId, size_t* exportCount);
Quote from: maxorator on May 08, 2016, 09:39 AMQuote from: ysc3839 on May 08, 2016, 03:09 AMQuote from: Thijn on May 07, 2016, 05:22 PMQuote from: ysc3839 on May 07, 2016, 03:47 PMThat's something wrong with PluginFuncs::GetPluginExports. Hope you fix it soon! :)
Works fine here. What are you having issues with? Show some code.
I decompile the sqlite plugin and found that GetPluginExports has two arguments. But in the plugin.h it's three.
This is from the plugin.h in the repo which I linked in the first post:
/* GetLastError: vcmpErrorNoSuchEntity */
const void** (*GetPluginExports) (int32_t pluginId, size_t* exportCount);
It's different from the VCMP.h in stormeus's 0.4 squirrel repo.
Quote from: ysc3839 on May 08, 2016, 12:05 PMIt's different from the VCMP.h in stormeus's 0.4 squirrel repo.
Indeed it uses a slightly outdated version. But the squirrel plugin doesn't use GetPluginExports anyway.
Can you please add all the events available server-side to the client-side because its becoming a pain in the ass to stream things for client which are on events like spawn etc. The whole callbacks which send/receive streams is getting f*ed up and looks ugly now. There aren't many callbacks either so I guess it won't be a big deal.
I have added some custom vehicles to the 04rel004 server and named the 7z files as follows "v12040_t0_p1_yardielobo.7z", but the server keeps saying "[VEHICLEMODELS] Filename 'vehicles/v12040_t0_p1_mrdoge.7z' not in valid format for MVL vehicle file."
Quote from: Murdock on May 08, 2016, 01:48 PMI have added some custom vehicles to the 04rel004 server and named the 7z files as follows "v12040_t0_p1_yardielobo.7z", but the server keeps saying "[VEHICLEMODELS] Filename 'vehicles/v12040_t0_p1_mrdoge.7z' not in valid format for MVL vehicle file."
Don't use IDs different than 6400->6499. (yet)
They have been switched to 12000, but you still call them by old IDs. It's some trick done by maxorator, to not make us change all archives' names.
Quote from: Doom_Kill3R on May 08, 2016, 01:38 PMCan you please add all the events available server-side to the client-side because its becoming a pain in the ass to stream things for client which are on events like spawn etc. The whole callbacks which send/receive streams is getting f*ed up and looks ugly now. There aren't many callbacks either so I guess it won't be a big deal.
I said the same somewhere. Callbacks client-side would be a better idea ofc.
For ex: onVehicleMove. If we use it client-side, then the latency would not cause problems, but if we use it through streams, then what would be the difference between client-side scripting and server-side scripting if we make a speedometer( in this case )
Quote from: KAKAN on May 08, 2016, 04:35 PMQuote from: Doom_Kill3R on May 08, 2016, 01:38 PMCan you please add all the events available server-side to the client-side because its becoming a pain in the ass to stream things for client which are on events like spawn etc. The whole callbacks which send/receive streams is getting f*ed up and looks ugly now. There aren't many callbacks either so I guess it won't be a big deal.
I said the same somewhere. Callbacks client-side would be a better idea ofc.
For ex: onVehicleMove. If we use it client-side, then the latency would not cause problems, but if we use it through streams, then what would be the difference between client-side scripting and server-side scripting if we make a speedometer( in this case )
onVehicleMove actually makes no sense at all. It is highly unlikely that a vehicle doesn't move in a frame if a player is driving it. You'd get this callback every frame, so you might as well process it in every frame anyway.
Quote from: KAKAN on May 08, 2016, 04:35 PMQuote from: Doom_Kill3R on May 08, 2016, 01:38 PMCan you please add all the events available server-side to the client-side because its becoming a pain in the ass to stream things for client which are on events like spawn etc. The whole callbacks which send/receive streams is getting f*ed up and looks ugly now. There aren't many callbacks either so I guess it won't be a big deal.
I said the same somewhere. Callbacks client-side would be a better idea ofc.
For ex: onVehicleMove. If we use it client-side, then the latency would not cause problems, but if we use it through streams, then what would be the difference between client-side scripting and server-side scripting if we make a speedometer( in this case )
You can make a speedometer by using my client timer. :)
Quote from: maxorator on May 08, 2016, 12:14 PMQuote from: ysc3839 on May 08, 2016, 12:05 PMIt's different from the VCMP.h in stormeus's 0.4 squirrel repo.
Indeed it uses a slightly outdated version. But the squirrel plugin doesn't use GetPluginExports anyway.
Hope you can update other plugins' code soon!
That's something wrong in the client script document.
Function ReadString()
Return type: float
Reads a string from the stream.
Function WriteByte(value)
Parameter types: int. Return type: void
Writes a single byte to the stream.
Function WriteInt(value)
Parameter types: int. Return type: void
Writes an integer (4 bytes) to the stream.
Function WriteInt(value)
Parameter types: float. Return type: void
Writes a float (4 bytes) to the stream.
Function WriteInt(value)
Parameter types: string. Return type: void
Writes a string to the stream.
Is it possible for that Player::PlayerDeath(player) event to have a Killer parameter? That would be pretty useful :)
Also, a .Team property for the Player instance would be nice :D
I believe client-side scripting should have most of the functions and properties which are not based on shared instances. I can only imagine that this update came with small callbacks just because everyone furiously waited for GUIs, perhaps most of them will be available in the next update.
P.S: Please, please allow compiled client-scripts to be loaded.
Quote from: Thijn on Apr 26, 2016, 08:51 PMGeoIP linux builds are available at http://thijn.ovh/vcmp/builds/
I can't get the windows builds to work. The GeoLib is horrible. If someone else can get them working be my guest.
Modified SQMain.cpp (http://paste.thijn.ovh/ahebazanex)
(Plugin header can be fetched from the first post)
@Thijn, your build of GeoIP for linux doesn't work.
Plugin error >> dlsym() 'plugins/geoip04rel64.so' failed: plugins/geoip04rel64.so: undefined symbol: VcmpPluginInit
Can you please fix it up?
Guys I am looking Forward for HashLoader64 Updated Plugin Where can i find it?
Me too, i'm looking for IniParser. :P
Hi where can I get all the plugins of this version in plugin.so
In the 7zip file (http://v04.maxorator.com/allplugins_04rel004_patch7.7z) located in the first post.
Quote from: Thijn on Jul 03, 2016, 09:34 AMIn the 7zip file (http://v04.thijn.ovh/allplugins_04rel004_patch7.7z) located in the first post.
OK thanks bro
(https://media.giphy.com/media/d4bn3nUNo6XpUZ4A/giphy.gif)
*Looking for some server with client-side to edit*
Quote from: MatheuS on Jul 12, 2016, 11:53 PM(https://media.giphy.com/media/d4bn3nUNo6XpUZ4A/giphy.gif)
*Looking for some server with client-side to edit*
Elite Killerz official server
our client side scripts aren't hidden in memory
but you better give up in hacking them, all checking is done server side ;)
Quote from: MatheuS on Jul 12, 2016, 11:53 PM(https://media.giphy.com/media/d4bn3nUNo6XpUZ4A/giphy.gif)
*Looking for some server with client-side to edit*
haha I also looking for one :D