Giter Site home page Giter Site logo

vcmp-lua's Issues

Map objects disappearing

Objects created with Object:new disappear from the map after a few minutes.

Script:

initTime = 0
Event.bind("onServerInit", function()
    loadObject(os.time())
	Timer.create(function()
		if Object.count() < 1 then
			Logger.info("No objects found | time: " .. os.time())
			Logger.info("After: " .. os.time() - initTime .. " secs")
		end
	end, 50, -1)
end)

function loadObject(timestamp)
	initTime = timestamp
	Object:new(4499, 1, -305.76, -481.706, 20.7062, 255)
	Logger.info("Object count: " .. Object.count() .. " | time: " .. timestamp)
end

Log:

Didn't find how to solve it

Plugin error >> dlopen() 'plugins/LuaPlugin_x64.so' failed: plugins/LuaPlugin_x64.so: undefined symbol: mysql_use_result
Failed to load plugin: LuaPlugin_x64

OS: Linux debian-m-2vcpu-16gb-fra1-01 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux

Server.getSettings() nil value

This function is returning the following error

Event callback error: main.lua:118: attempt to call a nil value (field 'getSettings')

player.name does not change the player's name.

Using player.name = "somename" does not change the player's name.

Request new functions:

vehicle:respawn()
vehicle:getDriver()
vehicle:getOccupant(slotID)
vehicle:getTyre(tyre)
Vehicle:setTyre(tyre, state)
vehicle:fix()
vehicle:getPart(partID)
vehicle:setPart(part, state)
vehicle.taxiLight
vehicle.turretRotation
pickup:getModel()

Map.hideObject does not support correct coordinate data

I'm trying to hide the following object

Map.hideObject(474, -393.412, -505.822, 9.92519)

This returns the following error:
[error] Event callback error: stack index 2, expected number, received number: not a numeric type that fits exactly an integer (number maybe has significant decimals) (bad argument into 'void(int, short, short, short)')

The game only hides an object if it uses a decimal value, otherwise the object is not hidden.

stream:readString() doing incorrect reading of data

When sending strings from the client to the server, fragments of previous reads persist on the server.

Client-side:

// If a string is shorter than the previous one, it will end up getting mixed up with some characters from the previous one.

words <- ["If", "a", "string", "is", "shorter", "than", "the", "previous", "one,", "it", "will", "end", "up", "getting", "mixed", "up", "with", "some", "characters", "from", "the", "previous", "one."] 

foreach(i, w in words) {
	local Data = Stream();
	Data.WriteInt(10)
	Data.WriteString(words[i]);
	Server.SendData(Data);
}

Server-side:

function onClientData(player, stream, size)
  local streamId = stream:readNumber()
  local string = stream:readString()
  if(streamId == 10) then
	Player.msgAll(string)
  end
end

In-game chat display

g

Missing functions

Here's the list I've noticed so far

Server.banPlayer(player) / player:ban()
Server.kickPlayer(player) / player:kick()
Server.banIP(ip)
Server.isIPBanned(ip)
Server.unbanIP(ip)
player.away
player:disarm()
player:setAlpha
player.alpha
vehicle.immunity

Edit: Also consider these functions: player:setAlpha/player.alpha, vehicle.immunity

onPlayerDisconnect: Inconsistency between Player 0 and Player 1

When there is more than one player, players 0 and 1 get confused by being indexed in the onPlayerDisconnect event.

If Player 0 leaves the server, it ends up being recognized as ID 1

Console logs:
Players connecting

Player 'Player0' ID 0 connected.
Player 'Player1' ID 1 connected.
Player 'Player2' ID 2 connected.

Player 0 leaving (The console shows that it is player 0 leaving, but the event recognizes it as player 1)

Disconnecting player 'Player0' at ID 0, sent quit packet with reason 1.
Player 'Player0' ID 0 disconnected.
Player1 left with the ID 1

Script in onPlayerDisconnect:

print(player.name .. " left with the ID " .. player.id)

failed do initialize embedded Lanes

When starting the plugin with the latest update, this happens
image.png

And also request for new functions too: player:setAlpha(), player.alpha, player.away, vehicle.immunity

Request Server functions

Squirrel

SetMaxPlayers(int)
SetMaxHeight(int)

Lua Suggestion

Server.maxPlayers = int
Server.maxHeight = int

Lua machine not exported

Hello, few days ago i noticed this in java plugin and decided to take a look at this plugin too.

In squirrel, stormeus does something like SendPluginCommand(0x7DC..., "");
Also on VcmpPluginInit, you can see somethings are 'exported'- the virtual machine.
Why this is needed is that if someone decided to write a plugin for this lua language, they need access to the lua virtual machine.

player:playSound

Sound plays for all players who are in the same world as the player

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.