fix(GetEventData): Added checks for which protections are enabled

This commit is contained in:
Yimura 2021-01-02 16:16:29 +01:00
parent 34ca679a59
commit 8b9d95189a

View File

@ -13,92 +13,122 @@ namespace big
if (result && player < 32) if (result && player < 32)
{ {
auto hash = args[0]; auto hash = args[0];
auto &protections = g_settings.options["settings"]["protections"];
char type[32] = ""; char type[32] = "";
switch (hash) switch (hash)
{ {
case RemoteEvents::Bounty: case RemoteEvents::Bounty:
strcpy(type, "Bounty"); if (protections["bounty"])
strcpy(type, "Bounty");
break; break;
case RemoteEvents::CeoBan: case RemoteEvents::CeoBan:
strcpy(type, "Ceo Ban"); if (protections["ceo_ban"])
strcpy(type, "Ceo Ban");
break; break;
case RemoteEvents::CeoKick: case RemoteEvents::CeoKick:
strcpy(type, "Ceok Kick"); if (protections["ceo_kick"])
strcpy(type, "Ceok Kick");
break; break;
case RemoteEvents::CeoMoney: case RemoteEvents::CeoMoney:
strcpy(type, "Ceo Money"); if (protections["ceo_money"])
strcpy(type, "Ceo Money");
break; break;
case RemoteEvents::ClearWantedLevel: case RemoteEvents::ClearWantedLevel:
strcpy(type, "Clear Wanted Level"); if (protections["clear_wanted_level"])
strcpy(type, "Clear Wanted Level");
break; break;
case RemoteEvents::FakeDeposit: case RemoteEvents::FakeDeposit:
strcpy(type, "Fake Deposit"); if (protections["fake_deposit"])
strcpy(type, "Fake Deposit");
break; break;
case RemoteEvents::ForceMission: case RemoteEvents::ForceMission:
case RemoteEvents::ForceMission2: case RemoteEvents::ForceMission2:
case RemoteEvents::ForceMission3: case RemoteEvents::ForceMission3:
strcpy(type, "Force Mission"); if (protections["force_mission"])
strcpy(type, "Force Mission");
break; break;
case RemoteEvents::GtaBanner: case RemoteEvents::GtaBanner:
strcpy(type, "GTA Banner"); if (protections["gta_banner"])
strcpy(type, "GTA Banner");
break; break;
case RemoteEvents::PersonalVehicleDestroyed: case RemoteEvents::PersonalVehicleDestroyed:
strcpy(type, "Personal Vehicle Destroyed"); if (protections["personal_vehicle_destroyed"])
strcpy(type, "Personal Vehicle Destroyed");
break; break;
case RemoteEvents::RemoteOffradar: case RemoteEvents::RemoteOffradar:
strcpy(type, "Remote Off Radar"); if (protections["remote_off_radar"])
strcpy(type, "Remote Off Radar");
break; break;
case RemoteEvents::RotateCam: case RemoteEvents::RotateCam:
//strcpy(type, "Rotate Cam"); if (protections["rotate_cam"])
return false; {
//strcpy(type, "Rotate Cam");
return false;
}
break; break;
case RemoteEvents::SendToCutscene: case RemoteEvents::SendToCutscene:
strcpy(type, "Send To Cutscene"); if (protections["send_to_cutscene"])
strcpy(type, "Send To Cutscene");
break; break;
case RemoteEvents::SendToIsland: case RemoteEvents::SendToIsland:
strcpy(type, "Send To Island"); if (protections["send_to_island"])
strcpy(type, "Send To Island");
break; break;
case RemoteEvents::SoundSpam: case RemoteEvents::SoundSpam:
case RemoteEvents::SoundSpam2: case RemoteEvents::SoundSpam2:
strcpy(type, "Sound Spam"); if (protections["sound_spam"])
strcpy(type, "Sound Spam");
break; break;
case RemoteEvents::Spectate: case RemoteEvents::Spectate:
strcpy(type, "Specate"); if (protections["spectate"])
strcpy(type, "Specate");
break; break;
case RemoteEvents::Teleport: case RemoteEvents::Teleport:
strcpy(type, "Force Teleport"); if (protections["force_teleport"])
strcpy(type, "Force Teleport");
break; break;
case RemoteEvents::TransactionError: case RemoteEvents::TransactionError:
strcpy(type, "Transaction Error"); if (protections["transaction_error"])
strcpy(type, "Transaction Error");
break; break;
case RemoteEvents::VehicleKick: case RemoteEvents::VehicleKick:
strcpy(type, "Vehicle Kick"); if (protections["vehicle_kick"])
strcpy(type, "Vehicle Kick");
break; break;
} }
for (int64_t kick_hash : kick_hashes) if (protections["kick"])
if (hash == kick_hash) {
strcpy(type, "General Kick"); for (int64_t kick_hash : kick_hashes)
{
if (hash == kick_hash)
{
sprintf(type, "General Kick (%" PRId64 ")", hash);
break;
}
}
}
if (strlen(type) != 0) if (strlen(type) != 0)
{ {