diff --git a/gamemodes/irresistible/cnr/features/business/business.pwn b/gamemodes/irresistible/cnr/features/business/business.pwn index 70ad150..12922e7 100644 --- a/gamemodes/irresistible/cnr/features/business/business.pwn +++ b/gamemodes/irresistible/cnr/features/business/business.pwn @@ -1761,6 +1761,9 @@ stock GetProductPrice( businessid, bool: hardened = false ) if ( strmatch( szCity, "San Fierro" ) ) { price *= 1.10; } + else { + price *= 0.50; + } // hardened with vehicle, 25% more profit if ( hardened ) { diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 0c012a4..7120b1c 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -180,6 +180,9 @@ CMD:arrest( playerid, params[ ] ) 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 ) * ( COP_ARREST_PAY_PER_WANTED ); new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER ); + if ( GetPlayerLevel( victimid, E_POLICE ) >= 75.0 ) { + totalSeconds = floatround( float( totalSeconds ) * 0.5 ); + } GivePlayerScore( playerid, 2 ); GivePlayerExperience( playerid, E_POLICE ); GivePlayerCash( playerid, totalCash ); @@ -396,9 +399,13 @@ stock BreakPlayerCuffs( playerid ) } else p_BobbyPins[ playerid ] --; - new probability = 50; // success rate probability + new Float: probability = fRandomEx( 0.0, 100.0 ); - if ( random( 101 ) <= probability ) + // multiply success rate every 25 levels (only 1, 2, 3, 4x) + probability *= GetPlayerLevel( playerid, E_POLICE ) / 25.0 + 1.0; + + // if probability >= n% after multiplying as well then uncuff + if ( probability >= 75.0 ) { if ( ! IsPlayerCuffed( playerid ) ) { @@ -439,12 +446,12 @@ stock AwardNearestLEO( playerid, reason ) { if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || IsPlayerDead( playerid ) ) return false; - + #if defined __cloudy_event_system if ( IsPlayerInEvent( playerid ) ) return false; #endif - + new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker. new closestLEO = GetClosestPlayerEx( playerid, CLASS_POLICE, radius ); diff --git a/gamemodes/irresistible/cnr/features/cop/bail.pwn b/gamemodes/irresistible/cnr/features/cop/bail.pwn index 57d44d1..3cb7ec4 100644 --- a/gamemodes/irresistible/cnr/features/cop/bail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/bail.pwn @@ -32,13 +32,13 @@ CMD:bail( playerid, params[ ] ) else if ( GetPVarInt( pID, "bail_antispam" ) > g_iTime ) return SendError( playerid, "You must wait 10 seconds before offering a bail to this player." ); else { - equa = BAIL_DOLLARS_PER_SECOND * p_JailTime[ pID ]; - if ( p_JailTime[ pID ] >= ALCATRAZ_TIME_WANTED ) equa *= 2; - p_BailOfferer[ pID ] = playerid; - p_BailTimestamp[ pID ] = g_iTime + 120; - SetPVarInt( pID, "bail_antispam", g_iTime + 1 ); - SendServerMessage( playerid, "You have offered %s(%d) bail for "COL_GOLD"%s", ReturnPlayerName( pID ), pID, cash_format( equa ) ); - SendClientMessageFormatted( pID, -1, ""COL_GREY"[SERVER]"COL_WHITE" %s(%d) has offered to bail you out for "COL_GOLD"%s"COL_WHITE". "COL_ORANGE"/acceptbail"COL_WHITE" to accept the bail.", ReturnPlayerName( playerid ), playerid, cash_format( equa ) ); + equa = floatround( float( BAIL_DOLLARS_PER_SECOND * p_JailTime[ pID ] ) * ( 1.0 - GetPlayerLevel( pID, E_POLICE ) / 125.0 ) ); + if ( p_JailTime[ pID ] >= ALCATRAZ_TIME_WANTED ) equa *= 2; + p_BailOfferer[ pID ] = playerid; + p_BailTimestamp[ pID ] = g_iTime + 120; + SetPVarInt( pID, "bail_antispam", g_iTime + 1 ); + SendServerMessage( playerid, "You have offered %s(%d) bail for "COL_GOLD"%s", ReturnPlayerName( pID ), pID, cash_format( equa ) ); + SendClientMessageFormatted( pID, -1, ""COL_GREY"[SERVER]"COL_WHITE" %s(%d) has offered to bail you out for "COL_GOLD"%s"COL_WHITE". "COL_ORANGE"/acceptbail"COL_WHITE" to accept the bail.", ReturnPlayerName( playerid ), playerid, cash_format( equa ) ); } return 1; } @@ -46,7 +46,7 @@ CMD:bail( playerid, params[ ] ) CMD:acceptbail( playerid, params[ ] ) { new - equa = BAIL_DOLLARS_PER_SECOND * p_JailTime[ playerid ]; + equa = floatround( float( BAIL_DOLLARS_PER_SECOND * p_JailTime[ playerid ] ) * ( 1.0 - GetPlayerLevel( playerid, E_POLICE ) / 125.0 ) ); if ( p_JailTime[ playerid ] >= ALCATRAZ_TIME_WANTED ) equa *= 2; @@ -61,7 +61,7 @@ CMD:acceptbail( playerid, params[ ] ) new cashEarned = floatround( equa * 0.70 ); - GivePlayerCash( playerid, -equa ); + GivePlayerCash( playerid, -equa ); GivePlayerCash( p_BailOfferer[ playerid ], cashEarned ); StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, cashEarned, 0.1 ); SendClientMessageFormatted( p_BailOfferer[ playerid ], -1, ""COL_GREEN"[BAIL]"COL_WHITE" %s(%d) has paid bail. You have earned "COL_GOLD"%s"COL_WHITE" from his bail.", ReturnPlayerName( playerid ), playerid, cash_format( cashEarned ) ); diff --git a/gamemodes/irresistible/cnr/features/fires.pwn b/gamemodes/irresistible/cnr/features/fires.pwn index 0d53b58..32207d5 100644 --- a/gamemodes/irresistible/cnr/features/fires.pwn +++ b/gamemodes/irresistible/cnr/features/fires.pwn @@ -11,7 +11,7 @@ /* ** Definitions ** */ #define MAX_FIRES ( 10 ) -#define FIRE_EXTINGUISH_PAYOUT ( 6000 ) +#define FIRE_EXTINGUISH_PAYOUT ( 5000 ) /* ** Variables ** */ enum E_FIRE_DATA @@ -85,8 +85,8 @@ hook OnPlayerUpdateEx( playerid ) if ( g_fireData[ i ] [ E_HEALTH ] <= 0.0 ) { - new - money_earned = RandomEx( FIRE_EXTINGUISH_PAYOUT / 2, FIRE_EXTINGUISH_PAYOUT ); + new min_money_earned = floatround( float( FIRE_EXTINGUISH_PAYOUT ) * 0.75 ); + new money_earned = RandomEx( min_money_earned, FIRE_EXTINGUISH_PAYOUT ); ach_HandleExtinguishedFires( playerid ); SendClientMessageToAllFormatted( -1, "{A83434}[FIREMAN]"COL_WHITE" %s(%d) has earned "COL_GOLD"%s"COL_WHITE" for extinguishing a house fire.", ReturnPlayerName( playerid ), playerid, cash_format( money_earned ) ); @@ -117,6 +117,10 @@ hook OnServerUpdate( ) hook OnServerGameDayEnd( ) { + for ( new fireid = 0; fireid < MAX_FIRES; fireid ++ ) + { + HouseFire_Remove( fireid ); + } HouseFire_Create( ); return 1; } diff --git a/gamemodes/irresistible/cnr/features/player/experience.pwn b/gamemodes/irresistible/cnr/features/player/experience.pwn index 7769837..39ab4b9 100644 --- a/gamemodes/irresistible/cnr/features/player/experience.pwn +++ b/gamemodes/irresistible/cnr/features/player/experience.pwn @@ -44,9 +44,32 @@ enum E_RANK_DATA E_COLOR, }; +enum E_BENEFIT_DATA +{ + E_LEVELS: E_LEVEL_INDEX, + E_BENEFIT[ 64 ], + Float: E_LEVEL_REQUIRE +}; + static const Float: EXP_MAX_PLAYER_LEVEL = 100.0; +static const + g_requirementData [ ] [ E_BENEFIT_DATA ] = + { + // whatever the level stuff is (no idea) + { E_POLICE, "Half the number of seconds you spend in jail.", 75.0 }, + { E_POLICE, "Success rate for booby pins increase every police level", 0.0 }, + + { E_ROBBERY, "Higher the robbery level, the better success rate of a robbery", 0.0 }, + { E_ROBBERY, "Higher the robbery level, the faster you can break into a safe", 0.0 }, + + { E_DEATHMATCH, "Benefit of dropping a health pickup when killing a player", 10.0 }, + + { E_ROLEPLAY, "Increase success rate in mining based on roleplay level", 0.0 } + } +; + static const g_levelData [ ] [ E_LEVEL_DATA ] = { @@ -106,8 +129,23 @@ stock Float: GetPlayerLevel( playerid, E_LEVELS: level ) /* ** Hooks ** */ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { - if ( dialogid == DIALOG_VIEW_LEVEL && response ) { - return cmd_level( playerid, sprintf( "%d", GetPVarInt( playerid, "experience_watchingid" ) ) ), 1; + if ( dialogid == DIALOG_VIEW_LEVEL && response ) + { + new + watchingid = GetPVarInt( playerid, "experience_watchingid" ); + + szLargeString = ""COL_GREY"Benefit\t"COL_GREY"Required Level\n"; + + for ( new i = 0; i < sizeof( g_requirementData ); i ++ ) + { + if ( g_requirementData[ i ][ E_LEVEL_INDEX ] == E_LEVELS: listitem ) + { + format( szLargeString, sizeof( szLargeString ), "%s"COL_WHITE"%s\t"COL_GOLD"%s\n", szLargeString, g_requirementData[ i ][ E_BENEFIT ], number_format( g_requirementData[ i ][ E_LEVEL_REQUIRE ], .decimals = 0 ) ); + } + } + + ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST_HEADERS, sprintf( "{FFFFFF}%s's %s Level", ReturnPlayerName( watchingid ), g_levelData[ listitem ] [ E_NAME ] ), szLargeString, "Close", "" ); + return 1; } else if ( dialogid == DIALOG_XPMARKET && response ) { @@ -256,7 +294,7 @@ CMD:level( playerid, params[ ] ) } SetPVarInt( playerid, "experience_watchingid", watchingid ); - return ShowPlayerDialog( playerid, DIALOG_VIEW_LEVEL, DIALOG_STYLE_TABLIST_HEADERS, sprintf( "{FFFFFF}%s's Level - Total Level %d", ReturnPlayerName( watchingid ), player_total_lvl ), szLargeString, "Refresh", "Close" ); + return ShowPlayerDialog( playerid, DIALOG_VIEW_LEVEL, DIALOG_STYLE_TABLIST_HEADERS, sprintf( "{FFFFFF}%s's Level - Total Level %d", ReturnPlayerName( watchingid ), player_total_lvl ), szLargeString, "Select", "Close" ); } CMD:rank( playerid, params[ ] ) diff --git a/gamemodes/irresistible/cnr/features/robbery/safes.pwn b/gamemodes/irresistible/cnr/features/robbery/safes.pwn index 50d24a0..a3e9588 100644 --- a/gamemodes/irresistible/cnr/features/robbery/safes.pwn +++ b/gamemodes/irresistible/cnr/features/robbery/safes.pwn @@ -538,6 +538,10 @@ stock createRobberyLootInstance( playerid, robberyid, type ) random_chance = 100.0; } + if ( GetPlayerLevel( playerid, E_POLICE ) >= 50.0 ) { + random_chance = 100.0; + } + // level increase chance of success random_chance += GetPlayerLevel( playerid, E_ROBBERY ) * 0.2; // increase success rate by 0.2% per level diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index 8a9fbcd..6bb8154 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -1,3 +1,4 @@ +v11.68.210 v11.66.204 v11.65.200 v11.60.190 diff --git a/scriptfiles/changelogs/cnr/v11.68.210.txt b/scriptfiles/changelogs/cnr/v11.68.210.txt new file mode 100644 index 0000000..7880e87 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.68.210.txt @@ -0,0 +1,8 @@ +(+) New players are given $5,000 when they register. +(+) Police level over 75 will half the number of seconds you spend in jail. +(+) Success rate of bobby pins doubles every 25th police level. +(+) Bail is reduced up to a maximum of 80% with every police level. +(/) Payout for robberies in LS and LV has been reduced. +(/) Fireman minimum pay increased, maximum set to $5,000 though per fire. +(*) Adds map loading/unloading functionality to event module. +(*) All fires are remade after an in-game day. \ No newline at end of file