Skip to content
Permalink
Browse files
Include a fix for knife kill desyncs
  • Loading branch information
RussellLVP committed Aug 5, 2020
1 parent ef44e63 commit b3f7ad1744f7129169cc6e7e03e694c6b634e143
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
@@ -6,7 +6,7 @@ import { Setting } from 'entities/setting.js';

// List of PawnConfig settings with their unique values and settings. Must be synced with Pawn. The
// settings can be in any category, of any type, as long as the identifier is a valid one.
// Next ID: 19
// Next ID: 20
const kSynchronizedSettings = new Map([
[ 'abuse/disable_out_of_range_damage', { id: 14 } ],
[ 'abuse/fake_car_entry_prevention_enter_ms', { id: 11 } ],
@@ -17,6 +17,7 @@ const kSynchronizedSettings = new Map([
[ 'abuse/ignore_sole_passenger_damage', { id: 5 } ],
[ 'abuse/kick_reason_public', { id: 6 } ],
[ 'abuse/kill_attribution_time_sec', { id: 7 } ],
[ 'abuse/knife_desync_fix', { id: 19 } ],
[ 'abuse/manual_sawnoff_damage', { id: 13 } ],
[ 'abuse/maximum_connections_per_ip', { id: 18 } ],
[ 'vehicles/drifting_enabled', { id: 1 } ],

Some generated files are not rendered by default. Learn more.

@@ -569,6 +569,13 @@ public OnPlayerDeath(playerid, killerid, reason) {
if (!g_isDisconnecting[playerid])
SetPlayerHealth(playerid, 100);

// Fixes desyncs caused by killing each other with knifes.
if (reason == WEAPON_KNIFE && g_abuseKnifeDesyncFix) {
new const originalVirtualWorld = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, originalVirtualWorld + 1);
SetPlayerVirtualWorld(playerid, originalVirtualWorld);
}

// Corrects the |killerid| when the "ninja jacking" bug has been used, and issues a monitor-
// level abuse report on the player abusing that bug, informing administrators.
if (killerid == INVALID_PLAYER_ID &&
@@ -15,6 +15,7 @@ new g_abuseHighFramerateDamageThreshold = 105;
new bool: g_abuseIgnoreSolePassengerDamage = true;
new bool: g_abuseKickReasonsPublic = true;
new g_abuseKillAttributionTimeSec = 10;
new bool: g_abuseKnifeDesyncFix = true;
new bool: g_abuseManualSawnoffDamage = false;
new g_maximumConnectionsPerIP = 3;

@@ -31,7 +32,7 @@ new bool: g_vehicleKeysBlockedInLasVenturas = true;

// These are the unique Ids for each of the properties that can be updated. They must be identical
// between the Pawn and the JavaScript code.
// Next ID: 19
// Next ID: 20
enum PawnConfigProperty {
kAbuseDisableOutOfRangeDamage = 14,
kAbuseFakeCarEntryPreventionEnterMs = 11,
@@ -42,6 +43,7 @@ enum PawnConfigProperty {
kAbuseIgnoreSolePassengerDamage = 5,
kAbuseKickReasonPublic = 6,
kAbuseKillAttributionTimeSec = 7,
kAbuseKnifeDesyncFix = 19,
kAbuseManualSawnoffDamage = 13,
kAbuseMaximumConnectionsPerIP = 18,
kVehiclesDriftingEnabled = 1,
@@ -87,6 +89,9 @@ public OnPawnConfigDataChange(PawnConfigProperty: property, Float: numberValue)
case kAbuseKillAttributionTimeSec:
g_abuseKillAttributionTimeSec = intValue;

case kAbuseKnifeDesyncFix:
g_abuseKnifeDesyncFix = !!intValue;

case kAbuseManualSawnoffDamage:
g_abuseManualSawnoffDamage = !!intValue;

0 comments on commit b3f7ad1

Please sign in to comment.