SAMP.NET/sampdotnethook/a_vehicles.cpp

205 lines
6.3 KiB
C++
Raw Normal View History

2022-08-27 17:10:32 +00:00
#include "a_samp.h"
2022-08-27 17:16:44 +00:00
int CreateVehicle(int vehicletype, float x, float y, float z, float rotation, int color1, int color2, int respawn_delay) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::CreateVehicle, vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
}
2022-08-27 17:16:44 +00:00
void DestroyVehicle(int vehicleid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::DestroyVehicle, vehicleid);
}
2022-08-27 17:16:44 +00:00
void IsVehicleStreamedIn(int vehicleid, int forplayerid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::IsVehicleStreamedIn, vehicleid, forplayerid);
}
2022-08-27 17:16:44 +00:00
void GetVehiclePos(int vehicleid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehiclePos, vehicleid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
2022-08-27 17:16:44 +00:00
void SetVehiclePos(int vehicleid, float x, float y, float z) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehiclePos, vehicleid, x, y, z);
}
2022-08-27 17:16:44 +00:00
void GetVehicleZAngle(int vehicleid, float& z_angle) {
float _z_angle = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleZAngle, vehicleid, &_z_angle);
z_angle = _z_angle;
}
2022-08-27 17:16:44 +00:00
void GetVehicleRotationQuat(int vehicleid, float& w, float& x, float& y, float& z) {
float _w = NULL;
float _x = NULL;
float _y = NULL;
float _z = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleRotationQuat, vehicleid, &_w, &_x, &_y, &_z);
w = _w;
x = _x;
y = _y;
z = _z;
}
2022-08-27 17:16:44 +00:00
void GetVehicleDistanceFromPoint(int vehicleid, float x, float y, float z) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleDistanceFromPoint, vehicleid, x, y, z);
}
2022-08-27 17:16:44 +00:00
void SetVehicleZAngle(int vehicleid, float z_angle) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleZAngle, vehicleid, z_angle);
}
2022-08-27 17:16:44 +00:00
void SetVehicleParamsForPlayer(int vehicleid, int playerid, int objective, int doorslocked) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleParamsForPlayer, vehicleid, playerid, objective, doorslocked);
}
2022-08-27 17:16:44 +00:00
void ManualVehicleEngineAndLights() {
2022-08-27 17:10:32 +00:00
//g_Invoke->callNative(&PAWN::ManualVehicleEngineAndLights);
}
2022-08-27 17:16:44 +00:00
void SetVehicleParamsEx(int vehicleid, int engine, int lights, int alarm, int doors, int bonnet, int boot, int objective) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleParamsEx, vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
2022-08-27 17:16:44 +00:00
void GetVehicleParamsEx(int vehicleid, int& engine, int& lights, int& alarm, int& doors, int& bonnet, int& boot, int& objective) {
int _engine = NULL;
int _lights = NULL;
int _alarm = NULL;
int _doors = NULL;
int _bonnet = NULL;
int _boot = NULL;
int _objective = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleParamsEx, vehicleid, &_engine, &_lights, &_alarm, &_doors, &_bonnet, &_boot, &_objective);
engine = _engine;
lights = _lights;
alarm = _alarm;
doors = _doors;
bonnet = _bonnet;
boot = _boot;
objective = _objective;
}
2022-08-27 17:16:44 +00:00
void SetVehicleToRespawn(int vehicleid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleToRespawn, vehicleid);
}
2022-08-27 17:16:44 +00:00
void LinkVehicleToInterior(int vehicleid, int interiorid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::LinkVehicleToInterior, vehicleid, interiorid);
}
2022-08-27 17:16:44 +00:00
void AddVehicleComponent(int vehicleid, int componentid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::AddVehicleComponent, vehicleid, componentid);
}
2022-08-27 17:16:44 +00:00
void RemoveVehicleComponent(int vehicleid, int componentid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::RemoveVehicleComponent, vehicleid, componentid);
}
2022-08-27 17:16:44 +00:00
void ChangeVehicleColor(int vehicleid, int color1, int color2) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::ChangeVehicleColor, vehicleid, color1, color2);
}
2022-08-27 17:16:44 +00:00
void ChangeVehiclePaintjob(int vehicleid, int paintjobid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::ChangeVehiclePaintjob, vehicleid, paintjobid);
}
2022-08-27 17:16:44 +00:00
void SetVehicleHealth(int vehicleid, float health) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleHealth, vehicleid, health);
}
2022-08-27 17:16:44 +00:00
void GetVehicleHealth(int vehicleid, float& health) {
float _health = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleHealth, vehicleid, &_health);
health = _health;
}
2022-08-27 17:16:44 +00:00
void AttachTrailerToVehicle(int trailerid, int vehicleid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::AttachTrailerToVehicle, trailerid, vehicleid);
}
2022-08-27 17:16:44 +00:00
void DetachTrailerFromVehicle(int vehicleid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::DetachTrailerFromVehicle, vehicleid);
}
2022-08-27 17:16:44 +00:00
int IsTrailerAttachedToVehicle(int vehicleid) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::IsTrailerAttachedToVehicle, vehicleid);
}
2022-08-27 17:16:44 +00:00
int GetVehicleTrailer(int vehicleid) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::GetVehicleTrailer, vehicleid);
}
2022-08-27 17:16:44 +00:00
void SetVehicleNumberPlate(int vehicleid, char* numberplate) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleNumberPlate, vehicleid, numberplate);
}
2022-08-27 17:16:44 +00:00
int GetVehicleModel(int vehicleid) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::GetVehicleModel, vehicleid);
}
2022-08-27 17:16:44 +00:00
int GetVehicleComponentInSlot(int vehicleid, int slot) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::GetVehicleComponentInSlot, vehicleid, slot);
}
2022-08-27 17:16:44 +00:00
int GetVehicleComponentType(int component) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::GetVehicleComponentType, component);
}
2022-08-27 17:16:44 +00:00
void RepairVehicle(int vehicleid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::RepairVehicle, vehicleid);
}
2022-08-27 17:16:44 +00:00
void GetVehicleVelocity(int vehicleid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleVelocity, vehicleid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
2022-08-27 17:16:44 +00:00
void SetVehicleVelocity(int vehicleid, float x, float y, float z) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleVelocity, vehicleid, x, y, z);
}
2022-08-27 17:16:44 +00:00
void SetVehicleAngularVelocity(int vehicleid, float x, float y, float z) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleAngularVelocity, vehicleid, x, y, z);
}
2022-08-27 17:16:44 +00:00
void GetVehicleDamageStatus(int vehicleid, int& panels, int& doors, int& lights, int& tires) {
int _panels = NULL;
int _doors = NULL;
int _lights = NULL;
int _tires = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleDamageStatus, vehicleid, &_panels, &_doors, &_lights, &_tires);
panels = _panels;
doors = _doors;
lights = _lights;
tires = _tires;
}
2022-08-27 17:16:44 +00:00
void UpdateVehicleDamageStatus(int vehicleid, int panels, int doors, int lights, int tires) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::UpdateVehicleDamageStatus, vehicleid, panels, doors, lights, tires);
}
2022-08-27 17:16:44 +00:00
void GetVehicleModelInfo(int vehiclemodel, int infotype, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::GetVehicleModelInfo, vehiclemodel, infotype, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
2022-08-27 17:16:44 +00:00
void SetVehicleVirtualWorld(int vehicleid, int worldid) {
2022-08-27 17:10:32 +00:00
g_Invoke->callNative(&PAWN::SetVehicleVirtualWorld, vehicleid, worldid);
}
2022-08-27 17:16:44 +00:00
int GetVehicleVirtualWorld(int vehicleid) {
2022-08-27 17:10:32 +00:00
return g_Invoke->callNative(&PAWN::GetVehicleVirtualWorld, vehicleid);
2022-08-27 17:16:44 +00:00
}