From fee1305492d5267da2d973d746885047edab0f14 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 18 Sep 2018 19:37:52 +0100 Subject: [PATCH 1/4] added CIA detection on OnPlayerTakePlayerDamage, fixes vehicle CIA blip issues. --- gamemodes/sf-cnr.pwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 0017111..04799a3 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5528,6 +5528,9 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( IsPlayerJailed( playerid ) || IsPlayerJailed( issuerid ) ) return 0; + if ( p_Class[ playerid ] == CLASS_POLICE && p_inFBI{ playerid } && p_inCIA{ playerid } && !p_inArmy{ playerid } ) + SetPlayerColor( playerid, setAlpha( COLOR_CIA, 0xFF ) ), p_VisibleOnRadar[ playerid ] = g_iTime + 2; + // alert admins new attack_difference = GetTickCount( ) - p_PlayerAltBindTick[ playerid ]; From e82ab2e4f31f820c95b7b704ff32e09effe15e6d Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 18 Sep 2018 20:16:44 +0100 Subject: [PATCH 2/4] fixes http://forum.sfcnr.com/showthread.php?60150-CIA-blip-is-not-showing-even-though-he-s-already-dealing-damage --- gamemodes/sf-cnr.pwn | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 04799a3..767ce0f 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5528,9 +5528,15 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( IsPlayerJailed( playerid ) || IsPlayerJailed( issuerid ) ) return 0; + // damaged player if ( p_Class[ playerid ] == CLASS_POLICE && p_inFBI{ playerid } && p_inCIA{ playerid } && !p_inArmy{ playerid } ) SetPlayerColor( playerid, setAlpha( COLOR_CIA, 0xFF ) ), p_VisibleOnRadar[ playerid ] = g_iTime + 2; + // shooter + if ( p_Class[ issuerid ] == CLASS_POLICE && p_inFBI{ issuerid } && p_inCIA{ issuerid } && !p_inArmy{ issuerid } ) + SetPlayerColor( issuerid, setAlpha( COLOR_CIA, 0xFF ) ), p_VisibleOnRadar[ issuerid ] = g_iTime + 2; + + // alert admins new attack_difference = GetTickCount( ) - p_PlayerAltBindTick[ playerid ]; From c13bfb4716b410dac5af3927cf5fb6f180597d85 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 18 Sep 2018 20:40:38 +0100 Subject: [PATCH 3/4] kicks the player out of the vehicle when the owner /v bring it. --- gamemodes/sf-cnr.pwn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 767ce0f..cb5d6cc 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5536,7 +5536,6 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( p_Class[ issuerid ] == CLASS_POLICE && p_inFBI{ issuerid } && p_inCIA{ issuerid } && !p_inArmy{ issuerid } ) SetPlayerColor( issuerid, setAlpha( COLOR_CIA, 0xFF ) ), p_VisibleOnRadar[ issuerid ] = g_iTime + 2; - // alert admins new attack_difference = GetTickCount( ) - p_PlayerAltBindTick[ playerid ]; @@ -16114,6 +16113,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) if ( GetPlayerCash( playerid ) < 10000 ) return SendError( playerid, "You need $10,000 to bring your vehicle to you." ); + foreach( new i : Player ) + { + if ( GetPlayerVehicleID( i ) == g_vehicleData[ playerid ] [ id ] [ E_VEHICLE_ID ] ) + { + SetPlayerPos( i, X, Y, ( Z + 0.5 ) ); + SendServerMessage( i, "You have been thrown out of the vehicle as the owner has teleported it away!" ); + } + } + new Float: nodeX, Float: nodeY, Float: nodeZ, Float: nextX, Float: nextY, nodeid = NearestNodeFromPoint( X, Y, Z ), From 46c5b3b3bc278ff6885cad5d596c1d7ca4922504 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 18 Sep 2018 20:44:47 +0100 Subject: [PATCH 4/4] addes GetPlayerPos for slapping the player out of the vehicle "/v bring" --- gamemodes/sf-cnr.pwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index cb5d6cc..6e44f20 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -16115,8 +16115,9 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) foreach( new i : Player ) { - if ( GetPlayerVehicleID( i ) == g_vehicleData[ playerid ] [ id ] [ E_VEHICLE_ID ] ) + if( GetPlayerVehicleID( i ) == g_vehicleData[ playerid ] [ id ] [ E_VEHICLE_ID ] ) { + GetPlayerPos( i, X, Y, Z ); SetPlayerPos( i, X, Y, ( Z + 0.5 ) ); SendServerMessage( i, "You have been thrown out of the vehicle as the owner has teleported it away!" ); }