Merge pull request #14 from zeelorenc/master

Merge
This commit is contained in:
Dusan 2019-06-18 22:16:40 +02:00 committed by GitHub
commit f052005fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 84 additions and 19 deletions

View File

@ -1761,6 +1761,9 @@ stock GetProductPrice( businessid, bool: hardened = false )
if ( strmatch( szCity, "San Fierro" ) ) { if ( strmatch( szCity, "San Fierro" ) ) {
price *= 1.10; price *= 1.10;
} }
else {
price *= 0.50;
}
// hardened with vehicle, 25% more profit // hardened with vehicle, 25% more profit
if ( hardened ) { if ( hardened ) {

View File

@ -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." ); 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 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 ); new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER );
if ( GetPlayerLevel( victimid, E_POLICE ) >= 75.0 ) {
totalSeconds = floatround( float( totalSeconds ) * 0.5 );
}
GivePlayerScore( playerid, 2 ); GivePlayerScore( playerid, 2 );
GivePlayerExperience( playerid, E_POLICE ); GivePlayerExperience( playerid, E_POLICE );
GivePlayerCash( playerid, totalCash ); GivePlayerCash( playerid, totalCash );
@ -396,9 +399,13 @@ stock BreakPlayerCuffs( playerid )
} }
else p_BobbyPins[ 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 ) ) if ( ! IsPlayerCuffed( playerid ) )
{ {

View File

@ -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 if ( GetPVarInt( pID, "bail_antispam" ) > g_iTime ) return SendError( playerid, "You must wait 10 seconds before offering a bail to this player." );
else else
{ {
equa = BAIL_DOLLARS_PER_SECOND * p_JailTime[ pID ]; 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; if ( p_JailTime[ pID ] >= ALCATRAZ_TIME_WANTED ) equa *= 2;
p_BailOfferer[ pID ] = playerid; p_BailOfferer[ pID ] = playerid;
p_BailTimestamp[ pID ] = g_iTime + 120; p_BailTimestamp[ pID ] = g_iTime + 120;
SetPVarInt( pID, "bail_antispam", g_iTime + 1 ); 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 ) ); 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 ) ); 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; return 1;
} }
@ -46,7 +46,7 @@ CMD:bail( playerid, params[ ] )
CMD:acceptbail( playerid, params[ ] ) CMD:acceptbail( playerid, params[ ] )
{ {
new 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 ) if ( p_JailTime[ playerid ] >= ALCATRAZ_TIME_WANTED )
equa *= 2; equa *= 2;
@ -61,7 +61,7 @@ CMD:acceptbail( playerid, params[ ] )
new new
cashEarned = floatround( equa * 0.70 ); cashEarned = floatround( equa * 0.70 );
GivePlayerCash( playerid, -equa ); GivePlayerCash( playerid, -equa );
GivePlayerCash( p_BailOfferer[ playerid ], cashEarned ); GivePlayerCash( p_BailOfferer[ playerid ], cashEarned );
StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, cashEarned, 0.1 ); 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 ) ); 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 ) );

View File

@ -11,7 +11,7 @@
/* ** Definitions ** */ /* ** Definitions ** */
#define MAX_FIRES ( 10 ) #define MAX_FIRES ( 10 )
#define FIRE_EXTINGUISH_PAYOUT ( 6000 ) #define FIRE_EXTINGUISH_PAYOUT ( 5000 )
/* ** Variables ** */ /* ** Variables ** */
enum E_FIRE_DATA enum E_FIRE_DATA
@ -85,8 +85,8 @@ hook OnPlayerUpdateEx( playerid )
if ( g_fireData[ i ] [ E_HEALTH ] <= 0.0 ) if ( g_fireData[ i ] [ E_HEALTH ] <= 0.0 )
{ {
new new min_money_earned = floatround( float( FIRE_EXTINGUISH_PAYOUT ) * 0.75 );
money_earned = RandomEx( FIRE_EXTINGUISH_PAYOUT / 2, FIRE_EXTINGUISH_PAYOUT ); new money_earned = RandomEx( min_money_earned, FIRE_EXTINGUISH_PAYOUT );
ach_HandleExtinguishedFires( playerid ); 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 ) ); 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( ) hook OnServerGameDayEnd( )
{ {
for ( new fireid = 0; fireid < MAX_FIRES; fireid ++ )
{
HouseFire_Remove( fireid );
}
HouseFire_Create( ); HouseFire_Create( );
return 1; return 1;
} }

View File

@ -44,9 +44,32 @@ enum E_RANK_DATA
E_COLOR, E_COLOR,
}; };
enum E_BENEFIT_DATA
{
E_LEVELS: E_LEVEL_INDEX,
E_BENEFIT[ 64 ],
Float: E_LEVEL_REQUIRE
};
static const static const
Float: EXP_MAX_PLAYER_LEVEL = 100.0; 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 static const
g_levelData [ ] [ E_LEVEL_DATA ] = g_levelData [ ] [ E_LEVEL_DATA ] =
{ {
@ -106,8 +129,23 @@ stock Float: GetPlayerLevel( playerid, E_LEVELS: level )
/* ** Hooks ** */ /* ** Hooks ** */
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{ {
if ( dialogid == DIALOG_VIEW_LEVEL && response ) { if ( dialogid == DIALOG_VIEW_LEVEL && response )
return cmd_level( playerid, sprintf( "%d", GetPVarInt( playerid, "experience_watchingid" ) ) ), 1; {
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 ) else if ( dialogid == DIALOG_XPMARKET && response )
{ {
@ -256,7 +294,7 @@ CMD:level( playerid, params[ ] )
} }
SetPVarInt( playerid, "experience_watchingid", watchingid ); 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[ ] ) CMD:rank( playerid, params[ ] )

View File

@ -538,6 +538,10 @@ stock createRobberyLootInstance( playerid, robberyid, type )
random_chance = 100.0; random_chance = 100.0;
} }
if ( GetPlayerLevel( playerid, E_POLICE ) >= 50.0 ) {
random_chance = 100.0;
}
// level increase chance of success // level increase chance of success
random_chance += GetPlayerLevel( playerid, E_ROBBERY ) * 0.2; // increase success rate by 0.2% per level random_chance += GetPlayerLevel( playerid, E_ROBBERY ) * 0.2; // increase success rate by 0.2% per level

View File

@ -1,3 +1,4 @@
v11.68.210
v11.66.204 v11.66.204
v11.65.200 v11.65.200
v11.60.190 v11.60.190

View File

@ -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.