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:
if (protections["bounty"])
strcpy(type, "Bounty"); strcpy(type, "Bounty");
break; break;
case RemoteEvents::CeoBan: case RemoteEvents::CeoBan:
if (protections["ceo_ban"])
strcpy(type, "Ceo Ban"); strcpy(type, "Ceo Ban");
break; break;
case RemoteEvents::CeoKick: case RemoteEvents::CeoKick:
if (protections["ceo_kick"])
strcpy(type, "Ceok Kick"); strcpy(type, "Ceok Kick");
break; break;
case RemoteEvents::CeoMoney: case RemoteEvents::CeoMoney:
if (protections["ceo_money"])
strcpy(type, "Ceo Money"); strcpy(type, "Ceo Money");
break; break;
case RemoteEvents::ClearWantedLevel: case RemoteEvents::ClearWantedLevel:
if (protections["clear_wanted_level"])
strcpy(type, "Clear Wanted Level"); strcpy(type, "Clear Wanted Level");
break; break;
case RemoteEvents::FakeDeposit: case RemoteEvents::FakeDeposit:
if (protections["fake_deposit"])
strcpy(type, "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:
if (protections["force_mission"])
strcpy(type, "Force Mission"); strcpy(type, "Force Mission");
break; break;
case RemoteEvents::GtaBanner: case RemoteEvents::GtaBanner:
if (protections["gta_banner"])
strcpy(type, "GTA Banner"); strcpy(type, "GTA Banner");
break; break;
case RemoteEvents::PersonalVehicleDestroyed: case RemoteEvents::PersonalVehicleDestroyed:
if (protections["personal_vehicle_destroyed"])
strcpy(type, "Personal Vehicle Destroyed"); strcpy(type, "Personal Vehicle Destroyed");
break; break;
case RemoteEvents::RemoteOffradar: case RemoteEvents::RemoteOffradar:
if (protections["remote_off_radar"])
strcpy(type, "Remote Off Radar"); strcpy(type, "Remote Off Radar");
break; break;
case RemoteEvents::RotateCam: case RemoteEvents::RotateCam:
if (protections["rotate_cam"])
{
//strcpy(type, "Rotate Cam"); //strcpy(type, "Rotate Cam");
return false; return false;
}
break; break;
case RemoteEvents::SendToCutscene: case RemoteEvents::SendToCutscene:
if (protections["send_to_cutscene"])
strcpy(type, "Send To Cutscene"); strcpy(type, "Send To Cutscene");
break; break;
case RemoteEvents::SendToIsland: case RemoteEvents::SendToIsland:
if (protections["send_to_island"])
strcpy(type, "Send To Island"); strcpy(type, "Send To Island");
break; break;
case RemoteEvents::SoundSpam: case RemoteEvents::SoundSpam:
case RemoteEvents::SoundSpam2: case RemoteEvents::SoundSpam2:
if (protections["sound_spam"])
strcpy(type, "Sound Spam"); strcpy(type, "Sound Spam");
break; break;
case RemoteEvents::Spectate: case RemoteEvents::Spectate:
if (protections["spectate"])
strcpy(type, "Specate"); strcpy(type, "Specate");
break; break;
case RemoteEvents::Teleport: case RemoteEvents::Teleport:
if (protections["force_teleport"])
strcpy(type, "Force Teleport"); strcpy(type, "Force Teleport");
break; break;
case RemoteEvents::TransactionError: case RemoteEvents::TransactionError:
if (protections["transaction_error"])
strcpy(type, "Transaction Error"); strcpy(type, "Transaction Error");
break; break;
case RemoteEvents::VehicleKick: case RemoteEvents::VehicleKick:
if (protections["vehicle_kick"])
strcpy(type, "Vehicle Kick"); strcpy(type, "Vehicle Kick");
break; break;
} }
if (protections["kick"])
{
for (int64_t kick_hash : kick_hashes) for (int64_t kick_hash : kick_hashes)
{
if (hash == kick_hash) if (hash == kick_hash)
strcpy(type, "General Kick"); {
sprintf(type, "General Kick (%" PRId64 ")", hash);
break;
}
}
}
if (strlen(type) != 0) if (strlen(type) != 0)
{ {