SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 20/01/2019, 10:01 PM   #1
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Lightbulb CHandling - Server control of handling.cfg & per-vehicle handlings

CHandling client & server plugin

CHandling is a client & server sided plugin which allows the server to have control over vehicle handlings. In addition, it modifies the default behaviour of GTA, allowing customized handlings between vehicles of the same model.
This means that you can have 10 Banshees while having each of them drive differently.

The client side is forced to use default handling values when connected to a CHandling-ready server.
Normal players can still play on the server, the plugin just wont have any effect on them.

Client sided plugin has a very simple update checker which can take the players to the download page of the latest release.

This is a test release, not everything is working as it should and some things may require a re-write.
I don't advice to introduce this to your players yet.


CURRENTLY SUPPORTS ONLY CARS! Boats, airplanes or bikes might not work properly, since they are handled differently in the game.

Supported versions
The plugin uses a .ini file for detecting the current version & loading proper memory offsets, the file is fetched from GitHub via libcurl when it doesn't exist, or when there is no matching version in the current file.
That means, that theorethically (unless some significant changes are made to SAMP), players wont need to download anything.

Currently supported versions (client): 0.3.7, 0.3.7 R2, 0.3.7 R3, 0.3.7 R3-1, 0.3DL R1

Download

Client side requires ASI Loader

Server side


Source code (client side)
Source code (server side)

WIKI (List of natives, descriptions etc)

Example filterscript which may also help testing/trying out



Thanks to
  • Zeex for sampGDK and SubHook
  • DK22Pac for his GTA plugin-sdk that I took some structs from
  • kurta999 for his AMX Native Redirect (taken from YSF)
  • Whitetiger for GetPacketId hook (taken from SAMPACv2)
  • ini for helping with various problems that occured along the way

Last edited by dotSILENT; 22/01/2019 at 03:33 PM.
dotSILENT is offline   Reply With Quote
Old 20/01/2019, 10:25 PM   #2
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Known bugs
  • Some things such as various handling/model flags and suspension lines don't work for players that had the vehicle already streamed in unless it's re-streamed for them
dotSILENT is offline   Reply With Quote
Old 20/01/2019, 11:15 PM   #3
HNIC
Big Clucker
 
HNIC's Avatar
 
Join Date: Jun 2017
Location: Downtown
Posts: 54
Reputation: 4
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Been looking for something like this, great job!
__________________
yeet.
HNIC is offline   Reply With Quote
Old 21/01/2019, 01:41 AM   #4
Whitetiger
Huge Clucker
 
Whitetiger's Avatar
 
Join Date: Nov 2007
Location: Greenville, NC, USA
Posts: 473
Reputation: 156
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Great release man, i wonder if you could do something similar but for weapon.dat?
__________________
GitHub

Author of SA-MP AC

Whitetiger is offline   Reply With Quote
Old 21/01/2019, 02:30 AM   #5
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

It's possible, I see that MTA did it but as far as I can see it's global, which makes sense. So one modification of weapon property is applied for every player.
I'm not sure about syncing the shoots then, don't know how samp does it under the hood but it probably wouldn't require any changing.

This plugin could evolve into some kind of all-in-one SAMP extension, but for that someone else would need to take it over. I don't have that much time, and I'm not the best at writing clean code when most of the things are experimental memory hacks.
IIRC wheel scaling could be easily added to this plugin as an additional handling option, it could make for some nice rim size modifications etc.
My main idea when creating this plugin was to create some sort of NFS-like upgrade packs for vehicles. You don't neccessarily need to set raw values. You can modify the existing ones, altering the handling.
In example, you can lower the mass by a percentage value and lower the drag multiplier, making the car go faster:
Code:
new Float:val;
GetVehicleHandling(vehicleid, HANDL_FMASS, val);
SetVehicleHandling(vehicleid, HANDL_FMASS, val*0.9); // 90% of previous mass
GetVehicleHandling(vehicleid, HANDL_FTURNMASS, val);
SetVehicleHandling(vehicleid, HANDL_FTURNMASS, val*0.9);
GetVehicleHandling(vehicleid, HANDL_FDRAGMULTIPLIER, val);
SetVehicleHandling(vehicleid, HANDL_FDRAGMULTIPLIER, val*0.9);
It's worth noting that subsequent calls to SetVehicleHandling wont create additional packets, since the modifications are all sent in a single packet at the next ProcessTick.
dotSILENT is offline   Reply With Quote
Old 21/01/2019, 02:36 AM   #6
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 2,056
Reputation: 494
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Nice
SyS is offline   Reply With Quote
Old 21/01/2019, 04:57 AM   #7
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,242
Reputation: 379
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Good job, i was going to look at it as something good for stopping people who mess around with vehicle's original handling after reading "The client side is forced to use default handling values when connected to a CHandling-ready server." But then again it requires the asi loader file on the client side which not many would download. Thanks for your efforts tho!
__________________
Be creative.

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is offline   Reply With Quote
Old 21/01/2019, 03:00 PM   #8
Nathan94
Little Clucker
 
Join Date: Mar 2015
Posts: 12
Reputation: 0
Default Re: CHandling - Server control of handlings & per-vehicle handlings

I'm using the testing filterscript and I keep getting "Failed to set handling value, check if it's correct". Can someone help?
Nathan94 is offline   Reply With Quote
Old 21/01/2019, 03:28 PM   #9
dotSILENT
Big Clucker
 
dotSILENT's Avatar
 
Join Date: Aug 2016
Location: Poland
Posts: 50
Reputation: 59
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Make sure you input float values with a dot and not a period (0.1 etc)
Also, there are value-correctness checks, you can see the proper value ranges here: Handling attributes

Some attribites such as the anim group cannot be set.
dotSILENT is offline   Reply With Quote
Old 21/01/2019, 03:44 PM   #10
Nathan94
Little Clucker
 
Join Date: Mar 2015
Posts: 12
Reputation: 0
Default Re: CHandling - Server control of handlings & per-vehicle handlings

Quote:
Originally Posted by dotSILENT View Post
Make sure you input float values with a dot and not a period (0.1 etc)
Also, there are value-correctness checks, you can see the proper value ranges here: Handling attributes

Some attribites such as the anim group cannot be set.
I am inputting everything correctly and yet it doesn't work. And yes, I am taking in mind the value-correctness checks, already read through the whole wiki on github.

Here's a pic of what I'm inputting:
https://ibb.co/q9WgfwN

Edit: forgot to mention in case you ask, I am trying to change the engine acceleration flag.
Nathan94 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] M-Server Control Panel 1.8 | VPS-Sftp/Shell Control | Rcon/Remote Control Server | + more | park4bmx Tools and Files 264 14/08/2018 05:05 PM
Car handlings are very hard ZombieNest Client Support 13 10/08/2014 11:03 AM
[FilterScript] Server Control Panel V1.0.0 - A simple server control filterscript with dialog chencong Filterscripts 10 27/09/2013 08:31 PM
[FilterScript] SA-MP 0.3c Vehicle Control System (Control everything, you want) Auxxx Filterscripts 78 09/10/2012 11:40 PM


All times are GMT. The time now is 01:27 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.