new rank system is largely based off the new xp system

This commit is contained in:
Lorenc Pekaj 2018-10-12 20:01:32 +11:00
parent 1838bf5b50
commit ecf10abe5c
4 changed files with 80 additions and 75 deletions

View File

@ -438,18 +438,18 @@ CMD:givexp( playerid, params [ ] )
return 1;
}
CMD:giveip( playerid, params [ ] )
CMD:givesxp( playerid, params [ ] )
{
new
pID,
ip
;
if ( !IsPlayerAdmin( playerid ) || ! IsPlayerLeadMaintainer( playerid ) ) return 0;
else if ( sscanf( params, "ud", pID, ip ) ) SendUsage( playerid, "/giveip [PLAYER_ID] [IP_AMOUNT]" );
else if ( sscanf( params, "ud", pID, ip ) ) SendUsage( playerid, "/givesxp [PLAYER_ID] [IP_AMOUNT]" );
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
else
{
GivePlayerIrresistiblePoints( pID, ip );
GivePlayerSeasonalXP( pID, ip );
//AddAdminLogLineFormatted( "%s(%d) has given %s(%d) %d IP", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, ip );
//SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has given you %d IP.", ReturnPlayerName( playerid ), playerid, ip );
//SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've given %s(%d) %d IP.", ReturnPlayerName( pID ), pID, ip );

View File

@ -64,35 +64,31 @@ static const
*/
},
g_aPlayerRanks[ ] [ E_RANK_DATA ] =
g_seasonalRanks[ ] [ E_RANK_DATA ] =
{
{ 11871.5, "Elite V", 19780, COLOR_GOLD },
{ 6627.13, "Elite IV", 19782, COLOR_GOLD },
{ 3699.51, "Elite III", 19781, COLOR_GOLD },
{ 2065.21, "Elite II", 19784, COLOR_GOLD },
{ 1152.88, "Elite I", 19783, COLOR_GOLD },
{ 643.581, "Silver V", 19780, COLOR_GREY },
{ 359.271, "Silver IV", 19782, COLOR_GREY },
{ 200.563, "Silver III", 19781, COLOR_GREY },
{ 111.95, "Silver II", 19784, COLOR_GREY },
{ 62.5, "Silver I", 19783, COLOR_GREY },
{ 49860.3, "Elite V", 19780, COLOR_GOLD },
{ 27833.9, "Elite IV", 19782, COLOR_GOLD },
{ 15537.9, "Elite III", 19781, COLOR_GOLD },
{ 8673.88, "Elite II", 19784, COLOR_GOLD },
{ 4842.10, "Elite I", 19783, COLOR_GOLD },
{ 2703.04, "Silver V", 19780, COLOR_GREY },
{ 1508.94, "Silver IV", 19782, COLOR_GREY },
{ 842.365, "Silver III", 19781, COLOR_GREY },
{ 470.19, "Silver II", 19784, COLOR_GREY },
{ 262.5, "Silver I", 19783, COLOR_GREY },
{ 0.0, "unranked", 19300, COLOR_GREY }
}
;
new
Float: p_seasonalXP [ MAX_PLAYERS ]
;
/* ** Variables ** */
static stock
Float: g_playerExperience [ MAX_PLAYERS ] [ E_LEVELS ],
Float: p_seasonalXP [ MAX_PLAYERS ],
PlayerText: p_playerExpTitle [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
PlayerText: p_playerExpAwardTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
PlayerBar: p_playerExpProgress [ MAX_PLAYERS ],
p_playerExpHideTimer [ MAX_PLAYERS ] = { -1, ... }
;
/* ** Important ** */
@ -266,7 +262,7 @@ thread currentUserRank( playerid, watchingid )
iGroupedRank = GetPlayerRank( watchingid ),
iGlobalRank = cache_get_field_content_int( 0, "GLOBAL_RANK", dbHandle )
;
SendServerMessage( playerid, "%s(%d) is grouped in {%06x}%s"COL_WHITE" and is globally "COL_GREY"#%d"COL_WHITE".", ReturnPlayerName( watchingid ), watchingid, g_aPlayerRanks[ iGroupedRank ] [ E_COLOR ] >>> 8, g_aPlayerRanks[ iGroupedRank ] [ E_NAME ], iGlobalRank );
SendServerMessage( playerid, "%s(%d) is grouped in {%06x}%s"COL_WHITE" and is globally "COL_GREY"#%d"COL_WHITE".", ReturnPlayerName( watchingid ), watchingid, g_seasonalRanks[ iGroupedRank ] [ E_COLOR ] >>> 8, g_seasonalRanks[ iGroupedRank ] [ E_NAME ], iGlobalRank );
}
else SendError( playerid, "Couldn't find a rank for this user, try again later." );
return 1;
@ -303,6 +299,9 @@ stock GivePlayerExperience( playerid, E_LEVELS: level, Float: default_xp = 1.0,
SetPlayerProgressBarValue( playerid, p_playerExpProgress[ playerid ], progress );
}
// seasonal
GivePlayerSeasonalXP( playerid, xp_earned );
// alert user
KillTimer( p_playerExpHideTimer[ playerid ] );
PlayerTextDrawColor( playerid, p_playerExpTitle[ playerid ], g_levelData[ _: level ] [ E_COLOUR ] );
@ -342,8 +341,8 @@ stock GetRankFromXP( Float: xp ) {
new
iRank;
for( iRank = 0; iRank < sizeof( g_aPlayerRanks ); iRank++ )
if ( xp >= g_aPlayerRanks[ iRank ] [ E_POINTS ] )
for( iRank = 0; iRank < sizeof( g_seasonalRanks ); iRank++ )
if ( xp >= g_seasonalRanks[ iRank ] [ E_POINTS ] )
break;
return iRank;
@ -358,60 +357,58 @@ stock ShowPlayerIrresistibleRank( playerid )
new
iRank = GetPlayerRank( playerid );
PlayerTextDrawColor( playerid, p_PlayerRankTextTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetString( playerid, p_PlayerRankTextTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTextTD[ playerid ], g_seasonalRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetString( playerid, p_PlayerRankTextTD[ playerid ], g_seasonalRanks[ iRank ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetPreviewModel( playerid, p_PlayerRankTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_MODEL ] );
PlayerTextDrawColor( playerid, p_PlayerRankTD[ playerid ], g_seasonalRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetPreviewModel( playerid, p_PlayerRankTD[ playerid ], g_seasonalRanks[ iRank ] [ E_MODEL ] );
PlayerTextDrawShow( playerid, p_PlayerRankTD[ playerid ] );
PlayerTextDrawShow( playerid, p_PlayerRankTextTD[ playerid ] );
}
stock GivePlayerIrresistiblePoints( playerid, Float: points )
stock GivePlayerSeasonalXP( playerid, Float: default_xp )
{
new
Float: fPreviousPoints = p_seasonalXP[ playerid ],
Float: fCurrentPoints = fPreviousPoints + points
;
new Float: previous_season_xp = p_seasonalXP[ playerid ];
new Float: current_season_xp = previous_season_xp + default_xp;
if ( fCurrentPoints < 0.0 )
fCurrentPoints = 0.0;
// default 0
if ( current_season_xp < 0.0 )
current_season_xp = 0.0;
new Float: upper_limit = g_aPlayerRanks[ 0 ] [ E_POINTS ] + 500.0;
new Float: upper_limit = g_seasonalRanks[ 0 ] [ E_POINTS ] + 500.0;
if ( fCurrentPoints > upper_limit )
fCurrentPoints = upper_limit;
// so that the player has a chance to be deranked
if ( current_season_xp > upper_limit )
current_season_xp = upper_limit;
for( new iRank = 0; iRank < sizeof( g_aPlayerRanks ); iRank++ )
for( new iRank = 0; iRank < sizeof( g_seasonalRanks ); iRank++ )
{
new
bGained = ( fPreviousPoints < g_aPlayerRanks[ iRank ] [ E_POINTS ] <= fCurrentPoints ),
bLost = ( fCurrentPoints < g_aPlayerRanks[ iRank ] [ E_POINTS ] <= fPreviousPoints )
;
new bGained = ( previous_season_xp < g_seasonalRanks[ iRank ] [ E_POINTS ] <= current_season_xp );
new bLost = ( current_season_xp < g_seasonalRanks[ iRank ] [ E_POINTS ] <= previous_season_xp );
if ( bGained || bLost )
{
if ( bGained )
{
SendServerMessage( playerid, "Congratulations, your grouped ranking has been increased to {%06x}%s"COL_WHITE"!", g_aPlayerRanks[ iRank ] [ E_COLOR ] >>> 8, g_aPlayerRanks[ iRank ] [ E_NAME ] );
SendServerMessage( playerid, "Congratulations, your grouped ranking has been increased to {%06x}%s"COL_WHITE"!", g_seasonalRanks[ iRank ] [ E_COLOR ] >>> 8, g_seasonalRanks[ iRank ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTextTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetString( playerid, p_PlayerRankTextTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTextTD[ playerid ], g_seasonalRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetString( playerid, p_PlayerRankTextTD[ playerid ], g_seasonalRanks[ iRank ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetPreviewModel( playerid, p_PlayerRankTD[ playerid ], g_aPlayerRanks[ iRank ] [ E_MODEL ] );
PlayerTextDrawColor( playerid, p_PlayerRankTD[ playerid ], g_seasonalRanks[ iRank ] [ E_COLOR ] );
PlayerTextDrawSetPreviewModel( playerid, p_PlayerRankTD[ playerid ], g_seasonalRanks[ iRank ] [ E_MODEL ] );
}
if ( bLost )
{
SendServerMessage( playerid, "Sorry, your grouped ranking has decreased to {%06x}%s"COL_WHITE"!", g_aPlayerRanks[ iRank + 1 ] [ E_COLOR ] >>> 8, g_aPlayerRanks[ iRank + 1 ] [ E_NAME ] );
SendServerMessage( playerid, "Sorry, your grouped ranking has decreased to {%06x}%s"COL_WHITE"!", g_seasonalRanks[ iRank + 1 ] [ E_COLOR ] >>> 8, g_seasonalRanks[ iRank + 1 ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTextTD[ playerid ], g_aPlayerRanks[ iRank + 1 ] [ E_COLOR ] );
PlayerTextDrawSetString( playerid, p_PlayerRankTextTD[ playerid ], g_aPlayerRanks[ iRank + 1 ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTextTD[ playerid ], g_seasonalRanks[ iRank + 1 ] [ E_COLOR ] );
PlayerTextDrawSetString( playerid, p_PlayerRankTextTD[ playerid ], g_seasonalRanks[ iRank + 1 ] [ E_NAME ] );
PlayerTextDrawColor( playerid, p_PlayerRankTD[ playerid ], g_aPlayerRanks[ iRank + 1 ] [ E_COLOR ] );
PlayerTextDrawSetPreviewModel( playerid, p_PlayerRankTD[ playerid ], g_aPlayerRanks[ iRank + 1 ] [ E_MODEL ] );
PlayerTextDrawColor( playerid, p_PlayerRankTD[ playerid ], g_seasonalRanks[ iRank + 1 ] [ E_COLOR ] );
PlayerTextDrawSetPreviewModel( playerid, p_PlayerRankTD[ playerid ], g_seasonalRanks[ iRank + 1 ] [ E_MODEL ] );
}
PlayerTextDrawShow( playerid, p_PlayerRankTD[ playerid ] );
@ -419,16 +416,24 @@ stock GivePlayerIrresistiblePoints( playerid, Float: points )
break;
}
}
//printf( "%s: %f points", ReturnPlayerName( playerid ), fCurrentPoints );
p_seasonalXP[ playerid ] = fCurrentPoints;
//printf( "%s: %f points", ReturnPlayerName( playerid ), current_season_xp );
p_seasonalXP[ playerid ] = current_season_xp;
// save to database
mysql_single_query( sprintf( "UPDATE `USERS` SET `RANK` = %f WHERE `ID` = %d", current_season_xp, GetPlayerAccountID( playerid ) ) );
}
stock GetRankName( rankid ) {
return g_aPlayerRanks[ rankid ] [ E_NAME ];
stock GetSeasonalRankName( rankid ) {
return g_seasonalRanks[ rankid ] [ E_NAME ];
}
stock GetRankColour( rankid ) {
return g_aPlayerRanks[ rankid ] [ E_COLOR ];
stock GetSeasonalRankColour( rankid ) {
return g_seasonalRanks[ rankid ] [ E_COLOR ];
}
stock SetPlayerSeasonalXP( playerid, Float: seasonal_xp ) {
p_seasonalXP[ playerid ] = seasonal_xp;
}
/* ** Migrations ** */

View File

@ -209,7 +209,7 @@ public OnMethamphetamineCooking( playerid, vehicleid, last_chemical )
ShowPlayerHelpDialog( playerid, 5000, "The process is done. Bag it up and do another round if you wish." );
SendServerMessage( playerid, "Process is done. Bag it up, and do another round if you wish. Export it for money." );
GivePlayerWantedLevel( playerid, 12 );
GivePlayerScore( playerid, 3, .multiplier = 0.30 );
GivePlayerScore( playerid, 3 );
ach_HandleMethYielded( playerid );
SetGVarInt( "meth_yield", CreateDynamicObject( 1579, 2083.684082, 1233.945922, 414.875244, 0.000000, 0.000000, 90.000000, GetPlayerVirtualWorld( playerid ) ), vehicleid );
PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );

View File

@ -1564,7 +1564,7 @@ public ZoneTimer( )
if ( IsPlayerSpawned( d ) && ! IsPlayerAFK( d ) && p_Class[ d ] == CLASS_CIVILIAN && p_GangID[ d ] == attacker_gang && ! IsPlayerInPaintBall( d ) ) {
if ( in_area ) {
GivePlayerScore( d, 2, .multiplier = 0.5 );
GivePlayerScore( d, 2 );
GivePlayerWantedLevel( d, 6 );
}
PlayerPlaySound( d, 36205, 0.0, 0.0, 0.0 );
@ -3273,7 +3273,7 @@ public OnPlayerDeath( playerid, killerid, reason )
if ( p_Class[ killerid ] != CLASS_POLICE )
{
GivePlayerWantedLevel( killerid, 12 );
GivePlayerScore( killerid, 1, .multiplier = 0.2 );
GivePlayerScore( killerid, 1 );
new
Float: default_experience = 1.0;
@ -3301,7 +3301,7 @@ public OnPlayerDeath( playerid, killerid, reason )
SaveGangData( playerGangId ), g_gangData[ playerGangId ] [ E_DEATHS ]++;
p_Deaths[ playerid ] ++; // Usually other events do nothing
GivePlayerIrresistiblePoints( playerid, -1 ); // Deduct points, it's meant to be hard!!!
GivePlayerSeasonalXP( playerid, -10.0 ); // Deduct points, it's meant to be hard!!!
}
ClearPlayerWantedLevel( playerid );
@ -9154,7 +9154,7 @@ public OnPlayerEnterDynamicCP( playerid, checkpointid )
GameTextForPlayer( victimid, "~r~Busted!", 4000, 0 );
ClearAnimations( victimid );
JailPlayer( victimid, totalSeconds );
GivePlayerIrresistiblePoints( victimid, -2 );
GivePlayerSeasonalXP( victimid, -2 );
SendGlobalMessage( -1, ""COL_GOLD"[JAIL]{FFFFFF} %s(%d) has sent %s(%d) to jail for %d seconds!", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( victimid ), victimid, totalSeconds );
}
}
@ -9387,7 +9387,7 @@ public OnPlayerEnterDynamicRaceCP( playerid, checkpointid )
}
items = GetGVarInt( szItems );
score = floatround( items / 2 );
GivePlayerScore( playerid, score == 0 ? 1 : score, .multiplier = 0.4 );
GivePlayerScore( playerid, score == 0 ? 1 : score );
//GivePlayerExperience( playerid, E_BURGLAR, float( items ) * 0.2 );
DestroyDynamicMapIcon( p_PawnStoreMapIcon[ playerid ] );
p_PawnStoreMapIcon[ playerid ] = 0xFFFF;
@ -10276,7 +10276,6 @@ thread OnAttemptPlayerLogin( playerid, password[ ] )
p_MethYielded[ playerid ] = cache_get_field_content_int( 0, "METH_YIELDED", dbHandle );
p_drillStrength[ playerid ] = cache_get_field_content_int( 0, "DRILL", dbHandle );
p_IrresistibleCoins[ playerid ] = cache_get_field_content_float( 0, "COINS", dbHandle );
p_seasonalXP[ playerid ] = cache_get_field_content_float( 0, "RANK", dbHandle );
p_ExtraAssetSlots{ playerid } = cache_get_field_content_int( 0, "EXTRA_SLOTS", dbHandle );
p_forcedAnticheat[ playerid ] = cache_get_field_content_int( 0, "FORCE_AC", dbHandle );
@ -10287,6 +10286,9 @@ thread OnAttemptPlayerLogin( playerid, password[ ] )
p_AddedEmail{ playerid } = !!cache_get_field_content_int( 0, "USED_EMAIL", dbHandle );
// p_TaxTime[ playerid ] = cache_get_field_content_int( 0, "TAX_TIME", dbHandle );
// seasonal xp
SetPlayerSeasonalXP( playerid, cache_get_field_content_float( 0, "RANK", dbHandle ) );
// spawn location
new
spawn_location[ 10 ];
@ -11598,7 +11600,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
""COL_GREY"Admin Level:{FFFFFF} %d\n"\
""COL_GREY"Time Online:{FFFFFF} %s\n"\
""COL_GREY"Irresistible Rank:{FFFFFF} %s\n"\
""COL_GREY"Irresistible Coins:{FFFFFF} %f\n", ReturnPlayerName( pID ), pID, p_AccountID[ pID ], p_AdminLevel[ pID ], secondstotime( p_Uptime[ pID ] ), GetRankName( GetPlayerRank( pID ) ), p_IrresistibleCoins[ pID ] );
""COL_GREY"Irresistible Coins:{FFFFFF} %f\n", ReturnPlayerName( pID ), pID, p_AccountID[ pID ], p_AdminLevel[ pID ], secondstotime( p_Uptime[ pID ] ), GetSeasonalRankName( GetPlayerRank( pID ) ), p_IrresistibleCoins[ pID ] );
format( szLargeString, 750, "%s"COL_GREY"V.I.P Level:{FFFFFF} %s\n"\
""COL_GREY"V.I.P Expiry:{FFFFFF} %s\n"\
@ -12930,7 +12932,7 @@ thread OnHighScoreCheck( playerid, highscore_item )
new Float: score_value = cache_get_field_content_float( row, "SCORE_VAL", dbHandle );
new rank = GetRankFromXP( score_value );
format( szLargeString, sizeof( szLargeString ), "%s%s%s\t{%06x}%s\n", szLargeString, strmatch( name, ReturnPlayerName( playerid ) ) ? COL_GREEN : COL_WHITE, name, GetRankColour( rank ) >>> 8, GetRankName( rank ) );
format( szLargeString, sizeof( szLargeString ), "%s%s%s\t{%06x}%s\n", szLargeString, strmatch( name, ReturnPlayerName( playerid ) ) ? COL_GREEN : COL_WHITE, name, GetSeasonalRankColour( rank ) >>> 8, GetSeasonalRankName( rank ) );
}
default:
{
@ -13288,12 +13290,12 @@ stock SavePlayerData( playerid, bool: logout = false )
p_ContractedAmount[ playerid ], p_WeedGrams[ playerid ], logout ? ( bQuitToAvoid ? 1 : 0 ) : 0,
p_drillStrength[ playerid ] );
format( Query, sizeof( Query ), "%s`BLEW_JAILS`=%d,`BLEW_VAULT`=%d,`VEHICLES_JACKED`=%d,`METH_YIELDED`=%d,`LAST_IP`='%s',`VIP_JOB`=%d,`TRUCKED`=%d,`COINS`=%f,`EXPLOSIVE_BULLETS`=%d,`RANK`=%f,`ONLINE`=%d,`HIT_SOUND`=%d,`EXTRA_SLOTS`=%d,`PILOT`=%d,`TRAIN`=%d WHERE `ID`=%d",
format( Query, sizeof( Query ), "%s`BLEW_JAILS`=%d,`BLEW_VAULT`=%d,`VEHICLES_JACKED`=%d,`METH_YIELDED`=%d,`LAST_IP`='%s',`VIP_JOB`=%d,`TRUCKED`=%d,`COINS`=%f,`EXPLOSIVE_BULLETS`=%d,`ONLINE`=%d,`HIT_SOUND`=%d,`EXTRA_SLOTS`=%d,`PILOT`=%d,`TRAIN`=%d WHERE `ID`=%d",
Query,
p_JailsBlown[ playerid ], p_BankBlown[ playerid ], p_CarsJacked[ playerid ],
p_MethYielded[ playerid ], mysql_escape( ReturnPlayerIP( playerid ) ),
p_VIPJob{ playerid }, p_TruckedCargo[ playerid ], p_IrresistibleCoins[ playerid ],
p_ExplosiveBullets[ playerid ], p_seasonalXP[ playerid ],
p_ExplosiveBullets[ playerid ],
!logout, p_HitmarkerSound{ playerid }, p_ExtraAssetSlots{ playerid },
p_PilotMissions[ playerid ], p_TrainMissions[ playerid ],
p_AccountID[ playerid ] );
@ -13701,7 +13703,7 @@ stock IsWeaponBanned( weaponid ) {
return 0 <= weaponid < MAX_WEAPONS && ( weaponid == 36 || weaponid == 37 || weaponid == 38 || weaponid == 39 || weaponid == 44 || weaponid == 45 );
}
stock GivePlayerScore( playerid, score, Float: multiplier = 0.75 )
stock GivePlayerScore( playerid, score )
{
if ( IsPlayerAdminOnDuty( playerid ) )
return 0;
@ -13709,11 +13711,9 @@ stock GivePlayerScore( playerid, score, Float: multiplier = 0.75 )
new
gangid = p_GangID[ playerid ];
if ( gangid != INVALID_GANG_ID )
if ( gangid != INVALID_GANG_ID ) {
SaveGangData( gangid ), g_gangData[ gangid ] [ E_SCORE ] += score;
//GivePlayerXP_Legacy( playerid, score * 10 );
GivePlayerIrresistiblePoints( playerid, score < 0 ? ( score * 1.0 ) : ( score * multiplier ) );
}
return SetPlayerScore( playerid, GetPlayerScore( playerid ) + score );
}
@ -17835,7 +17835,7 @@ stock ArrestPlayer( victimid, playerid )
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, .multiplier = 1.5 );
GivePlayerScore( playerid, 2 );
GivePlayerExperience( playerid, E_POLICE );
GivePlayerCash( playerid, totalCash );
if ( totalCash > 20000 ) printf("[police arrest] %s -> %s - %s", ReturnPlayerName( playerid ), ReturnPlayerName( victimid ), cash_format( totalCash ) ); // 8hska7082bmahu
@ -17843,7 +17843,7 @@ stock ArrestPlayer( victimid, playerid )
GameTextForPlayer( victimid, "~r~Busted!", 4000, 0 );
CallLocalFunction( "OnPlayerArrested", "dddd", playerid, victimid, p_Arrests[ playerid ], 1 );
Untaze( victimid, 6 );
GivePlayerIrresistiblePoints( victimid, -2 );
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;