Merged in bugs (pull request #33)

Bugs
This commit is contained in:
Steven Howard 2018-11-10 16:21:40 +00:00 committed by Lorenc Pekaj
commit 50567719f1
6 changed files with 28 additions and 8 deletions

View File

@ -310,14 +310,15 @@ CMD:business( playerid, params[ ] )
new new
bool: has = false; bool: has = false;
szLargeString = ""COL_WHITE"Name\t"COL_WHITE"Production Time\t"COL_WHITE"Product\n"; szLargeString = ""COL_WHITE"Name\t"COL_WHITE"Production Time\t"COL_WHITE"Product\t"COL_WHITE"Bank\n";
foreach ( new businessid : business ) if ( IsBusinessAssociate( playerid, businessid ) ) foreach ( new businessid : business ) if ( IsBusinessAssociate( playerid, businessid ) )
{ {
format( szLargeString, sizeof( szLargeString ), "%s%s\t%s\t"COL_GOLD"%s\n", format( szLargeString, sizeof( szLargeString ), "%s%s\t%s\t"COL_GOLD"%s\t"COL_GREEN"%s\n",
szLargeString, g_businessData[ businessid ] [ E_NAME ], szLargeString, g_businessData[ businessid ] [ E_NAME ],
g_businessData[ businessid ] [ E_PROD_TIMESTAMP ] ? ( secondstotime( g_businessData[ businessid ] [ E_PROD_TIMESTAMP ], ", ", 5 ) ) : ( ""COL_GREEN"Production Finished" ), g_businessData[ businessid ] [ E_PROD_TIMESTAMP ] ? ( secondstotime( g_businessData[ businessid ] [ E_PROD_TIMESTAMP ], ", ", 5 ) ) : ( ""COL_GREEN"Production Finished" ),
g_businessData[ businessid ] [ E_PRODUCT ] == 0 ? ( ""COL_RED"No Product" ) : ( cash_format( g_businessData[ businessid ] [ E_PRODUCT ] * GetProductPrice( businessid ) ) ) g_businessData[ businessid ] [ E_PRODUCT ] == 0 ? ( ""COL_RED"No Product" ) : ( cash_format( g_businessData[ businessid ] [ E_PRODUCT ] * GetProductPrice( businessid ) ) ),
cash_format( g_businessData[ businessid ][ E_BANK ] )
), has = true; ), has = true;
} }

View File

@ -236,6 +236,16 @@ public OnPlayerTakenDamage( playerid, issuerid, Float: amount, weaponid, bodypar
PlayerPlaySound( issuerid, g_HitmarkerSounds[ soundid ] [ E_SOUND_ID ], 0.0, 0.0, 0.0 ); PlayerPlaySound( issuerid, g_HitmarkerSounds[ soundid ] [ E_SOUND_ID ], 0.0, 0.0, 0.0 );
} }
// play noise for admins
foreach ( new i : Player )
{
if ( IsPlayerSpectatingPlayer( i, issuerid ) )
{
new soundid = p_VIPLevel[ i ] ? p_HitmarkerSound{ i } : 0;
PlayerPlaySound( i, g_HitmarkerSounds[ soundid ] [ E_SOUND_ID ], 0.0, 0.0, 0.0 );
}
}
} }
DamageFeedAddHitTaken( playerid, issuerid, amount, weaponid ); DamageFeedAddHitTaken( playerid, issuerid, amount, weaponid );
@ -282,6 +292,11 @@ stock DamageFeedAddHitTaken( playerid, issuerid, Float: amount, weaponid )
AddDamageHit( g_damageTaken[ playerid ], playerid, issuerid, amount, weaponid ); AddDamageHit( g_damageTaken[ playerid ], playerid, issuerid, amount, weaponid );
} }
stock IsPlayerSpectatingPlayer( playerid, targetid )
{
return ( p_Spectating{ playerid } && p_whomSpectating[ playerid ] == targetid && playerid != targetid );
}
stock UpdateDamageFeed( playerid, bool: modified = false ) stock UpdateDamageFeed( playerid, bool: modified = false )
{ {
/* ** Core ** */ /* ** Core ** */

View File

@ -361,7 +361,7 @@ CMD:pilot( playerid, params[ ] )
p_PilotMapIcon [ playerid ] = CreateDynamicMapIconEx( g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_X ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Y ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Z ], 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer ); p_PilotMapIcon [ playerid ] = CreateDynamicMapIconEx( g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_X ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Y ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Z ], 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer );
p_PilotCheckPoint [ playerid ] = CreateDynamicRaceCP( 0, g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_X ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Y ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Z ], 0.0, 0.0, 0.0, 10.0, -1, -1, playerid ); p_PilotCheckPoint [ playerid ] = CreateDynamicRaceCP( 0, g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_X ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Y ], g_AirportLocations[ p_PilotRoute[ playerid ] { 0 } ] [ E_Z ], 0.0, 0.0, 0.0, 10.0, -1, -1, playerid );
if( p_PilotDifficulty[ playerid ] ) { // give the player 6 wanted for starting if( p_PilotDifficulty[ playerid ] == RISK_FACTOR_HARD ) { // give the player 6 wanted for starting
GivePlayerWantedLevel( playerid, 6 ); GivePlayerWantedLevel( playerid, 6 );
} }

View File

@ -138,6 +138,10 @@ hook OnPlayerPickUpDynPickup( playerid, pickupid )
if ( p_PlayerPickupDelay[ playerid ] > GetServerTime( ) ) if ( p_PlayerPickupDelay[ playerid ] > GetServerTime( ) )
return 1; return 1;
// if player is in passive mode cannot pickup weapons, ammo
if ( IsPlayerPassive( playerid ) )
return 1;
// Player Drops // Player Drops
foreach ( new dropid : weapondrop ) foreach ( new dropid : weapondrop )
{ {

View File

@ -71,7 +71,7 @@ stock CNR_SetPlayerWantedLevel( playerid, level )
/* ** Functions ** */ /* ** Functions ** */
stock GivePlayerWantedLevel( playerid, level ) stock GivePlayerWantedLevel( playerid, level )
{ {
if ( ! IsPlayerConnected( playerid ) || IsPlayerNPC( playerid ) || IsPlayerJailed( playerid ) || level == 0 ) if ( ! IsPlayerConnected( playerid ) || IsPlayerNPC( playerid ) || IsPlayerJailed( playerid ) || IsPlayerDueling( playerid ) || level == 0 )
return 0; return 0;
new new

View File

@ -2195,7 +2195,7 @@ public OnPlayerDeath( playerid, killerid, reason )
// Reset player variables // Reset player variables
p_Spawned{ playerid } = false; p_Spawned{ playerid } = false;
p_QuitToAvoidTimestamp[ playerid ] = 0; p_QuitToAvoidTimestamp[ playerid ] = 0;
CutSpectation( playerid ); //CutSpectation( playerid );
StopPlayerNpcRobbery( playerid ); StopPlayerNpcRobbery( playerid );
RemovePlayerFromRace( playerid ); RemovePlayerFromRace( playerid );
RemovePlayerStolensFromHands( playerid ); RemovePlayerStolensFromHands( playerid );
@ -4316,7 +4316,7 @@ CMD:jaillist( playerid, params[ ] )
szBigString[ 0 ] = '\0'; szBigString[ 0 ] = '\0';
foreach( new i : Player ) if ( IsPlayerJailed( i ) ) { foreach( new i : Player ) if ( IsPlayerJailed( i ) ) {
format( szBigString, sizeof( szBigString ), "%s%s%s(%d)\t%d seconds", szBigString, p_AdminJailed{ i } ? ( COL_RED ) : ( COL_WHITE ), ReturnPlayerName( i ), i, p_JailTime[ i ] ); format( szBigString, sizeof( szBigString ), "%s%s%s(%d)\t%d seconds\n", szBigString, p_AdminJailed{ i } ? ( COL_RED ) : ( COL_WHITE ), ReturnPlayerName( i ), i, p_JailTime[ i ] );
} }
if ( szBigString[ 0 ] == '\0' ) { if ( szBigString[ 0 ] == '\0' ) {
@ -5677,7 +5677,7 @@ CMD:location( playerid, params[ ] )
pID pID
; ;
if ( p_Class[ playerid ] == CLASS_CIVILIAN ) return SendError( playerid, "This is not accessible by civilians." ); if ( p_Class[ playerid ] == CLASS_CIVILIAN || p_Class[ playerid ] == CLASS_FIREMAN ) return SendError( playerid, "This is restricted to police only." );
else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/loc(ation) [PLAYER_ID]" ); else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/loc(ation) [PLAYER_ID]" );
else if ( ! IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "This player isn't connected!" ); else if ( ! IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "This player isn't connected!" );
else if ( ! IsPlayerSpawned( pID ) ) return SendError( playerid, "The player selected isn't spawned." ); else if ( ! IsPlayerSpawned( pID ) ) return SendError( playerid, "The player selected isn't spawned." );