adjusts the migration error to fix developing work, removes the ability to use animations while using a parachute, fixes weed error OnPlayerDisconnect, removes the ability to gain IC while doing an animation, removes the ability to send IC to spectating admins, adds a variable setter OnPlayerConnect to remove the ability to relog to skip the cooldown timer for Dirty Mechanic

This commit is contained in:
Damen 2019-01-24 23:39:34 -05:00
parent 2cf0111d75
commit ba54a9f72d
6 changed files with 19 additions and 4 deletions

View File

@ -362,6 +362,7 @@ stock CreateLoopingAnimation( playerid, animlib[ ], animname[ ], Float:Speed, lo
else if ( IsPlayerAttachedObjectSlotUsed( playerid, 3 ) ) return SendError( playerid, "You cannot use this command since you're holding a stolen good." );
else if ( GetPlayerState( playerid ) == PLAYER_STATE_ENTER_VEHICLE_DRIVER || GetPlayerState( playerid ) == PLAYER_STATE_ENTER_VEHICLE_PASSENGER ) return SendError( playerid, "You cannot use this command since you're entering a vehicle." );
else if ( GetPlayerState( playerid ) == PLAYER_STATE_EXIT_VEHICLE ) return SendError( playerid, "You cannot use this command since you're exiting a vehicle." );
else if ( IsPlayerWearingParachute( playerid ) ) return SendError( playerid, "You cannot use this command while wearing a parachute." );
else
{
SetPlayerSpecialAction( playerid, 0 );
@ -397,3 +398,12 @@ stock IsPlayingAnimation( playerid, const library[ ], const animation[ ] )
stock IsPlayerUsingAnimation( playerid ) {
return p_InAnimation{ playerid };
}
stock IsPlayerWearingParachute( playerid )
{
if ( GetPlayerWeapon( playerid ) == 46 )
return true;
else
return false;
}

View File

@ -42,6 +42,12 @@ hook OnScriptInit( )
return 1;
}
hook OnPlayerConnect( playerid )
{
p_AntiExportCarSpam [ playerid ] = g_iTime + 60;
return 1;
}
hook OnPlayerDisconnect( playerid, reason )
{
g_LastExportModel[ playerid ] = 0;

View File

@ -55,7 +55,7 @@ hook OnPlayerTickSecond( playerid )
iKeys, iUpDownKeys, iLeftRightKeys;
// Increase Irresistible Coins (1/20 = cred/min)
if ( ! IsPlayerAFK( playerid ) && GetPlayerKeys( playerid, iKeys, iUpDownKeys, iLeftRightKeys ) && ! IsPlayerOnRoulette( playerid ) && ! IsPlayerOnSlotMachine( playerid ) && GetPlayerVehicleSeat( playerid ) <= 0 )
if ( ! IsPlayerAFK( playerid ) && GetPlayerKeys( playerid, iKeys, iUpDownKeys, iLeftRightKeys ) && ! IsPlayerOnRoulette( playerid ) && ! IsPlayerOnSlotMachine( playerid ) && GetPlayerVehicleSeat( playerid ) <= 0 && !IsPlayerUsingAnimation( playerid ) )
{
if ( iKeys != 0 || iUpDownKeys != 0 || iLeftRightKeys != 0 ) { // GetPlayerScore( playerid ) > 10 &&

View File

@ -501,7 +501,7 @@ CMD:irresistiblecoins( playerid, params[ ] )
else if ( senttoid == playerid ) return SendError( playerid, "You cannot send yourself coins." );
else
{
if ( GetDistanceBetweenPlayers( playerid, senttoid ) > 8.0 )
if ( GetDistanceBetweenPlayers( playerid, senttoid ) > 8.0 || p_Spectating{ senttoid } )
return SendError( playerid, "Please make sure you are close to the player before sending coins to them." );
format( szNormalString, sizeof( szNormalString ), "INSERT INTO `TRANSACTIONS_IC` (`TO_ID`, `FROM_ID`, `IC`) VALUES (%d, %d, %f)", p_AccountID[ senttoid ], p_AccountID[ playerid ], coins );

View File

@ -329,7 +329,6 @@ stock Weed_GetPlantLimit( playerid )
stock Weed_ResetSellingProperties( playerid )
{
Weed_ResetSellingProperties( playerid );
p_WeedSellingGrams[ playerid ] = 0;
p_WeedSellingPrice[ playerid ] = 0;
return 1;

View File

@ -55,7 +55,7 @@ public Migrations_CheckMissing( )
new
num_migrations = Migrations_GetCount( );
if ( executed_migrations != num_migrations )
if ( executed_migrations < num_migrations )
{
new
dir: migrations_directory = dir_open( SERVER_MIGRATIONS_FOLDER ),