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

Topics - 2b2ttianxiu

#1
Off-Topic General / [shenjack]: (for image)
Jun 02, 2025, 02:56 PM
Thank vc:mp developers for making someting perfect!
#2
Community Plugins / New Python Plugin
May 10, 2025, 05:37 PM
The vcmp-python-plugin, available on GitHub at github.com/tianxiu2b2t/vcmp-python-plugin, is a Python plugin designed for VC-MP game servers. VC-MP is a platform that enables multiplayer gaming based on the classic Vice City game. This plugin significantly enhances the functionality and gameplay of VC-MP servers.

The original author, ysc3839, laid the foundation for this plugin. He conducted in-depth research on the architecture of VC-MP game servers and the features of the Python programming language to write the initial plugin code. The plugin was able to connect with VC-MP game servers and handle various in-game events such as player join, leave, and chat messages. It also provided basic function interfaces for developers to create custom functions. For instance, a simple player management system was implemented to record player login times and gaming durations. Additionally, basic chat command functions were introduced to facilitate player interactions within the game.

On this basis, I have optimized the plugin. First, I reorganized and optimized the plugin's code structure. Previously disorganized code modules were divided into more structured ones, making the code easier to understand and maintain. For example, code related to game event handling was centralized into a dedicated module, while player management - related code was placed in another module. This makes it more convenient to add and modify functions in future development and improves the code's readability and reusability.
In terms of functionality, I have added more practical features. For example, the player permission system has been enhanced, allowing server administrators to allocate different permissions based on player levels and manage player behavior more flexibly. An in-game item and weapon management function has also been added. Administrators can now easily set which items and weapons players can use and their attributes, better controlling game balance and gameplay. Moreover, the plugin's performance has been optimized. Algorithm improvements and code simplification have reduced resource usage and improved stability and response speed under high - load conditions. For instance, the event handling mechanism has been optimized to more efficiently listen to and process a large number of in - game events, avoiding previous issues of event processing delays or omissions.

The optimized vcmp-python-plugin has the following standout features:
Firstly, it has strong function extensibility. With the rich interfaces provided by the plugin, developers can easily create various unique game functions and玩法 based on their needs, whether adding new game modes, designing complex task systems, or achieving interconnection with other servers.
Secondly, it boasts good stability and compatibility. After optimization, the plugin can run stably in various VC-MP game server environments and remains compatible with game updates. This ensures continuous and stable server operation for players.

Thirdly, it is easy to use and maintain. The optimized code structure and clear document comments enable developers new to the plugin to quickly get started with function development and plugin maintenance, lowering the usage threshold and attracting more developers to participate in plugin development and optimization.
In summary, the vcmp-python-plugin, optimized on the foundation of the original work by ysc3839, has become a powerful, stable, and easy - to - use plugin for VC-MP game servers. It provides strong support for the development of the VC-MP game community and the creation of diverse gameplay. It also offers a platform for developers to showcase their creativity and engage in technical exchanges.

(Written by kimi AI)
(My English is not good, and github commits with Chinese. :>)

#3
A question about VCMP SDK

Hello everyone, I have a question about Server performance report for VCMP SDK.

ServerPerformanceReportEvent(count=8, descriptions=['Streaming', 'Vehicle proximity checks', 'Processing players', 'Processing vehicles', ' Processing pickups', 'Processing objects', 'Packet processing', 'Plugin frame event'], times=[23, 108, 1746, 1197, 14459, 3715, 33070, 555183])

Here's my test report, I see some things that are in the thousands
Can you tell me if this is normal?
#4
I want to use csharp language to make dll c squirrel or call with python, but how can i make it(?
or how to fast develop plugin
#5
class CLabel {
    constructor() {

    }
    function _set(idx, val) {
        Console.Print(idx + " " + val)
        return null;
    }
    function _get(idx) {
        Console.Print(idx)
        return null;
    }
}
#6
Scripting and Server Management / Decode JSON
Oct 01, 2024, 03:06 AM
How i decode json?
I make a encode json code, but decode it again may different. How can i do?
#7
I tryed take a resource into other test server, its worked all. But I copyied it to my main server, some picture display empty, but has collisions in it.
I think it's resource memory error or display error.
thx!
#8
There is a new remote control plugin

Source Code:
https://github.com/tianxiu2b2t/VCMPAPISocket

Descripton:
  Using curl and easywsclient to handle the communication between the server and the client can provide developers with more development space, such as connecting to a Python-controlled server, transmitting player content, and so on.
This is a sample script(attachment): https://github.com/tianxiu2b2t/VCMPAPISocket/releases/v1.0.0

server.cfg:

vcmp_url https://xxxxxx.com:8192
vcmp_id (vcmp_id, you can generate a string for it)
vcmp_secret (vcmp_secret, you can generate a string for it)
vcmp_debug (vcmp_id, you can generate a string for it)

tip: WebSocket must not tls/ssl connection
Because easywsclient not support tls/ssl.

#9
I want to make a websocket to connect my master server

But I build has some error
about LNK2001 curl
#10
I tried download client version, but server responsed me:
If you found this url on the VC:MP forum as an alternative if the update server is down you should enter this URL in your VC:MP browser.<br/><br/>If you're here because you want to download the latest update when your browser fails to download it. See below!<br/>Version <a href="/files/build62A35348.7z">04rel006</a>: Latest version is 62A35348 compiled on 2022-06-10 04:06:20<br/>Version <a href="/files/build5B2FAF0E.7z">04rel005</a>: Latest version is 5B2FAF0E compiled on 2018-06-24 04:06:47<br/>Version <a href="/files/build5B2D7C82.7z">04rel004</a>: Latest version is 5B2D7C82 compiled on 2018-06-23 12:06:47<br/>Version <a href="/files/build571C093D.7z">04rel003</a>: Latest version is 571C093D compiled on 2016-04-24 01:04:46<br/>Version <a href="/files/build55986E38.7z">04rel002</a>: Latest version is 55986E38 compiled on 2015-07-05 01:07:37<br/>Version <a href="/files/build55986E30.7z">04rel001</a>: Latest version is 55986E30 compiled on 2015-07-05 01:07:37<br/>Version <a href="/files/build5432F2AD.7z">04rel000</a>: Latest version is 5432F2AD compiled on 2014-10-06 09:10:51<br/>Version <a href="/files/build5400CA70.7z">04pb402</a>: Latest version is 5400CA70 compiled on 2014-08-29 08:08:46<br/>Version <a href="/files/build53D23BCE.7z">04pb400</a>: Latest version is 53D23BCE compiled on 2014-07-25 01:07:13<br/>
What the hell this content?
#11
I check the (Socket).SetConnFunc("xxx")

But it first call and second or more didn't call this function.

So I fixed it

(PS: The ping is magic. It somethings lower 200ms, somethings higher than 200ms or more! example: 673ms)
(I use python to test and my website can feel it lag(somethings).)
(I don't know why, maybe first author write code for bugs.)
(It only works on 32bits application)
#12
I want to make a fake client join the server make some bot to listen chat words.
like samp's bots.
#13
Support / Vehicle Health
Aug 12, 2023, 11:53 AM
I want to make the vehicle lost a litte hp, but set after, client maybe different and then same.
I tryed the use vehicle.Health but. it handle onVehicleHealthChange again.
#14
Description
When you kick a player who has not loaded a good resource, there is a probability that the server crashes (on Windows squirrel-0.4)

Reproducible
Always

What you were doing when the bug happened
When player was banned or kicked by admin. there is a probability that the server crashes.
The function call in onPlayerJoin.
If you put it in the onPlayerSpawn function, it will greatly reduce the chance of crashing!

What you think caused the bug
CPlayer.Kick() or c language code.
#15
How can i calc really speed km/h of vehicle?
i try 'sqrt(a.X * a.X + a.Y + a.Y * a.Z * a.Z) * x'
x: 180, 252, 200, 3.6, i couldnt find muiltply number.
#16
The function Vulnerabilities and hazards.
This vulnerability does not jeopardize the server, but it can crash the client, and may also cause a blue screen of death
I pinpointed the cause of this crash to the parser function
Since I noticed the parsing of the "~" makes it crash the client, the only way to ensure that it doesn't jeopardize the player's gaming experience could be to first replace the text of the server-side ann command (announcement command) with "~" for air, or remove it
There are two ways for developers to fix this:
1. Add code that detects if the client is crashing, such as a try catch or an if judgment.
2. incomplete color characters let it show up and prevent parsing (I think this is the best solution)
#17
How can i calc High precision digital (no loss of precision) in squirrel, i need to calc big number, e.x 1000000000000 in 32-bit server, i dont want to change my server bit version, because i compiled my script.
#18
Im using client 'raytrace' to detect attacked target.
But i not sure use what flags to detect. it likes a bug
If them cannot detect. How do make it?
#19
Description:
on rel004 use 006rel plugin, use vehicle.Fix() function after, the server was crashed, it couldnt fix car
vehicle.Health = 1000.0 can fix health, but the car not fix well.
#20
Snippet Showroom / A utils code
Jul 02, 2023, 06:37 AM
function str_replace(str, search, replace) {
    if (str == search) return replace
    local start = 0, res = "", pos
    while ((pos = str.find(search, start)) != null) {
        res += str.slice(start, pos) + replace
        start = pos + search.len()
    }
    if (pos == null) res += str.slice(start, str.len())
    return res
}
function str_replace_lower(str, search, replace) {
    if (str.tolower() == search.tolower()) return replace
    local start = 0, res = "", pos
    while ((pos = str.tolower().find(search.tolower(), start)) != null) {
        res += str.slice(start, pos) + replace
        start = pos + search.len()
    }
    if (pos == null) res += str.slice(start, str.len())
    return res
}
function str_count(str, key) {
    local n = 0, s = 0
    while ((s = str.find(key, s)) != null) {
        n++
        s++
    }
    return n
}
function executeCommand(player, command) {
    if (command.len() == 1) return;
    local cmd = command.slice(str_startswith(command, "/") ? 1 : 0, command.find(" ",0) == null ? command.len() : command.find(" ",0)), text = command.find(" ",0) != null ? command.slice(command.find(" ",0)) : null
    return onPlayerCommand(player, cmd, text) == 1 ? true : false
}
some code. u can take them