feat(ScriptEventHandler): Added malicious events from GetEventData to scripteventhandler
This commit is contained in:
parent
9020d8b595
commit
d3a9e3d58d
@ -1,5 +1,4 @@
|
|||||||
#include "hooking.hpp"
|
#include "hooking.hpp"
|
||||||
#include "features.hpp"
|
|
||||||
#include "features/notify.hpp"
|
#include "features/notify.hpp"
|
||||||
#include "gta/enums.hpp"
|
#include "gta/enums.hpp"
|
||||||
#include "pointers.hpp"
|
#include "pointers.hpp"
|
||||||
@ -14,18 +13,130 @@ namespace big
|
|||||||
|
|
||||||
int64_t hash = args[0];
|
int64_t hash = args[0];
|
||||||
|
|
||||||
|
auto& protections = g_settings.options["settings"]["script_protections"];
|
||||||
|
char type[32] = "";
|
||||||
|
|
||||||
|
|
||||||
switch (hash)
|
switch (hash)
|
||||||
{
|
{
|
||||||
case FreemodePlayerEvents::PlayerJoined:
|
case RemoteEvents::Bounty:
|
||||||
if (g_settings.options["join_message"].get<bool>() && args[2] == 1289518925)
|
if (protections["bounty"])
|
||||||
{
|
strcpy(type, "Bounty");
|
||||||
char join_msg[128];
|
|
||||||
sprintf(join_msg, "<C>%s</C> is joining...", g_pointers->m_get_player_name((Player)args[1]));
|
|
||||||
|
|
||||||
notify::above_map(join_msg);
|
break;
|
||||||
|
case RemoteEvents::CeoBan:
|
||||||
|
if (protections["ceo_ban"])
|
||||||
|
strcpy(type, "Ceo Ban");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::CeoKick:
|
||||||
|
if (protections["ceo_kick"])
|
||||||
|
strcpy(type, "Ceo Kick");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::CeoMoney:
|
||||||
|
if (protections["ceo_money"])
|
||||||
|
strcpy(type, "Ceo Money");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::ClearWantedLevel:
|
||||||
|
if (protections["clear_wanted_level"])
|
||||||
|
strcpy(type, "Clear Wanted Level");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::FakeDeposit:
|
||||||
|
if (protections["fake_deposit"])
|
||||||
|
strcpy(type, "Fake Deposit");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::ForceMission:
|
||||||
|
case RemoteEvents::ForceMission2:
|
||||||
|
case RemoteEvents::ForceMission3:
|
||||||
|
if (protections["force_mission"])
|
||||||
|
strcpy(type, "Force Mission");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::GtaBanner:
|
||||||
|
if (protections["gta_banner"])
|
||||||
|
strcpy(type, "GTA Banner");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::PersonalVehicleDestroyed:
|
||||||
|
if (protections["personal_vehicle_destroyed"])
|
||||||
|
strcpy(type, "Personal Vehicle Destroyed");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::RemoteOffradar:
|
||||||
|
if (protections["remote_off_radar"])
|
||||||
|
strcpy(type, "Remote Off Radar");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::SendToCutscene:
|
||||||
|
if (protections["send_to_cutscene"])
|
||||||
|
strcpy(type, "Send To Cutscene");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::SendToIsland:
|
||||||
|
if (protections["send_to_island"])
|
||||||
|
strcpy(type, "Send To Island");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::SoundSpam:
|
||||||
|
case RemoteEvents::SoundSpam2:
|
||||||
|
if (protections["sound_spam"])
|
||||||
|
strcpy(type, "Sound Spam");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::Spectate:
|
||||||
|
if (protections["spectate"])
|
||||||
|
strcpy(type, "Specate");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::Teleport:
|
||||||
|
if (protections["force_teleport"])
|
||||||
|
strcpy(type, "Force Teleport");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::TransactionError:
|
||||||
|
if (protections["transaction_error"])
|
||||||
|
strcpy(type, "Transaction Error");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RemoteEvents::VehicleKick:
|
||||||
|
if (protections["vehicle_kick"])
|
||||||
|
strcpy(type, "Vehicle Kick");
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (protections["kick"])
|
||||||
|
{
|
||||||
|
if (hash == 1317868303 || hash == 495824472) return true;
|
||||||
|
|
||||||
|
for (int64_t kick_hash : kick_hashes)
|
||||||
|
{
|
||||||
|
if (hash == kick_hash)
|
||||||
|
{
|
||||||
|
sprintf(type, "General Kick (%zd)", hash);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strlen(type) != 0)
|
||||||
|
{
|
||||||
|
char msg[128];
|
||||||
|
strcpy(msg, "~g~BLOCKED SCRIPT EVENT~s~\nFrom: <C>");
|
||||||
|
strcat(msg, g_pointers->m_get_player_name(player));
|
||||||
|
strcat(msg, "</C>\nEvent Type: ~b~");
|
||||||
|
strcat(msg, type);
|
||||||
|
|
||||||
|
notify::above_map(msg);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_settings.options["settings"]["logging"]["script_events"])
|
if (g_settings.options["settings"]["logging"]["script_events"])
|
||||||
{
|
{
|
||||||
LOG(INFO) << "Received Script Event";
|
LOG(INFO) << "Received Script Event";
|
||||||
|
Reference in New Issue
Block a user