From c07b0e362d63e1ed9cb06d3a8280f89d4384b488 Mon Sep 17 00:00:00 2001 From: Damen Date: Thu, 4 Apr 2019 01:20:00 -0400 Subject: [PATCH] Removes Passive Mode, Creates Health Check when Arresting, and Adjusts Below Sea Level Value - Removes Passive Mode from the game, while keeping the Spawn Kill Protection. - Creates a Health Check on the Victim when attempted to be affected by a LEO command (taze, cuff, arrest) - Adjusts the value return of 'IsPlayerBelowSeaLevel' to ensure that you can still use vehicle commands when the waves flow around. --- gamemodes/irresistible/cnr/dialog_ids.pwn | 1 - .../irresistible/cnr/features/_features.pwn | 2 +- .../cnr/features/anti-spawn_kill.pwn | 68 +++++++++++++++++++ .../features/battleroyale/battleroyale.pwn | 2 - .../cnr/features/business/business.pwn | 7 -- gamemodes/irresistible/cnr/features/c4.pwn | 1 - .../irresistible/cnr/features/cop/arrest.pwn | 7 +- .../irresistible/cnr/features/damage_feed.pwn | 3 - .../irresistible/cnr/features/gangs/turfs.pwn | 2 +- .../cnr/features/player/player_settings.pwn | 43 +----------- .../irresistible/cnr/features/random_hits.pwn | 2 +- .../cnr/features/random_messages.pwn | 1 - .../irresistible/cnr/features/weapon_drop.pwn | 4 -- gamemodes/irresistible/cnr/player.pwn | 5 +- gamemodes/irresistible/cnr/textdraws.pwn | 8 --- gamemodes/irresistible/cnr/wanted_level.pwn | 11 --- .../cnr/20190401_cnr_remove_passive_mode.sql | 7 ++ gamemodes/sf-cnr.pwn | 62 ++--------------- 18 files changed, 93 insertions(+), 143 deletions(-) create mode 100644 gamemodes/irresistible/cnr/features/anti-spawn_kill.pwn create mode 100644 gamemodes/irresistible/config/migrations/cnr/20190401_cnr_remove_passive_mode.sql diff --git a/gamemodes/irresistible/cnr/dialog_ids.pwn b/gamemodes/irresistible/cnr/dialog_ids.pwn index 674178b..5638974 100644 --- a/gamemodes/irresistible/cnr/dialog_ids.pwn +++ b/gamemodes/irresistible/cnr/dialog_ids.pwn @@ -210,7 +210,6 @@ #define DIALOG_COMPONENTS_SELL 1200 #define DIALOG_HOUSE_SELL 1201 #define DIALOG_BUSINESS_SELL_CONFIRM 1202 -//#define DIALOG_PASSIVE_MODE 1203 #define DIALOG_NEXT_PAGE_VIP 1204 /* ** Hooks ** */ diff --git a/gamemodes/irresistible/cnr/features/_features.pwn b/gamemodes/irresistible/cnr/features/_features.pwn index 37a556d..9c33039 100644 --- a/gamemodes/irresistible/cnr/features/_features.pwn +++ b/gamemodes/irresistible/cnr/features/_features.pwn @@ -31,7 +31,7 @@ #include "irresistible\cnr\features\ammunation.pwn" #include "irresistible\cnr\features\game_day.pwn" #include "irresistible\cnr\features\movie_mode.pwn" -#include "irresistible\cnr\features\passive_mode.pwn" +#include "irresistible\cnr\features\anti-spawn_kill.pwn" #include "irresistible\cnr\features\server_rules.pwn" #include "irresistible\cnr\features\toys.pwn" #include "irresistible\cnr\features\fps.pwn" diff --git a/gamemodes/irresistible/cnr/features/anti-spawn_kill.pwn b/gamemodes/irresistible/cnr/features/anti-spawn_kill.pwn new file mode 100644 index 0000000..364235e --- /dev/null +++ b/gamemodes/irresistible/cnr/features/anti-spawn_kill.pwn @@ -0,0 +1,68 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Lorenc - adjusted by Damen to remove passive mode + * Module: cnr\features\anti-spawn_kill.pwn + * Purpose: anti-spawn kill + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Variables ** */ +static stock + Text3D: p_SpawnKillLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... }, + p_AntiSpawnKill [ MAX_PLAYERS ], + bool: p_AntiSpawnKillEnabled [ MAX_PLAYERS char ] +; + +/* ** Hooks ** */ +hook OnPlayerUpdateEx( playerid ) +{ + // Remove Anti-Spawn Kill + if ( p_AntiSpawnKillEnabled{ playerid } && g_iTime > p_AntiSpawnKill[ playerid ] ) { + DisablePlayerSpawnProtection( playerid ); + } + return 1; +} + +hook OnPlayerSpawn( playerid ) +{ + if ( ! IsPlayerInPaintBall( playerid ) ) + { + // Toggle Anti Spawn Kill + DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } ); + SetPlayerHealth( playerid, INVALID_PLAYER_ID ); + Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); + p_SpawnKillLabel[ playerid ] = Create3DTextLabel( "Spawn Protected!", COLOR_GOLD, 0.0, 0.0, 0.0, 15.0, 0 ); + p_AntiSpawnKill[ playerid ] = g_iTime + 15; + Attach3DTextLabelToPlayer( p_SpawnKillLabel[ playerid ], playerid, 0.0, 0.0, 0.3 ); + p_AntiSpawnKillEnabled{ playerid } = true; + } + return 1; +} + +hook OnPlayerDisconnect( playerid, reason ) +{ + Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); + p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; + p_AntiSpawnKillEnabled{ playerid } = false; + return 1; +} + +/* ** Functions ** */ +stock DisablePlayerSpawnProtection( playerid, Float: default_health = 100.0 ) +{ + if ( p_AntiSpawnKillEnabled{ playerid } ) + { + SetPlayerHealth( playerid, p_AdminOnDuty{ playerid } ? float( INVALID_PLAYER_ID ) : default_health ); + DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } ); + Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); + p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; + p_AntiSpawnKillEnabled{ playerid } = false; + } + return 1; +} + +stock IsPlayerSpawnProtected( playerid ) { + return p_AntiSpawnKillEnabled{ playerid }; +} \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn b/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn index 5e4721c..0d029b6 100644 --- a/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn +++ b/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn @@ -320,7 +320,6 @@ hook SetPlayerRandomSpawn( playerid ) SetPlayerPos( playerid, X, Y, Z - 2.0 ); SetPlayerVirtualWorld( playerid, BR_GetWorld( lobbyid ) ); - ResetPlayerPassiveMode( playerid, true ); DisablePlayerSpawnProtection( playerid, .default_health = br_lobbyData[ lobbyid ] [ E_HEALTH ] ); SetPlayerHealth( playerid, br_lobbyData[ lobbyid ] [ E_HEALTH ] ); @@ -822,7 +821,6 @@ static stock BattleRoyale_RespawnPlayer( playerid ) SetPlayerPos( playerid, BR_CHECKPOINT_POS[ 0 ], BR_CHECKPOINT_POS[ 1 ], BR_CHECKPOINT_POS[ 2 ] ); SetPlayerVirtualWorld( playerid, 0 ); SetPlayerInterior( playerid, 0 ); - SetPlayerPassiveMode( playerid ); // reset the respawn variable p_waitingForRespawn{ playerid } = false; diff --git a/gamemodes/irresistible/cnr/features/business/business.pwn b/gamemodes/irresistible/cnr/features/business/business.pwn index 26f6158..f3dd31f 100644 --- a/gamemodes/irresistible/cnr/features/business/business.pwn +++ b/gamemodes/irresistible/cnr/features/business/business.pwn @@ -506,13 +506,6 @@ hook OnPlayerDriveVehicle( playerid, vehicleid ) { if ( g_isBusinessVehicle[ vehicleid ] != -1 && Iter_Contains( business, g_isBusinessVehicle[ vehicleid ] ) ) { - if ( IsPlayerPassive( playerid ) ) - { - ShowPlayerHelpDialog( playerid, 2000, "Passive players cannot enter business vehicles." ); - SyncObject( playerid ); - return 1; - } - new businessid = g_isBusinessVehicle[ vehicleid ]; diff --git a/gamemodes/irresistible/cnr/features/c4.pwn b/gamemodes/irresistible/cnr/features/c4.pwn index d3afd9a..fed9bd2 100644 --- a/gamemodes/irresistible/cnr/features/c4.pwn +++ b/gamemodes/irresistible/cnr/features/c4.pwn @@ -174,7 +174,6 @@ CMD:c4( playerid, params[ ] ) if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You cannot use this command since you're kidnapped." ); if ( IsPlayerInCasino( playerid ) ) return SendError( playerid, "You cannot use this command since you're in a casino." ); if ( IsPlayerInPaintBall( playerid ) || IsPlayerDueling( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an arena." ); - if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as an innocent player in passive mode." ); if ( p_C4Amount[ playerid ] < 1 ) return SendError( playerid, "You don't have any C4's" ); #if defined __cnr__chuffsec diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 4f40050..d816356 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -243,6 +243,7 @@ stock TazePlayer( victimid, playerid ) 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 ( ReturnPlayerHealth( victimid ) <= 0.0 ) 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." ); @@ -296,6 +297,7 @@ stock ArrestPlayer( victimid, playerid ) 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 ( ReturnPlayerHealth( victimid ) <= 0.0 ) 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." ); @@ -356,6 +358,7 @@ stock CuffPlayer( victimid, playerid ) 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 ( ReturnPlayerHealth( victimid ) <= 0.0 ) 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." ); @@ -443,7 +446,7 @@ function Uncuff( playerid ) stock BreakPlayerCuffs( playerid ) { - if ( !IsPlayerConnected( playerid ) ) return false; + if ( !IsPlayerConnected( playerid ) || ReturnPlayerHealth( playerid ) <= 0 ) return false; if ( p_BobbyPins[ playerid ] < 1 ) { @@ -496,7 +499,7 @@ function BreakPlayerCuffsAttempt( playerid ) return BreakPlayerCuffs( playerid ) stock AwardNearestLEO( playerid, reason ) { - if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 ) + if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 ) return false; new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker. diff --git a/gamemodes/irresistible/cnr/features/damage_feed.pwn b/gamemodes/irresistible/cnr/features/damage_feed.pwn index 78f9cfd..d45080d 100644 --- a/gamemodes/irresistible/cnr/features/damage_feed.pwn +++ b/gamemodes/irresistible/cnr/features/damage_feed.pwn @@ -565,9 +565,6 @@ CMD:sync( playerid, params[ ] ) if ( GetPlayerWeapon( playerid ) == WEAPON_SNIPER ) return SendError( playerid, "You cannot synchronize yourself holding a sniper." ); - if ( IsPlayerPassive( playerid ) ) - return SendError( playerid, "You cannot use this feature while in passive mode." ); - if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); diff --git a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn index 98e9f9e..7d0e88a 100644 --- a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn @@ -545,7 +545,7 @@ stock Turf_IsAbleToTakeover( i ) { Float: Z; GetPlayerPos( i, Z, Z, Z ); - return p_Class[ i ] == CLASS_CIVILIAN && ! IsPlayerSpawnProtected( i ) && ! IsPlayerPassive( i ) && ! IsPlayerAdminOnDuty( i ) && GetPlayerState( i ) != PLAYER_STATE_SPECTATING && ! IsPlayerAFK( i ) && Z <= 250.0; + return p_Class[ i ] == CLASS_CIVILIAN && ! IsPlayerSpawnProtected( i ) && ! IsPlayerAdminOnDuty( i ) && GetPlayerState( i ) != PLAYER_STATE_SPECTATING && ! IsPlayerAFK( i ) && Z <= 250.0; } stock Turf_HideAllGangZones( playerid ) diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index d1170c4..fed63e4 100644 --- a/gamemodes/irresistible/cnr/features/player/player_settings.pwn +++ b/gamemodes/irresistible/cnr/features/player/player_settings.pwn @@ -9,7 +9,7 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define MAX_SETTINGS ( 13 ) +#define MAX_SETTINGS ( 12 ) #define SETTING_BAILOFFERS ( 0 ) #define SETTING_EVENT_TP ( 1 ) @@ -23,14 +23,13 @@ #define SETTING_COINS_BAR ( 9 ) #define SETTING_TOP_DONOR ( 10 ) #define SETTING_WEAPON_PICKUP ( 11 ) -#define SETTING_PASSIVE_MODE ( 12 ) /* ** Variables ** */ static stock g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = { { "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" }, { "Display User ID In Chat" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" }, - { "Manual Pickup Weapon" }, { "Prevent Passive Mode" } + { "Manual Pickup Weapon" } }, bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ] ; @@ -38,7 +37,6 @@ static stock /* ** Hooks ** */ hook OnPlayerRegister( playerid ) { - TogglePlayerSetting( playerid, SETTING_PASSIVE_MODE, true ); // remove passive mode by default return 1; } @@ -74,10 +72,6 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) HidePlayerTogglableTextdraws( playerid, .force = false ); ShowPlayerTogglableTextdraws( playerid, .force = false ); } - - /*else if ( settingid == SETTING_PASSIVE_MODE ) { - ResetPlayerPassiveMode( playerid, .passive_disabled = true ); // avoid abusing - }*/ } else // setting is not being toggled { @@ -85,9 +79,6 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) HidePlayerTogglableTextdraws( playerid, .force = false ); ShowPlayerTogglableTextdraws( playerid, .force = false ); } - /*else if ( settingid == SETTING_PASSIVE_MODE ) { - ResetPlayerPassiveMode( playerid, .passive_disabled = true ); // avoid abusing - }*/ } TogglePlayerSetting( playerid, settingid, ! p_PlayerSettings[ playerid ] { settingid } ); @@ -165,36 +156,6 @@ CMD:controlpanel( playerid, params[ ] ) return 1; } -CMD:rpmode( playerid, params[ ] ) return cmd_passive( playerid, params ); -CMD:passivemode( playerid, params[ ] ) return cmd_passive( playerid, params ); -CMD:passive( playerid, params[ ] ) -{ - CallLocalFunction( "OnDialogResponse", "dddds", playerid, DIALOG_CP_MENU, 1, SETTING_PASSIVE_MODE + 1, "ignore" ); // cunning way - return 1; -} - -CMD:passivelist( playerid, params[ ] ) -{ - new - count = 0; - - szBigString[ 0 ] = '\0'; - - foreach ( new i : Player ) - { - if ( IsPlayerPassive( i ) ) - { - format( szBigString, sizeof( szBigString ), "%s%s(%d)\n", szBigString, ReturnPlayerName( i ), i ); - count ++; - } - } - - if ( count == 0 ) - return SendError( playerid, "There is currently no players in passive mode." ); - else - return ShowPlayerDialog(playerid, DIALOG_NULL, DIALOG_STYLE_LIST, ""COL_WHITE"Passive List", szBigString, "Close", "" ), 1; -} - /* ** Functions ** */ static stock ShowPlayerTogglableTextdraws( playerid, bool: force = false ) { diff --git a/gamemodes/irresistible/cnr/features/random_hits.pwn b/gamemodes/irresistible/cnr/features/random_hits.pwn index 8c467ef..0d74c8d 100644 --- a/gamemodes/irresistible/cnr/features/random_hits.pwn +++ b/gamemodes/irresistible/cnr/features/random_hits.pwn @@ -30,7 +30,7 @@ hook OnServerGameDayEnd( ) for ( new playerid = 0; playerid < sizeof( ignored_players ); playerid ++ ) { // remove unconnected / npcs / aod / low score - if ( ! IsPlayerConnected( playerid ) || IsPlayerNPC( playerid ) || IsPlayerAdminOnDuty( playerid ) || GetPlayerScore( playerid ) < 25 || IsPlayerAFK( playerid ) || IsPlayerPassive( playerid ) ) + if ( ! IsPlayerConnected( playerid ) || IsPlayerNPC( playerid ) || IsPlayerAdminOnDuty( playerid ) || GetPlayerScore( playerid ) < 25 || IsPlayerAFK( playerid ) ) { ignored_players[ playerid ] = playerid; continue; diff --git a/gamemodes/irresistible/cnr/features/random_messages.pwn b/gamemodes/irresistible/cnr/features/random_messages.pwn index 39f809f..dbdbc28 100644 --- a/gamemodes/irresistible/cnr/features/random_messages.pwn +++ b/gamemodes/irresistible/cnr/features/random_messages.pwn @@ -68,7 +68,6 @@ static stock { "{8ADE47}Stephanie:"COL_WHITE" Race your friends in a street race or outrun race by using "COL_GREY"/race"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" }, { "{8ADE47}Stephanie:"COL_WHITE" Contribute to our feature "COL_GREY"/crowdfunds"COL_WHITE"! Early supporters get benefits!" }, - { "{8ADE47}Stephanie:"COL_WHITE" Don't want to be interrupted as an innocent player? Enter passive mode with "COL_GREY"/passive"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" You can buy premium player homes using "COL_GREY"/estate"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" You can buy Irresistible Coins from players using "COL_GREY"/ic buy"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" Buy a secure wallet to reduce the amount of money you drop when you die!" } diff --git a/gamemodes/irresistible/cnr/features/weapon_drop.pwn b/gamemodes/irresistible/cnr/features/weapon_drop.pwn index ffb0440..b671dd3 100644 --- a/gamemodes/irresistible/cnr/features/weapon_drop.pwn +++ b/gamemodes/irresistible/cnr/features/weapon_drop.pwn @@ -146,10 +146,6 @@ hook OnPlayerPickUpDynPickup( playerid, pickupid ) { if ( g_weaponDropData[ dropid ] [ E_PICKUP ] == pickupid ) { - // if player is in passive mode cannot pickup weapons, ammo - if ( IsPlayerPassive( playerid ) ) - return ShowPlayerHelpDialog( playerid, 2500, "You cannot pick up dropped items in ~r~passive mode." ); - if ( g_weaponDropData[ dropid ] [ E_WEAPON_ID ] == WEAPON_HEALTH ) { new diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 87b0d0e..88f36fe 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -203,10 +203,7 @@ new p_TazingImmunity [ MAX_PLAYERS ], p_PlayerAltBind [ MAX_PLAYERS ] = { -1, ... }, p_PlayerAltBindTick [ MAX_PLAYERS ], - p_AimedAtPolice [ MAX_PLAYERS ], - bool: p_PassiveModeDisabled [ MAX_PLAYERS char ], - //p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... }, - Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID } + p_AimedAtPolice [ MAX_PLAYERS ] ; /* ** Getters And Setters** */ diff --git a/gamemodes/irresistible/cnr/textdraws.pwn b/gamemodes/irresistible/cnr/textdraws.pwn index 0072f8d..b25ee89 100644 --- a/gamemodes/irresistible/cnr/textdraws.pwn +++ b/gamemodes/irresistible/cnr/textdraws.pwn @@ -16,7 +16,6 @@ new Text: g_AchievementTD [ 4 ] = { Text: INVALID_TEXT_DRAW, ... }, Text: g_AdminLogTD = Text: INVALID_TEXT_DRAW, Text: g_AdminOnDutyTD = Text: INVALID_TEXT_DRAW, - Text: g_PassiveModeTD = Text: INVALID_TEXT_DRAW, Text: g_DoubleXPTD = Text: INVALID_TEXT_DRAW, Text: g_currentXPTD = Text: INVALID_TEXT_DRAW, Text: g_CurrentRankTD = Text: INVALID_TEXT_DRAW, @@ -166,13 +165,6 @@ hook OnScriptInit( ) TextDrawSetOutline(g_AdminOnDutyTD, 1); TextDrawSetProportional(g_AdminOnDutyTD, 1); - g_PassiveModeTD = TextDrawCreate(555.000000, 66.500000, "PASSIVE MODE" ); - TextDrawBackgroundColor(g_PassiveModeTD, 255); - TextDrawFont(g_PassiveModeTD, 1); - TextDrawLetterSize(g_PassiveModeTD, 0.180000, 0.899999); - TextDrawColor(g_PassiveModeTD, COLOR_GREEN); - TextDrawSetOutline(g_PassiveModeTD, 1); - TextDrawSetProportional(g_PassiveModeTD, 1); return Y_HOOKS_CONTINUE_RETURN_1; } diff --git a/gamemodes/irresistible/cnr/wanted_level.pwn b/gamemodes/irresistible/cnr/wanted_level.pwn index 0ef8f17..16bf0c2 100644 --- a/gamemodes/irresistible/cnr/wanted_level.pwn +++ b/gamemodes/irresistible/cnr/wanted_level.pwn @@ -47,14 +47,8 @@ stock CNR_SetPlayerWantedLevel( playerid, level ) { PlayerTextDrawSetString( playerid, p_WantedLevelTD[ playerid ], sprintf( "] %d ]", p_WantedLevel[ playerid ] ) ); if ( ! IsPlayerMovieMode( playerid ) ) PlayerTextDrawShow( playerid, p_WantedLevelTD[ playerid ] ); - ResetPlayerPassiveMode( playerid, .passive_disabled = true ); // remove passive mode if the player is wanted } } - else if ( IsPlayerInAnyVehicle( playerid ) ) - { - new vehicleID = GetPlayerVehicleID( playerid ); - GivePassivePassengersWanted( playerid, vehicleID ); - } else { PlayerTextDrawHide( playerid, p_WantedLevelTD[ playerid ] ); @@ -81,11 +75,6 @@ stock GivePlayerWantedLevel( playerid, level ) { if ( ! IsPlayerConnected( playerid ) || IsPlayerNPC( playerid ) || IsPlayerJailed( playerid ) || IsPlayerDueling( playerid ) || level == 0 ) return 0; - else if ( IsPlayerInAnyVehicle( playerid ) ) - { - new vehicleID = GetPlayerVehicleID( playerid ); - GivePassivePassengersWanted( playerid, vehicleID ); - } new current_wanted = GetPlayerWantedLevel( playerid ); diff --git a/gamemodes/irresistible/config/migrations/cnr/20190401_cnr_remove_passive_mode.sql b/gamemodes/irresistible/config/migrations/cnr/20190401_cnr_remove_passive_mode.sql new file mode 100644 index 0000000..663027f --- /dev/null +++ b/gamemodes/irresistible/config/migrations/cnr/20190401_cnr_remove_passive_mode.sql @@ -0,0 +1,7 @@ +-- CREATE A MIGRATION ENTRY +INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190401_cnr_remove_passive_mode'); + +-- BEGIN + +-- -- REMOVE PASSIVE MODE SETTING +DELETE FROM `SETTINGS` WHERE SETTING_ID = 12; \ No newline at end of file diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 35bca08..bc1e794 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -931,10 +931,6 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: return ShowPlayerHelpDialog( playerid, 2000, "You cannot damage an innocent player's vehicle unless they have wanted players alongside them!" ), 0; } - - // Passive Players can't damage normal players vehicles - if ( IsPlayerPassive( playerid ) ) - return 0; } } } @@ -1060,10 +1056,6 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( p_Class[ playerid ] == CLASS_POLICE && IsPlayerInAnyVehicle( playerid ) && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 432 ) return 0; - // Passive players cannot damage with vehicles - if ( IsPlayerPassive( issuerid ) && IsPlayerInAnyVehicle( issuerid ) ) - return 0; - // Anti RDM and gang member damage if ( ! IsPlayerInEvent( playerid ) && ! IsPlayerInPaintBall( playerid ) && ! IsPlayerBoxing( playerid ) && ! IsPlayerDueling( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) { @@ -1071,19 +1063,6 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage your homies!" ), 0; } - // Passive mode enabled for player? - if ( IsPlayerPassive( issuerid ) ) { - /*if ( p_PassiveModeExpireTimer[ issuerid ] == -1 ) { - p_PassiveModeExpireTimer[ issuerid ] = PassiveMode_Reset( issuerid, 4 ); // it will just set it to anything but -1 for now - }*/ - return ShowPlayerHelpDialog( issuerid, 2000, "~r~You cannot deathmatch with /passive enabled." ), 0; - } - - // Passive mode enabled for damaged id? - if ( IsPlayerPassive( playerid ) ) { - return ShowPlayerHelpDialog( issuerid, 2000, "This player has passive mode ~g~enabled." ), 0; - } - // Anti Random Deathmatch if ( IsRandomDeathmatch( issuerid, playerid ) ) { return ShowPlayerHelpDialog( issuerid, 2000, "This player cannot be ~r~random deathmatched." ), 0; @@ -2013,8 +1992,6 @@ CMD:robitems( playerid, params[ ] ) else if ( IsPlayerBlowingCock( playerid ) ) return SendError( playerid, "You cannot use this command since you're giving oral sex." ); else if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); - else if ( IsPlayerPassive( victimid ) ) return SendError( playerid, "You cannot use this command on passive mode players." ); - else if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as a passive mode player." ); SetPVarInt( playerid, "robitems_timestamp", g_iTime + 60 ); GivePlayerWantedLevel( playerid, 4 ); @@ -2968,8 +2945,6 @@ CMD:sellgun( playerid, params[ ] ) else if ( p_Jailed{ pID } ) return SendError( playerid, "This player is jailed, you cannot sell weapons to him." ); else if ( IsPlayerInPaintBall( pID ) || IsPlayerDueling( pID ) ) return SendError( playerid, "You can't sell weapons in an arena." ); else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); - else if ( IsPlayerPassive( pID ) ) return SendError( playerid, "You cannot use this command on passive mode players." ); - else if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as a passive mode player." ); else if ( GetDistanceBetweenPlayers( playerid, pID ) < 5.0 ) { SendClientMessageFormatted( pID, -1, ""COL_ORANGE"[WEAPON DEAL]{FFFFFF} %s(%d) wishes to sell you weapons. "COL_ORANGE"/viewguns{FFFFFF} to view the available weapons.", ReturnPlayerName( playerid ), playerid ); @@ -3598,8 +3573,6 @@ CMD:kidnap( playerid, params[ ] ) else if ( IsPlayerBlowingCock( playerid ) ) return SendError( playerid, "You cannot use this command since you're giving oral sex." ); else if ( IsPlayerInMinigame( playerid ) ) return SendError( playerid, "You cannot use this command at the moment." ); else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." ); - else if ( IsPlayerPassive( victimid ) ) return SendError( playerid, "You cannot use this command on passive mode players." ); - else if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as a passive mode player." ); else if ( p_KidnapImmunity[ victimid ] > g_iTime ) return SendError( playerid, "This player cannot be kidnapped for another %s.", secondstotime( p_KidnapImmunity[ victimid ] - g_iTime ) ); else if ( PutPlayerInEmptyVehicleSeat( p_LastVehicle[ playerid ], victimid ) == -1 ) return SendError( playerid, "Failed to place the player inside a full of player vehicle." ); SendClientMessageFormatted( victimid, -1, ""COL_RED"[KIDNAPPED]{FFFFFF} You have been kidnapped by %s(%d)!", ReturnPlayerName( playerid ), playerid ); @@ -3671,8 +3644,6 @@ CMD:tie( playerid, params[ ] ) else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" ); else if ( IsPlayerSpawnProtected( victimid ) ) return SendError( playerid, "You cannot use this command on spawn protected players." ); - else if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as a passive mode player." ); - else if ( IsPlayerPassive( victimid ) ) return SendError( playerid, "You cannot use this command on passive mode players." ); else if ( IsPlayerInCasino( victimid ) && ! p_WantedLevel[ victimid ] ) return SendError( playerid, "The innocent person you're trying to tie is in a casino." ); // remove rope after attempt @@ -3856,8 +3827,6 @@ CMD:rob( playerid, params[ ] ) else if ( p_ClassSelection{ victimid } ) return SendError( playerid, "This player is currently in class selection." ); else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" ); - else if ( IsPlayerPassive( victimid ) ) return SendError( playerid, "You cannot use this command on passive mode players." ); - else if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as a passive mode player." ); new iRandom = random( 101 ); @@ -3940,8 +3909,6 @@ CMD:rape( playerid, params[ ] ) else if ( IsPlayerInCasino( victimid ) && ! p_WantedLevel[ victimid ] ) return SendError( playerid, "The innocent person you're trying to rape is in a casino." ); else if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." ); else if ( IsPlayerSpawnProtected( victimid ) ) return SendError( playerid, "This player is in a anti-spawn-kill state." ); - else if ( IsPlayerPassive( victimid ) ) return SendError( playerid, "You cannot use this command on passive mode players." ); - else if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as a passive mode player." ); else if ( p_ClassSelection{ victimid } ) return SendError( playerid, "This player is currently in class selection." ); else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); else if ( IsPlayerAFK( victimid ) && GetPlayerState( playerid ) != PLAYER_STATE_WASTED ) return SendError( playerid, "This player is in an AFK state." ); @@ -4811,11 +4778,6 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) TogglePlayerControllable( playerid, 1 ); - /* Passive Mode - Removed E:\SF-CNR\gamemodes\sf-cnr.pwn - if ( ! p_JobSet{ playerid } ) { - ShowPlayerDialog( playerid, DIALOG_PASSIVE_MODE, DIALOG_STYLE_LIST, "{FFFFFF}What is your type of style?", "{555555}Choose Below Below:\nI Like Roleplaying\nI Like Deathmatching", "Select", "" ); - }*/ - p_JobSet{ playerid } = true; //if ( !p_CitySet{ playerid } ) @@ -4832,19 +4794,6 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) } } - /*if ( dialogid == DIALOG_PASSIVE_MODE ) - { - if ( ! response || ! listitem ) { - ShowPlayerDialog( playerid, DIALOG_PASSIVE_MODE, DIALOG_STYLE_LIST, "{FFFFFF}What is your type of style?", "{555555}Choose Below Below:\nI Like Roleplaying\nI Like Deathmatching", "Select", "" ); - } - - if ( listitem == 1 ) { - SendServerMessage( playerid, "Since you like roleplay, passive mode has been automatically enabled for you!" ); - } else if ( listitem == 2 ) { - CallLocalFunction( "OnDialogResponse", "dddds", playerid, DIALOG_CP_MENU, 1, SETTING_PASSIVE_MODE + 1, "ignore" ); // cunning way - SendServerMessage( playerid, "Since you like deathmatch, passive mode has been automatically enabled for you!" ); - } - }*/ if ( dialogid == DIALOG_HOUSES ) { if ( ! response ) @@ -6906,9 +6855,6 @@ stock IsRandomDeathmatch( issuerid, damagedid ) if ( IsPlayerBoxing( issuerid ) ) return false; - if ( IsPlayerPassive( damagedid ) ) - return true; - if ( ! IsPlayerInCasino( issuerid ) || ! IsPlayerInCasino( damagedid ) ) return false; @@ -7168,5 +7114,11 @@ stock IsPlayerBelowSeaLevel( playerid ) GetPlayerPos( playerid, z, z, z ); - return z < 0.0; + return z < -2.0; +} + +stock ReturnPlayerHealth( playerid ) +{ + new Float: health; + return GetPlayerHealth( playerid, health ); } \ No newline at end of file