diff --git a/gamemodes/irresistible/cnr/checkpoints.pwn b/gamemodes/irresistible/cnr/checkpoints.pwn index b8ad836..ce98f13 100644 --- a/gamemodes/irresistible/cnr/checkpoints.pwn +++ b/gamemodes/irresistible/cnr/checkpoints.pwn @@ -9,7 +9,7 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define ALL_CHECKPOINTS ( 37 ) +#define ALL_CHECKPOINTS ( 50 ) #define CP_BANK_MENU ( 1 ) #define CP_247_MENU ( 2 ) @@ -23,65 +23,65 @@ #define CP_AMMUNATION_1 ( 10 ) #define CP_AMMUNATION_2 ( 11 ) #define CP_COUNTRY_BANK_MENU ( 12 ) -#define CP_HOSPITAL_LV ( 14 ) -#define CP_FIGHTSTYLE_LV ( 15 ) -#define CP_HOSPITAL1_LS ( 17 ) -#define CP_HOSPITAL2_LS ( 18 ) -#define CP_FIGHTSTYLE_LS ( 19 ) -#define CP_PAWNSHOP ( 20 ) -#define CP_HOSPITAL_FC ( 21 ) -#define CP_REFILL_AMMO ( 22 ) -#define CP_REFILL_AMMO_LS ( 23 ) -#define CP_REFILL_AMMO_LV ( 24 ) -/*#define CP_DROP_OFF_COP ( 28 ) -#define CP_DROP_OFF_FC ( 29 ) -#define CP_DROP_OFF_DILLIMORE ( 30 ) -#define CP_DROP_OFF_DIABLO ( 31 ) -#define CP_DROP_OFF_QUBRADOS ( 32 ) -#define CP_DROP_OFF_COP_LS ( 33 ) -#define CP_DROP_OFF_FBI_LS ( 34 ) -#define CP_DROP_OFF_FBI_LV ( 35 ) -#define CP_DROP_OFF_COP_LV ( 36 ) -#define CP_DROP_OFF_FBI ( 37 ) -#define CP_DROP_OFF_HELI ( 38 )*/ -#define CP_BIZ_TERMINAL_COKE ( 25 ) -#define CP_BIZ_TERMINAL_METH ( 26 ) -#define CP_BIZ_TERMINAL_WEED ( 27 ) -#define CP_BIZ_TERMINAL_WEAP ( 28 ) -#define CP_REWARDS_4DRAG ( 29 ) -#define CP_REWARDS_CALIG ( 30 ) -#define CP_REWARDS_VISAGE ( 31 ) -#define CP_AIRPORT_SF ( 32 ) -#define CP_AIRPORT_LS ( 33 ) -#define CP_AIRPORT_LV ( 34 ) -#define CP_CASINO_BAR ( 35 ) -#define CP_ALCATRAZ_EXPORT ( 36 ) +#define CP_HOSPITAL_LV ( 13 ) +#define CP_FIGHTSTYLE_LV ( 14 ) +#define CP_HOSPITAL1_LS ( 15 ) +#define CP_HOSPITAL2_LS ( 16 ) +#define CP_FIGHTSTYLE_LS ( 17 ) +#define CP_PAWNSHOP ( 18 ) +#define CP_HOSPITAL_FC ( 19 ) +#define CP_REFILL_AMMO ( 20 ) +#define CP_REFILL_AMMO_LS ( 21 ) +#define CP_REFILL_AMMO_LV ( 22 ) +#define CP_DROP_OFF_COP ( 23 ) +#define CP_DROP_OFF_FC ( 24 ) +#define CP_DROP_OFF_DILLIMORE ( 25 ) +#define CP_DROP_OFF_DIABLO ( 26 ) +#define CP_DROP_OFF_QUBRADOS ( 27 ) +#define CP_DROP_OFF_COP_LS ( 28 ) +#define CP_DROP_OFF_FBI_LS ( 29 ) +#define CP_DROP_OFF_FBI_LV ( 30 ) +#define CP_DROP_OFF_COP_LV ( 31 ) +#define CP_DROP_OFF_FBI ( 32 ) +#define CP_DROP_OFF_HELI ( 33 ) +#define CP_BIZ_TERMINAL_COKE ( 34 ) +#define CP_BIZ_TERMINAL_METH ( 35 ) +#define CP_BIZ_TERMINAL_WEED ( 36 ) +#define CP_BIZ_TERMINAL_WEAP ( 37 ) +#define CP_REWARDS_4DRAG ( 38 ) +#define CP_REWARDS_CALIG ( 39 ) +#define CP_REWARDS_VISAGE ( 40 ) +#define CP_AIRPORT_SF ( 41 ) +#define CP_AIRPORT_LS ( 42 ) +#define CP_AIRPORT_LV ( 43 ) +#define CP_CASINO_BAR ( 44 ) +#define CP_ALCATRAZ_EXPORT ( 45 ) new g_Checkpoints [ ALL_CHECKPOINTS ] = { -1, ... }; /* ** Hooks ** */ hook OnScriptInit( ) { - //g_Checkpoints[ CP_DROP_OFF_COP ] = CreateDynamicCP( -1577.0952, 683.9492, 7.2440, 3.0, 0, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_COP ] = CreateDynamicCP( -1577.0952, 683.9492, 7.2440, 3.0, 0, -1, -1, 100.0 ); g_Checkpoints[ CP_BANK_MENU ] = CreateDynamicCP( -1405.0657, 831.0966, 984.7126, 1.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_COUNTRY_BANK_MENU ] = CreateDynamicCP( 2156.1299, 1640.2460, 1041.6124, 1.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_CHANGE_JOB ] = CreateDynamicCP( 361.8525, 173.6031, 1008.3828, 1.0, -1, -1, -1, 50.0 ); g_Checkpoints[ CP_HOSPITAL ] = CreateDynamicCP( -2647.5007, 659.0084, 970.4332, 2.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_PAINTBALL ] = CreateDynamicCP( -2172.2017, 252.1113, 35.3388, 1.0, -1, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_FBI ] = CreateDynamicCP( -2446.6785, 522.9684, 30.2548, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_FBI ] = CreateDynamicCP( -2446.6785, 522.9684, 30.2548, 3.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_FIGHTSTYLE ] = CreateDynamicCP( 768.2576, -22.8351, 1000.5859, 2.0, -1, -1, -1, 25.0 ); g_Checkpoints[ CP_247_MENU ] = CreateDynamicCP( -29.0409, -184.7446, 1003.5469, 1.0, -1, -1, -1, 25.0 ); g_Checkpoints[ CP_AMMUNATION_0 ] = CreateDynamicCP( 296.3782, -38.4512, 1001.5156, 1.0, -1, -1, -1, 20.0 ); g_Checkpoints[ CP_AMMUNATION_1 ] = CreateDynamicCP( 295.4524, -80.7487, 1001.5156, 1.0, -1, -1, -1, 20.0 ); g_Checkpoints[ CP_AMMUNATION_2 ] = CreateDynamicCP( 312.8432, -166.1419, 999.6010, 1.0, -1, -1, -1, 20.0 ); - //g_Checkpoints[ CP_DROP_OFF_HELI ] = CreateDynamicCP( -1651.6956, 700.8394, 38.2422, 5.0, -1, -1, -1, 50.0 ); + g_Checkpoints[ CP_DROP_OFF_HELI ] = CreateDynamicCP( -1651.6956, 700.8394, 38.2422, 5.0, -1, -1, -1, 50.0 ); g_Checkpoints[ CP_PAWNSHOP ] = CreateDynamicCP( 1333.0847, -1080.0726, 968.0430, 1.0, -1, -1, -1, 20.0 ); g_Checkpoints[ CP_REFILL_AMMO ] = CreateDynamicCP( -1615.2600, 685.5120, 7.1875, 1.0, -1, -1, -1, 20.0 ); g_Checkpoints[ CP_REFILL_AMMO_LS ] = CreateDynamicCP( -1615.2600, 685.5120, 7.1875, 1.0, -1, -1, -1, 20.0 ); - //g_Checkpoints[ CP_DROP_OFF_FC ] = CreateDynamicCP( -211.6869, 979.3518, 19.3237, 3.0, -1, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_DILLIMORE ] = CreateDynamicCP( 614.2876, -588.6716, 17.2330, 3.0, -1, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_DIABLO ] = CreateDynamicCP( -433.3666, 2255.6064, 42.4297, 3.0, -1, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_QUBRADOS ] = CreateDynamicCP( -1400.0497, 2647.2358, 55.6875, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_FC ] = CreateDynamicCP( -211.6869, 979.3518, 19.3237, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_DILLIMORE ] = CreateDynamicCP( 614.2876, -588.6716, 17.2330, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_DIABLO ] = CreateDynamicCP( -433.3666, 2255.6064, 42.4297, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_QUBRADOS ] = CreateDynamicCP( -1400.0497, 2647.2358, 55.6875, 3.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_BIZ_TERMINAL_COKE ] = CreateDynamicCP( 2563.5728, -1310.5925, 1143.7242, 1.0, -1, -1, -1, 30.0 ); g_Checkpoints[ CP_BIZ_TERMINAL_METH ] = CreateDynamicCP( 2034.0669, 1001.6073, 1510.2416, 1.0, -1, -1, -1, 30.0 ); g_Checkpoints[ CP_BIZ_TERMINAL_WEED ] = CreateDynamicCP( -1742.9982, -1377.3049, 5874.1333, 1.0, -1, -1, -1, 30.0 ); @@ -96,19 +96,19 @@ hook OnScriptInit( ) g_Checkpoints[ CP_ALCATRAZ_EXPORT ] = CreateDynamicCP( -1999.9487, 1781.2325, 43.7386, 1.0, -1, -1, -1, 30.0 ); // Out of SF - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -211.6869, 979.3518, 19.3237, 50.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 614.2876, -588.6716, 17.2330, 50.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -433.3666, 2255.6064, 42.4297, 50.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -1400.0497, 2647.2358, 55.6875, 50.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -211.6869, 979.3518, 19.3237, 50.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 614.2876, -588.6716, 17.2330, 50.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -433.3666, 2255.6064, 42.4297, 50.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -1400.0497, 2647.2358, 55.6875, 50.0); #if ENABLE_CITY_LV == true - //g_Checkpoints[ CP_DROP_OFF_COP_LV ] = CreateDynamicCP( 2225.6753, 2457.2388, -7.4531, 3.0, 0, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_COP_LV ] = CreateDynamicCP( 2225.6753, 2457.2388, -7.4531, 3.0, 0, -1, -1, 100.0 ); g_Checkpoints[ CP_HOSPITAL_LV ] = CreateDynamicCP( 1607.2659, 1815.2485, 10.8203, 2.0, -1, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_FBI_LV ] = CreateDynamicCP( 948.6036, 1811.2720, 8.6484, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_FBI_LV ] = CreateDynamicCP( 948.6036, 1811.2720, 8.6484, 3.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_FIGHTSTYLE_LV ] = CreateDynamicCP( 766.8416, -62.1872, 1000.6563, 2.0, -1, -1, -1, 25.0 ); g_Checkpoints[ CP_REFILL_AMMO_LV ] = CreateDynamicCP( 2251.9438, 2488.7981, 10.9908, 1.0, -1, -1, -1, 20.0 ); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 2225.6753, 2457.2388, -7.4531, 20.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 948.6036, 1811.2720, 8.6484, 20.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 2225.6753, 2457.2388, -7.4531, 20.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 948.6036, 1811.2720, 8.6484, 20.0); CreateDynamic3DTextLabel("[LEARN FIGHT STYLES]", COLOR_GOLD, 766.8416, -62.1872, 1000.6563, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 9); CreateDynamic3DTextLabel("[HOSPITAL]", COLOR_GOLD, 1607.2659, 1815.2485, 10.8203, 20.0); CreateDynamic3DTextLabel("[REFILL AMMO]", COLOR_GOLD, 2251.9438, 2488.7981, 10.9908, 20.0); @@ -118,14 +118,14 @@ hook OnScriptInit( ) g_Checkpoints[ CP_HOSPITAL1_LS ] = CreateDynamicCP( 1172.0767, -1323.3257, 15.4029, 1.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_HOSPITAL2_LS ] = CreateDynamicCP( 2034.0677, -1401.6699, 17.2938, 1.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_HOSPITAL_FC ] = CreateDynamicCP( -320.2127, 1048.2339, 20.3403, 1.0, -1, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_COP_LS ] = CreateDynamicCP( 1569.0277, -1694.1566, 5.8906, 3.0, 0, -1, -1, 100.0 ); - //g_Checkpoints[ CP_DROP_OFF_FBI_LS ] = CreateDynamicCP( 1516.6716, -1458.9398, 9.5000, 3.0, -1, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_COP_LS ] = CreateDynamicCP( 1569.0277, -1694.1566, 5.8906, 3.0, 0, -1, -1, 100.0 ); + g_Checkpoints[ CP_DROP_OFF_FBI_LS ] = CreateDynamicCP( 1516.6716, -1458.9398, 9.5000, 3.0, -1, -1, -1, 100.0 ); g_Checkpoints[ CP_FIGHTSTYLE_LS ] = CreateDynamicCP( 772.0868, 12.6397, 1000.6996, 1.0, -1, -1, -1, 25.0 ); g_Checkpoints[ CP_BANK_MENU_LS ] = CreateDynamicCP( 2136.4946, 1226.1787, 1017.1369, 1.0, -1, -1, -1, 25.0 ); g_Checkpoints[ CP_REFILL_AMMO_LS ] = CreateDynamicCP( 1579.5439, -1635.5166, 13.5609, 1.0, -1, -1, -1, 20.0 ); CreateDynamic3DTextLabel("[BANK MENU]", COLOR_GOLD, 2136.4946, 1226.1787, 1017.1369, 20.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 1569.0277, -1694.1566, 5.8906, 20.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 1516.6716, -1458.9398, 9.5000, 20.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 1569.0277, -1694.1566, 5.8906, 20.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, 1516.6716, -1458.9398, 9.5000, 20.0); CreateDynamic3DTextLabel("[LEARN FIGHT STYLES]", COLOR_GOLD, 772.0868, 12.6397, 1000.6996, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 10); CreateDynamic3DTextLabel("[HOSPITAL]", COLOR_GOLD, 1172.0767, -1323.3257, 15.4029, 20.0); CreateDynamic3DTextLabel("[HOSPITAL]", COLOR_GOLD, 2034.0677, -1401.6699, 17.2938, 20.0); @@ -143,9 +143,9 @@ hook OnScriptInit( ) CreateDynamic3DTextLabel("[SHOP]", COLOR_GOLD, -29.0409,-184.7446,1003.5469, 20.0); CreateDynamic3DTextLabel("[BANK MENU]", COLOR_GOLD, -1405.0657, 831.0966, 984.7126, 20.0); CreateDynamic3DTextLabel("[BANK MENU]", COLOR_GOLD, 2156.1299, 1640.2460, 1041.6124, 20.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -1577.0952, 683.9492, 7.2440, 20.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -2446.6785, 522.9684, 30.2548, 20.0); - //CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -1651.6956, 700.8394, 38.2422, 50.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -1577.0952, 683.9492, 7.2440, 20.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -2446.6785, 522.9684, 30.2548, 20.0); + CreateDynamic3DTextLabel("[DROP OFF]", COLOR_GOLD, -1651.6956, 700.8394, 38.2422, 50.0); CreateDynamic3DTextLabel("[GUN STORE]", COLOR_GOLD, 296.3782, -38.4512, 1001.5156, 20.0); CreateDynamic3DTextLabel("[GUN STORE]", COLOR_GOLD, 295.4524, -80.7487, 1001.5156, 20.0); CreateDynamic3DTextLabel("[GUN STORE]", COLOR_GOLD, 312.8432, -166.1419, 999.6010, 20.0); @@ -179,5 +179,6 @@ hook OnPlayerEnterDynamicCP( playerid, checkpointid ) if ( IsPlayerInPaintBall( playerid ) || IsPlayerDueling( playerid ) || IsPlayerInEvent( playerid ) ) { return SendError( playerid, "You can't do anything as you are in an event." ), Y_HOOKS_BREAK_RETURN_1; } + return 1; } diff --git a/gamemodes/irresistible/cnr/features/animations.pwn b/gamemodes/irresistible/cnr/features/animations.pwn index e05e872..74e34ac 100644 --- a/gamemodes/irresistible/cnr/features/animations.pwn +++ b/gamemodes/irresistible/cnr/features/animations.pwn @@ -343,7 +343,7 @@ stock CreateLoopingAnimation( playerid, animlib[ ], animname[ ], Float:Speed, lo else if ( !IsPlayerSpawned( playerid ) ) return SendError( playerid, "You cannot use this command since you're not spawned." ); // else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); else if ( IsPlayerTazed( playerid ) ) return SendError( playerid, "You cannot use this command since you're tazed." ); - //else if ( IsPlayerDetained( playerid ) ) return SendError( playerid, "You cannot use this command since you're detained." ); + else if ( IsPlayerDetained( playerid ) ) return SendError( playerid, "You cannot use this command since you're detained." ); else if ( IsPlayerCuffed( playerid ) ) return SendError( playerid, "You cannot use this command since you're cuffed." ); else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You cannot use this command since you're tied." ); else if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You cannot use this command since you're kidnapped." ); diff --git a/gamemodes/irresistible/cnr/features/bribes.pwn b/gamemodes/irresistible/cnr/features/bribes.pwn index 32ae417..f1045c0 100644 --- a/gamemodes/irresistible/cnr/features/bribes.pwn +++ b/gamemodes/irresistible/cnr/features/bribes.pwn @@ -53,7 +53,7 @@ hook OnPlayerPickUpDynPickup( playerid, pickupid ) { foreach ( new bribeid : BribeCount ) if ( g_bribeData[ bribeid ] [ E_PICKUP ] [ 0 ] == pickupid || g_bribeData[ bribeid ] [ E_PICKUP ] [ 1 ] == pickupid ) { - if ( !( g_bribeData[ bribeid ] [ E_DISABLED ] == true || p_WantedLevel[ playerid ] <= 0 || IsPlayerCuffed( playerid ) || GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING ) ) // || IsPlayerDetained( playerid ) + if ( !( g_bribeData[ bribeid ] [ E_DISABLED ] == true || p_WantedLevel[ playerid ] <= 0 || IsPlayerCuffed( playerid ) || GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING || IsPlayerDetained( playerid ) ) ) { new iWanted = 2; diff --git a/gamemodes/irresistible/cnr/features/c4.pwn b/gamemodes/irresistible/cnr/features/c4.pwn index fed9bd2..cc7a4d1 100644 --- a/gamemodes/irresistible/cnr/features/c4.pwn +++ b/gamemodes/irresistible/cnr/features/c4.pwn @@ -168,7 +168,7 @@ CMD:c4( playerid, params[ ] ) if ( !IsPlayerJob( playerid, JOB_TERRORIST ) ) return SendError( playerid, "This is restricted to terrorists." ); if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); if ( IsPlayerTazed( playerid ) ) return SendError( playerid, "You cannot use this command since you're tazed." ); - //if ( IsPlayerDetained( playerid ) ) return SendError( playerid, "You cannot use this command since you're detained." ); + if ( IsPlayerDetained( playerid ) ) return SendError( playerid, "You cannot use this command since you're detained." ); if ( IsPlayerCuffed( playerid ) ) return SendError( playerid, "You cannot use this command since you're cuffed." ); if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You cannot use this command since you're tied." ); if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You cannot use this command since you're kidnapped." ); diff --git a/gamemodes/irresistible/cnr/features/cop/_cop.pwn b/gamemodes/irresistible/cnr/features/cop/_cop.pwn index 53379cc..62a65da 100644 --- a/gamemodes/irresistible/cnr/features/cop/_cop.pwn +++ b/gamemodes/irresistible/cnr/features/cop/_cop.pwn @@ -11,19 +11,4 @@ #include "irresistible\cnr\features\cop\arrest.pwn" #include "irresistible\cnr\features\cop\bail.pwn" #include "irresistible\cnr\features\cop\ticket.pwn" -#include "irresistible\cnr\features\cop\emp.pwn" - -/* ** Hooks ** */ -/*hook OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid, bodypart ) -{ - if ( p_Class[ playerid ] == CLASS_POLICE && !IsPlayerNPC( playerid ) ) - { - new Float: x, Float: y, Float: z; - - GetPlayerPos( playerid, x, y, z ); - - if ( x >= -1650.0 && x <= -1571.0 && y >= 647.0 && y <= 711.0 ) - return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0; - } - return 1; -}*/ \ No newline at end of file +#include "irresistible\cnr\features\cop\emp.pwn" \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 04c98fc..319f09d 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -9,10 +9,6 @@ #include < YSI\y_hooks > /* ** Variables ** */ -static stock - bool: p_AwaitingBCAttempt [ MAX_PLAYERS char ], - p_AwaitingBCAttemptTimer [ MAX_PLAYERS ] = { -1, ... } -; /* ** Forwards ** */ forward OnPlayerArrested( playerid, victimid, totalarrests, totalpeople ); @@ -20,62 +16,20 @@ forward OnPlayerArrested( playerid, victimid, totalarrests, totalpeople ); /* ** Hooks ** */ hook OnPlayerDisconnect( playerid, reason ) { - - p_AwaitingBCAttempt{ playerid } = false; - KillTimer( p_AwaitingBCAttemptTimer[ playerid ] ); - p_AwaitingBCAttemptTimer[ playerid ] = -1; - // Quit to Avoid - Award Handling AwardNearestLEO( playerid, 0 ); return 1; } -hook OnPlayerSpawn( playerid ) -{ - p_AwaitingBCAttempt{ playerid } = false; - KillTimer( p_AwaitingBCAttemptTimer[ playerid ] ); - p_AwaitingBCAttemptTimer[ playerid ] = -1; - return 1; -} - -#if defined AC_INCLUDED -hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart ) -#else -hook OnPlayerDeath( playerid, killerid, reason ) -#endif -{ - KillTimer( p_AwaitingBCAttemptTimer[ playerid ] ); - p_AwaitingBCAttemptTimer[ playerid ] = -1; - return 1; -} - -hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) -{ - /*if ( PRESSED( KEY_LOOK_BEHIND ) ) // MMB to taze/cuff/ar - { - if ( p_Class[ playerid ] == CLASS_POLICE && ! IsPlayerSpawnProtected( playerid ) ) - { - new - closestid = GetClosestPlayer( playerid ); - - if ( closestid != INVALID_PLAYER_ID && p_Class[ closestid ] != CLASS_POLICE && ! ( GetDistanceBetweenPlayers( playerid, closestid ) > 10.0 || !IsPlayerConnected( closestid ) ) ) { - if ( GetPlayerWantedLevel( closestid ) > 5 ) { - if ( IsPlayerCuffed( closestid ) ) ArrestPlayer( closestid, playerid ); - else if ( IsPlayerTazed( closestid ) ) CuffPlayer( closestid, playerid ); - else TazePlayer( closestid, playerid ); - } else { - TicketPlayer( closestid, playerid ); - } - } - } - }*/ - return 1; -} - -/*hook OnPlayerEnterDynamicCP( playerid, checkpointid ) +hook OnPlayerEnterDynamicCP( playerid, checkpointid ) { // Detain Mechanism - if ( bDropoff ) + if ( checkpointid == g_Checkpoints[ CP_DROP_OFF_COP ] || + checkpointid == g_Checkpoints[ CP_DROP_OFF_FC ] || checkpointid == g_Checkpoints[ CP_DROP_OFF_DILLIMORE ] || + checkpointid == g_Checkpoints[ CP_DROP_OFF_DIABLO ] || checkpointid == g_Checkpoints[ CP_DROP_OFF_QUBRADOS ] || + checkpointid == g_Checkpoints[ CP_DROP_OFF_COP_LS ] || checkpointid == g_Checkpoints[ CP_DROP_OFF_FBI_LS ] || + checkpointid == g_Checkpoints[ CP_DROP_OFF_FBI_LV ] || checkpointid == g_Checkpoints[ CP_DROP_OFF_COP_LV ] || + checkpointid == g_Checkpoints[ CP_DROP_OFF_FBI ] || checkpointid == g_Checkpoints[ CP_DROP_OFF_HELI ] ) { if ( p_Class[ playerid ] != CLASS_POLICE ) return 1; @@ -130,42 +84,165 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) else return SendError( playerid, "You need a driver of a vehicle with detained criminals to use this." ); } return 1; -}*/ +} /* ** Commands ** */ CMD:taze( playerid, params[ ] ) { - new - pID = GetClosestPlayer( playerid ); - - return TazePlayer( pID, playerid ); + new victimid; + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); + else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/taze [PLAYER_ID]" ); + else if ( victimid == playerid ) return SendError( playerid, "You cannot taze yourself." ); + else if ( !IsPlayerConnected( victimid ) ) return SendError( playerid, "There are no players around to taze." ); + else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); + else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 5.0 && IsPlayerConnected( victimid ) ) + { + if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); + if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); + if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "This player is in a vehicle " ); + if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); + if ( IsPlayerTazed( victimid ) ) return SendError( playerid, "This player is already tazed." ); + if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." ); + if ( IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is already cuffed." ); + if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is already detained." ); + if ( IsPlayerGettingBlowed( playerid ) ) return SendError( playerid, "You cannot use this command since you're getting blowed." ); + if ( IsPlayerBlowingCock( playerid ) ) return SendError( playerid, "You cannot use this command since you're giving oral sex." ); + if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); + if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); + if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); + if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command while in jail." ); + if ( IsPlayerTied( victimid ) ) return SendError( playerid, "Tazing a tied player is pretty useless, though you can use /untie for a harder job!" ); + if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." ); + if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); + if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); + if ( p_TazingImmunity[ victimid ] > g_iTime ) return SendError( playerid, "You must wait %d seconds before tazing this player.", p_TazingImmunity[ victimid ] - g_iTime ); + if ( random( 101 ) < 90 ) + { + GameTextForPlayer( victimid, "~n~~r~TAZED!", 2000, 4 ); + GameTextForPlayer( playerid, "~n~~y~~h~/cuff", 2000, 4 ); + SendClientMessageFormatted( victimid, -1, ""COL_RED"[TAZED]{FFFFFF} You have been tazed by %s(%d) for 5 seconds!", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[TAZED]{FFFFFF} You have tazed %s(%d) for 5 seconds!", ReturnPlayerName( victimid ), victimid ); + SetTimerEx( "Untaze", 5000, false, "dd", victimid, 6 ); + TogglePlayerControllable( victimid, 0 ); + ApplyAnimation( victimid, "CRACK", "crckdeth2", 5.0, 1, 1, 1, 0, 0 ); + p_Tazed{ victimid } = true; + } + else + { + SendClientMessageFormatted( playerid, -1, ""COL_RED"[TAZE FAIL]{FFFFFF} You have failed to taze %s(%d)!", ReturnPlayerName( victimid ), victimid ); + SendClientMessageFormatted( victimid, -1, ""COL_GREEN"[TAZE FAIL]{FFFFFF} %s(%d) has failed to taze you!", ReturnPlayerName( playerid ), playerid ); + } + p_TazingImmunity[ victimid ] = g_iTime + 6; + return 1; + } else { + return SendError( playerid, "There are no players around to taze." ); + } } CMD:ar( playerid, params[ ] ) return cmd_arrest(playerid, params); CMD:arrest( playerid, params[ ] ) { - new - victimid = GetClosestPlayer( playerid ); - - return ArrestPlayer( victimid, playerid ); + new victimid; + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); + else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); + else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/ar(rest) [PLAYER_ID]" ); + else if ( victimid == playerid ) return SendError( playerid, "You cannot arrest yourself." ); + else if ( !IsPlayerConnected( victimid ) ) return SendError( playerid, "This player is not connected." ); + else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); + else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) + { + if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); + if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); + if ( !IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is not cuffed." ); + if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); + if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." ); + if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is detained, you cannot arrest them." ); + if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); + if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot arrest this person inside a vehicle." ); + if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "You cannot arrest a person that is inside a vehicle." ); + if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); + if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); + new totalCash = ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( 300 ); + new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER ); + GivePlayerScore( playerid, 2 ); + GivePlayerExperience( playerid, E_POLICE ); + GivePlayerCash( playerid, totalCash ); + StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, totalCash, 0.1 ); + if ( totalCash > 20000 ) printf("[police arrest] %s -> %s - %s", ReturnPlayerName( playerid ), ReturnPlayerName( victimid ), cash_format( totalCash ) ); // 8hska7082bmahu + SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[ACHIEVE]{FFFFFF} You have earned "COL_GOLD"%s{FFFFFF} dollars and 2 score for arresting %s(%d)!", cash_format( totalCash ), ReturnPlayerName( victimid ), victimid ); + GameTextForPlayer( victimid, "~r~Busted!", 4000, 0 ); + CallLocalFunction( "OnPlayerArrested", "dddd", playerid, victimid, p_Arrests[ playerid ], 1 ); + Untaze( victimid, 6 ); + GivePlayerSeasonalXP( victimid, -20.0 ); + SendGlobalMessage( -1, ""COL_GOLD"[JAIL]{FFFFFF} %s(%d) has sent %s(%d) to jail for %d seconds!", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( victimid ), victimid, totalSeconds ); + JailPlayer( victimid, totalSeconds ); + return 1; + } + else return SendError( playerid, "There are no players around to arrest." ); } CMD:cuff( playerid, params[ ] ) { - new - victimid = GetClosestPlayer( playerid ); + new victimid; + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); + else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); + else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/cuff [PLAYER_ID]" ); + else if ( victimid == playerid ) return SendError( playerid, "You cannot cuff yourself." ); + else if ( !IsPlayerConnected( victimid ) || IsPlayerNPC( victimid ) ) return SendError( playerid, "This player is not connected." ); + else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); + else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) + { + if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); + if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); + if ( p_WantedLevel[ victimid ] < 6 ) return SendError( playerid, "This person isn't worth cuffing, ticket them." ); + if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "This player is in a vehicle " ); + if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." ); + if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is already detained." ); + if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); + if ( IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is already cuffed." ); + if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); + if ( !IsPlayerTazed( victimid ) ) return SendError( playerid, "You must taze this player before cuffing them." ); + if ( IsPlayerGettingBlowed( playerid ) ) return SendError( playerid, "You cannot use this command since you're getting blowed." ); + if ( IsPlayerBlowingCock( playerid ) ) return SendError( playerid, "You cannot use this command since you're giving oral sex." ); + if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); + if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); + if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); + if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." ); + if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); + if ( !IsPlayerSpawned( victimid ) ) return SendError( playerid, "The player must be spawned." ); - return CuffPlayer( victimid, playerid ); + GameTextForPlayer( victimid, "~n~~r~CUFFED!", 2000, 4 ); + GameTextForPlayer( playerid, "~n~~y~~h~/arrest", 2000, 4 ); + + SendClientMessageFormatted( victimid, -1, ""COL_RED"[CUFFED]{FFFFFF} You have been cuffed by %s(%d)!", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[CUFFED]{FFFFFF} You have cuffed %s(%d)!", ReturnPlayerName( victimid ), victimid ); + + p_Cuffed{ victimid } = true; + p_QuitToAvoidTimestamp[ victimid ] = g_iTime + 3; + SetPlayerAttachedObject( victimid, 2, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000 ); + SetPlayerSpecialAction( victimid, SPECIAL_ACTION_CUFFED ); + + KillTimer( p_CuffAbuseTimer[ victimid ] ); + p_CuffAbuseTimer[ victimid ] = SetTimerEx( "Uncuff", ( 60 * 1000 ), false, "d", victimid ); + return 1; + } + else return SendError( playerid, "There are no players around to cuff." ); } CMD:uncuff( playerid, params[ ] ) { - new victimid = GetClosestPlayer( playerid ); - //if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); + new victimid; if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/uncuff [PLAYER_ID]" ); + else if ( victimid == playerid ) return SendError( playerid, "You cannot uncuff yourself." ); else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) { - //if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player you're close to is in your team." ); if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); if ( !IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is not cuffed." ); if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); @@ -174,16 +251,16 @@ CMD:uncuff( playerid, params[ ] ) if ( IsPlayerTazed( playerid ) ) return SendError( playerid, "You cannot use this command since you're tazed." ); if ( IsPlayerCuffed( playerid ) ) return SendError( playerid, "You cannot use this command since you're cuffed." ); if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You cannot use this command since you're kidnapped." ); - //if ( IsPlayerDetained( playerid ) ) return SendError( playerid, "You cannot use this command since you're detained." ); + if ( IsPlayerDetained( playerid ) ) return SendError( playerid, "You cannot use this command since you're detained." ); SendClientMessageFormatted( victimid, -1, ""COL_RED"[UNCUFFED]{FFFFFF} You have been uncuffed by %s(%d)!", ReturnPlayerName( playerid ), playerid ); SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[UNCUFFED]{FFFFFF} You have uncuffed %s(%d)!", ReturnPlayerName( victimid ), victimid ); ClearAnimations( victimid ); TogglePlayerControllable( victimid, 1 ); p_Cuffed{ victimid } = false; - //p_Detained{ victimid } = false; - //Delete3DTextLabel( p_DetainedLabel[ victimid ] ); - //p_DetainedLabel[ victimid ] = Text3D: INVALID_3DTEXT_ID; - //p_DetainedBy[ victimid ] = INVALID_PLAYER_ID; + p_Detained{ victimid } = false; + Delete3DTextLabel( p_DetainedLabel[ victimid ] ); + p_DetainedLabel[ victimid ] = Text3D: INVALID_3DTEXT_ID; + p_DetainedBy[ victimid ] = INVALID_PLAYER_ID; KillTimer( p_CuffAbuseTimer[ victimid ] ); SetPlayerSpecialAction( victimid, SPECIAL_ACTION_NONE ); RemovePlayerAttachedObject( victimid, 2 ); @@ -192,12 +269,14 @@ CMD:uncuff( playerid, params[ ] ) return 1; } -/*CMD:detain( playerid, params[ ] ) +CMD:detain( playerid, params[ ] ) { - new victimid = GetClosestPlayer( playerid ); + new victimid; if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/detain [PLAYER_ID]" ); + else if ( victimid == playerid ) return SendError( playerid, "You cannot detain yourself." ); else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) { if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player you're close to is in your team." ); @@ -225,106 +304,9 @@ CMD:uncuff( playerid, params[ ] ) } else return SendError( playerid, "There are no players around to detain." ); return 1; -}*/ +} /* ** Functions ** */ -stock TazePlayer( victimid, playerid ) -{ - if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); - //else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/taze [PLAYER_ID]" ); - //else if ( victimid == playerid ) return SendError( playerid, "You cannot taze yourself." ); - else if ( !IsPlayerConnected( victimid ) ) return SendError( playerid, "There are no players around to taze." ); - else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); - else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 5.0 && IsPlayerConnected( victimid ) ) - { - if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); - if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); - if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "This player is in a vehicle " ); - if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); - if ( IsPlayerTazed( victimid ) ) return SendError( playerid, "This player is already tazed." ); - if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." ); - //if ( IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is already cuffed." ); - //if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is already detained." ); - if ( IsPlayerGettingBlowed( playerid ) ) return SendError( playerid, "You cannot use this command since you're getting blowed." ); - if ( IsPlayerBlowingCock( playerid ) ) return SendError( playerid, "You cannot use this command since you're giving oral sex." ); - if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); - if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); - if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); - if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); - if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command while in jail." ); - if ( IsPlayerTied( victimid ) ) return SendError( playerid, "Tazing a tied player is pretty useless, though you can use /untie for a harder job!" ); - if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." ); - if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); - if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); - if ( p_TazingImmunity[ victimid ] > g_iTime ) return SendError( playerid, "You must wait %d seconds before tazing this player.", p_TazingImmunity[ victimid ] - g_iTime ); - if ( random( 101 ) < 90 ) - { - GameTextForPlayer( victimid, "~n~~r~TAZED!", 2000, 4 ); - GameTextForPlayer( playerid, "~n~~y~~h~/cuff", 2000, 4 ); - SendClientMessageFormatted( victimid, -1, ""COL_RED"[TAZED]{FFFFFF} You have been tazed by %s(%d) for 3 seconds!", ReturnPlayerName( playerid ), playerid ); - SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[TAZED]{FFFFFF} You have tazed %s(%d) for 3 seconds!", ReturnPlayerName( victimid ), victimid ); - SetTimerEx( "Untaze", 2000, false, "dd", victimid, 6 ); // previous 3000 - TogglePlayerControllable( victimid, 0 ); - ApplyAnimation( victimid, "CRACK", "crckdeth2", 5.0, 1, 1, 1, 0, 0 ); - p_Tazed{ victimid } = true; - } - else - { - SendClientMessageFormatted( playerid, -1, ""COL_RED"[TAZE FAIL]{FFFFFF} You have failed to taze %s(%d)!", ReturnPlayerName( victimid ), victimid ); - SendClientMessageFormatted( victimid, -1, ""COL_GREEN"[TAZE FAIL]{FFFFFF} %s(%d) has failed to taze you!", ReturnPlayerName( playerid ), playerid ); - } - p_TazingImmunity[ victimid ] = g_iTime + 6; - return 1; - } else { - return SendError( playerid, "There are no players around to taze." ); - } -} - -stock ArrestPlayer( victimid, playerid ) -{ - if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); - else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); - //else if ( GetPlayerScore( playerid ) > 200 ) return SendError( playerid, "This feature is no longer available to you. Please use /detain." ); - // else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/ar(rest) [PLAYER_ID]" ); - // else if ( victimid == playerid ) return SendError( playerid, "You cannot arrest yourself." ); - else if ( !IsPlayerConnected( victimid ) ) return SendError( playerid, "This player is not connected." ); - else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); - else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) - { - if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); - if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); - if ( !IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is not cuffed." ); - if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); - if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." ); - //if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is detained, you cannot arrest them." ); - if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); - if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); - if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot arrest this person inside a vehicle." ); - if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "You cannot arrest a person that is inside a vehicle." ); - if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); - if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); - new totalCash = ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( 300 ); - new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER ); - GivePlayerScore( playerid, 2 ); - GivePlayerExperience( playerid, E_POLICE ); - GivePlayerCash( playerid, totalCash ); - StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, totalCash, 0.1 ); - if ( totalCash > 20000 ) printf("[police arrest] %s -> %s - %s", ReturnPlayerName( playerid ), ReturnPlayerName( victimid ), cash_format( totalCash ) ); // 8hska7082bmahu - SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[ACHIEVE]{FFFFFF} You have earned "COL_GOLD"%s{FFFFFF} dollars and 2 score for arresting %s(%d)!", cash_format( totalCash ), ReturnPlayerName( victimid ), victimid ); - GameTextForPlayer( victimid, "~r~Busted!", 4000, 0 ); - CallLocalFunction( "OnPlayerArrested", "dddd", playerid, victimid, p_Arrests[ playerid ], 1 ); - Untaze( victimid, 6 ); - GivePlayerSeasonalXP( victimid, -20.0 ); - SendGlobalMessage( -1, ""COL_GOLD"[JAIL]{FFFFFF} %s(%d) has sent %s(%d) to jail for %d seconds!", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( victimid ), victimid, totalSeconds ); - JailPlayer( victimid, totalSeconds ); - KillTimer( p_AwaitingBCAttemptTimer[ victimid ] ); - return 1; - } - else return SendError( playerid, "There are no players around to arrest." ); -} - stock AwardArrest( victimid, playerid ) { p_QuitToAvoidTimestamp[ playerid ] = 0; @@ -343,67 +325,6 @@ stock AwardArrest( victimid, playerid ) return 1; } -stock CuffPlayer( victimid, playerid ) -{ - if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); - else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); - //else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/cuff [PLAYER_ID]" ); - //else if ( victimid == playerid ) return SendError( playerid, "You cannot cuff yourself." ); - else if ( !IsPlayerConnected( victimid ) || IsPlayerNPC( victimid ) ) return SendError( playerid, "This player is not connected." ); - else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); - else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) - { - if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); - if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); - if ( p_WantedLevel[ victimid ] < 6 ) return SendError( playerid, "This person isn't worth cuffing, ticket them." ); - if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "This player is in a vehicle " ); - if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." ); - //if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is already detained." ); - if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); - if ( IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is already cuffed." ); - if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); - if ( !IsPlayerTazed( victimid ) ) return SendError( playerid, "You must taze this player before cuffing them." ); - if ( IsPlayerGettingBlowed( playerid ) ) return SendError( playerid, "You cannot use this command since you're getting blowed." ); - if ( IsPlayerBlowingCock( playerid ) ) return SendError( playerid, "You cannot use this command since you're giving oral sex." ); - if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); - if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); - if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); - if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); - if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." ); - if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); - if ( !IsPlayerSpawned( victimid ) ) return SendError( playerid, "The player must be spawned." ); - - if ( !BreakPlayerCuffs( victimid ) ) - { - GameTextForPlayer( victimid, "~n~~r~CUFFED!", 2000, 4 ); - GameTextForPlayer( playerid, "~n~~y~~h~/arrest", 2000, 4 ); - - SendClientMessageFormatted( victimid, -1, ""COL_RED"[CUFFED]{FFFFFF} You have been cuffed by %s(%d)!", ReturnPlayerName( playerid ), playerid ); - SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[CUFFED]{FFFFFF} You have cuffed %s(%d)!", ReturnPlayerName( victimid ), victimid ); - - p_Cuffed{ victimid } = true; - p_QuitToAvoidTimestamp[ victimid ] = g_iTime + 3; - SetPlayerAttachedObject( victimid, 2, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000 ); - SetPlayerSpecialAction( victimid, SPECIAL_ACTION_CUFFED ); - - KillTimer( p_CuffAbuseTimer[ victimid ] ); - p_CuffAbuseTimer[ victimid ] = SetTimerEx( "Uncuff", ( 60 * 1000 ), false, "d", victimid ); - - p_AwaitingBCAttempt{ victimid } = true; - - KillTimer( p_AwaitingBCAttemptTimer[ victimid ] ); - p_AwaitingBCAttemptTimer[ victimid ] = SetTimerEx( "BreakPlayerCuffsAttempt", 3000, false, "d", victimid ); - } - else - { - SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[CUFFED]{FFFFFF} %s(%d) just broke their cuffs off!", ReturnPlayerName( victimid ), victimid ); - } - return 1; - } - else return SendError( playerid, "There are no players around to cuff." ); -} - function Untaze( playerid, taze_immunity_seconds ) { if ( !IsPlayerConnected( playerid ) || !p_Tazed{ playerid } ) // || p_Detained{ playerid } == true @@ -434,10 +355,10 @@ function Uncuff( playerid ) ClearAnimations( playerid ); } p_Cuffed{ playerid } = false; - //p_Detained{ playerid } = false; - //Delete3DTextLabel( p_DetainedLabel[ playerid ] ); - //p_DetainedLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; - //p_DetainedBy[ playerid ] = INVALID_PLAYER_ID; + p_Detained{ playerid } = false; + Delete3DTextLabel( p_DetainedLabel[ playerid ] ); + p_DetainedLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; + p_DetainedBy[ playerid ] = INVALID_PLAYER_ID; p_BulletInvulnerbility[ playerid ] = g_iTime + 5; SendGlobalMessage( -1, ""COL_GREY"[SERVER]{FFFFFF} %s(%d) has been uncuffed and undetained by the anti-abuse system.", ReturnPlayerName( playerid ), playerid ); @@ -455,8 +376,6 @@ stock BreakPlayerCuffs( playerid ) } else p_BobbyPins[ playerid ] --; - if ( p_AwaitingBCAttempt{ playerid } ) p_AwaitingBCAttempt{ playerid } = false; - new probability = 75; // success rate probability if ( random( 101 ) <= probability ) @@ -488,9 +407,6 @@ stock BreakPlayerCuffs( playerid ) else { SendServerMessage( playerid, "You have snapped your bobby pin and failed to break out of your cuffs. Re-attempting in 3 seconds." ); - p_AwaitingBCAttempt{ playerid } = true; - KillTimer( p_AwaitingBCAttemptTimer[ playerid ] ); - p_AwaitingBCAttemptTimer[ playerid ] = SetTimerEx( "BreakPlayerCuffsAttempt", 3000, false, "d", playerid ); return false; } } diff --git a/gamemodes/irresistible/cnr/features/cop/jail.pwn b/gamemodes/irresistible/cnr/features/cop/jail.pwn index 3ac22dd..8ff6a60 100644 --- a/gamemodes/irresistible/cnr/features/cop/jail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/jail.pwn @@ -67,7 +67,7 @@ hook OnPlayerUpdateEx( playerid ) if ( IsPlayerInDynamicArea( playerid, g_AlcatrazArea ) ) { - if ( !IsPlayerJailed( playerid ) && p_Class[ playerid ] != CLASS_POLICE ) // && !IsPlayerDetained( playerid ) + if ( !IsPlayerJailed( playerid ) && p_Class[ playerid ] != CLASS_POLICE && !IsPlayerDetained( playerid ) ) { if ( GetPVarInt( playerid, "AlcatrazWantedCD" ) < g_iTime ) { diff --git a/gamemodes/irresistible/cnr/features/cop/ticket.pwn b/gamemodes/irresistible/cnr/features/cop/ticket.pwn index 5ab5fbb..3de1587 100644 --- a/gamemodes/irresistible/cnr/features/cop/ticket.pwn +++ b/gamemodes/irresistible/cnr/features/cop/ticket.pwn @@ -116,7 +116,7 @@ stock TicketPlayer( pID, playerid ) else if ( p_WantedLevel[ pID ] > 5 ) return SendError( playerid, "Wanted suspects cannot be issued a ticket." ); else if ( p_WantedLevel[ pID ] < 1 ) return SendError( playerid, "Innocent players cannot be issued a ticket." ); else if ( p_Jailed{ playerid } ) return SendError( playerid, "You cannot use this command in jail." ); - //else if ( IsPlayerDetained( pID ) ) return SendError( playerid, "You cannot use this command on a detained player." ); + else if ( IsPlayerDetained( pID ) ) return SendError( playerid, "You cannot use this command on a detained player." ); else if ( g_iTime < p_TicketTimestamp[ pID ] ) return SendError( playerid, "This player has been ticketed recently, he will be fined in %d seconds.", g_iTime - p_TicketTimestamp[ pID ] ); else { diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 142fbdc..82526f1 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -146,9 +146,9 @@ new p_HouseCrackingPW [ MAX_PLAYERS ], p_Burglaries [ MAX_PLAYERS ], p_ArmyBanned [ MAX_PLAYERS char ], - //Text3D: p_DetainedLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... }, - //bool: p_Detained [ MAX_PLAYERS char ], - //p_DetainedBy [ MAX_PLAYERS ], + Text3D: p_DetainedLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... }, + bool: p_Detained [ MAX_PLAYERS char ], + p_DetainedBy [ MAX_PLAYERS ], p_BailTimestamp [ MAX_PLAYERS ], p_AFKTime [ MAX_PLAYERS ], bool: p_ClassSelection [ MAX_PLAYERS char ], diff --git a/gamemodes/irresistible/cnr/textdraws.pwn b/gamemodes/irresistible/cnr/textdraws.pwn index c263eb6..5baa95f 100644 --- a/gamemodes/irresistible/cnr/textdraws.pwn +++ b/gamemodes/irresistible/cnr/textdraws.pwn @@ -42,8 +42,6 @@ new /* ** Hooks ** */ hook OnScriptInit( ) { - TextDrawSetString( g_MotdTD, "~w~Want more ~g~money, houses, and xp~w~? Consider donating! ~y~/vip" ); - g_currentXPTD = TextDrawCreate(529.000000, 405.000000, "Current XP"); TextDrawBackgroundColor(g_currentXPTD, 255); TextDrawFont(g_currentXPTD, 3); @@ -137,6 +135,7 @@ hook OnScriptInit( ) TextDrawColor(g_MotdTD, -1); TextDrawSetOutline(g_MotdTD, 1); TextDrawSetProportional(g_MotdTD, 1); + TextDrawSetString( g_MotdTD, "~w~Want more ~g~money~w~, ~r~houses~w~, and ~b~xp~w~? Consider donating! ~y~/vip" ); g_ObjectLoadTD = TextDrawCreate(320.000000, 148.000000, "Loading Objects...~n~Please Wait..."); TextDrawAlignment(g_ObjectLoadTD, 2); diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index a40f0ee..a3dc8a1 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -3,7 +3,7 @@ * San Fierro: Cops and Robbers * * Original Creator: Lorenc_ - * Contributors: Stev + * Contributors: Damen, Stev * * Thanks to: y_less/zeex/Frosha/Incognito/SA-MP team * @@ -16,7 +16,7 @@ #pragma option -d3 #pragma dynamic 7200000 -//#define DEBUG_MODE +#define DEBUG_MODE #if defined DEBUG_MODE #pragma option -d3 @@ -478,7 +478,7 @@ public OnPlayerDisconnect( playerid, reason ) CutSpectation( playerid ); LeavePlayerPaintball( playerid ); RemovePlayerFromRace( playerid ); - //p_Detained { playerid } = false; + p_Detained { playerid } = false; p_Tied { playerid } = false; p_Kidnapped { playerid } = false; p_Wood [ playerid ] = 0; @@ -531,7 +531,7 @@ public OnPlayerDisconnect( playerid, reason ) p_PmResponder [ playerid ] = INVALID_PLAYER_ID; p_ViewingStats [ playerid ] = INVALID_PLAYER_ID; p_Spectating { playerid } = false; - //p_DetainedBy [ playerid ] = INVALID_PLAYER_ID; + p_DetainedBy [ playerid ] = INVALID_PLAYER_ID; p_GangID [ playerid ] = INVALID_GANG_ID; p_InfectedHIV { playerid } = false; p_OwnedHouses [ playerid ] = 0; @@ -585,8 +585,8 @@ public OnPlayerDisconnect( playerid, reason ) p_AntiTextSpamCount{ playerid } = 0; Delete3DTextLabel( p_AdminLabel[ playerid ] ); p_AdminLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; - //Delete3DTextLabel( p_DetainedLabel[ playerid ] ); - //p_DetainedLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; + Delete3DTextLabel( p_DetainedLabel[ playerid ] ); + p_DetainedLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; Delete3DTextLabel( p_TiedLabel[ playerid ] ); p_TiedLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; DestroyDynamic3DTextLabel( p_WeedLabel[ playerid ] ); @@ -7091,6 +7091,11 @@ stock IsPlayerInArmyVehicle( playerid ) return false; } +stock IsPlayerDetained( playerid ) +{ + return p_Detained{ playerid }; +} + new playersPeakCount = 0; stock UpdatePlayerCounters()