fix all other places where onVehicleDeleted isn't triggered after a delete packet is sent

This commit is contained in:
SaltySnail
2024-06-13 23:00:52 +02:00
committed by 20dka
parent 9d67838f8f
commit bfb2086e05
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -217,6 +217,7 @@ std::pair<bool, std::string> LuaAPI::MP::RemoveVehicle(int PID, int VID) {
auto c = MaybeClient.value().lock();
if (!c->GetCarData(VID).empty()) {
std::string Destroy = "Od:" + std::to_string(PID) + "-" + std::to_string(VID);
LuaAPI::MP::Engine->ReportErrors(LuaAPI::MP::Engine->TriggerEvent("onVehicleDeleted", "", PID, VID));
Engine->Network().SendToAll(nullptr, StringToVector(Destroy), true, true);
c->DeleteCar(VID);
Result.first = true;