add casino damage fix

This commit is contained in:
Damen 2019-01-17 20:48:57 -05:00
parent a176b9a701
commit 06fe16d774
2 changed files with 9 additions and 18 deletions

View File

@ -359,21 +359,3 @@ stock IsPlayerInHighRoller( playerid )
if ( ! IsPlayerInCasino( playerid ) ) return false;
return IsPlayerInArea( playerid, 2545.383056, 2592.488037, 1569.796997, 1651.173950 );
}
stock IsPlayerInCasino( playerid ) {
new world = GetPlayerVirtualWorld( playerid );
if ( GetPlayerState( playerid ) != PLAYER_STATE_ONFOOT ) return 0;
if ( GetPlayerInterior( playerid ) == VISAGE_INTERIOR && world == VISAGE_WORLD ) return 1; // visage itself
if ( IsPlayerInRangeOfPoint( playerid, 100.0, 1993.0846, 1904.5693, 84.2848 ) && world != 0 ) return 1; // visage apartments
if ( IsPlayerInRangeOfPoint( playerid, 10.0, -792.8680, 661.2518, 19.3380 ) && world == 0 ) return 1; // roycegate mansion
return ( GetPlayerInterior( playerid ) == 10 && GetPlayerVirtualWorld( playerid ) == 23 ) || ( GetPlayerInterior( playerid ) == 1 && GetPlayerVirtualWorld( playerid ) == 82 );
}
hook OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid, bodypart )
{
if ( IsPlayerInCasino( playerid ) ) return SendClientMessage( issuerid, -1, "You cannot damage players inside the casino." ), 0;
return true;
}

View File

@ -6893,6 +6893,15 @@ stock IsRandomDeathmatch( issuerid, damagedid )
return false;
}
stock IsPlayerInCasino( playerid ) {
new world = GetPlayerVirtualWorld( playerid );
if ( GetPlayerState( playerid ) != PLAYER_STATE_ONFOOT ) return 0;
if ( GetPlayerInterior( playerid ) == VISAGE_INTERIOR && world == VISAGE_WORLD ) return 1; // visage itself
if ( IsPlayerInRangeOfPoint( playerid, 100.0, 1993.0846, 1904.5693, 84.2848 ) && world != 0 ) return 1; // visage apartments
if ( IsPlayerInRangeOfPoint( playerid, 10.0, -792.8680, 661.2518, 19.3380 ) && world == 0 ) return 1; // roycegate mansion
return ( GetPlayerInterior( playerid ) == 10 && GetPlayerVirtualWorld( playerid ) == 23 ) || ( GetPlayerInterior( playerid ) == 1 && GetPlayerVirtualWorld( playerid ) == 82 );
}
stock SetPlayerPosition( playerid, Float: x, Float: y, Float: z, interiorid = 0, worldid = 0 )
{
new