-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetVehicleID() #25
Comments
@mschnitzer now it should be correct ;) |
@Montero98 you mean to get the vehicle by id? or to get the ID based on a GTA:SA vehicle ptr? |
@myudev I mean, the specific ID of the vehicle i am sitting in. |
@Montero98 oh, ok I can provide you guys with offsets, implementing isn't that hard @marcelgerber . The Class pointer is a bit "harder", but i successfully got it since sa-mp 0.3z via pattern scanning offset (samp.dll+0xA6C66) and reading the following 3 mov instructions. Here is inline assembler code (or... just cast it): DWORD dwVehicle = 0x0;
DWORD FindVehicleIDFromGtaPtr = 0x1B0A0; // or "\xE8\x00\x00\x00\x00\x66\x3B\xC3", "x????xxx"
static unsigned short vehicleID_Return;
vehicleID_Return = 65535;
if (dwVehicle != nullptr && FindVehicleIDFromGtaPtr != nullptr)
{
__asm mov eax, dwVehicle
__asm push eax
__asm mov ecx, dwVehiclePool
__asm call FindVehicleIDFromGtaPtr
__asm mov[vehicleID_Return], ax
} Hope it helps. |
@myudev Nice work, we implement it, if an developer (also you) have time 👍 |
Thank you for your help @myudev . But i am not as good as to implement your code into the api - so i have to hope, that some developers of the api have the time to implement it as soon as possible, because i really need this function. |
How is it going? @marcelgerber @shadowlif @myudev |
Dear developers of the API, i am missing the function "GetVehicleID" with which users would be able to read a vehicles ID on the server. I really need this function for my program, so i would be very happy, if this could be included.
I hope, i'll get a reply soon. Best Regards, Montero
The text was updated successfully, but these errors were encountered: