From 06fe16d774bfe7e5c46c568992793a6c3900e089 Mon Sep 17 00:00:00 2001 From: Damen Date: Thu, 17 Jan 2019 20:48:57 -0500 Subject: [PATCH] add casino damage fix --- .../cnr/features/visage/casino.pwn | 18 ------------------ gamemodes/sf-cnr.pwn | 9 +++++++++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/visage/casino.pwn b/gamemodes/irresistible/cnr/features/visage/casino.pwn index bae838c..6ee2402 100644 --- a/gamemodes/irresistible/cnr/features/visage/casino.pwn +++ b/gamemodes/irresistible/cnr/features/visage/casino.pwn @@ -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; - -} \ No newline at end of file diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 86f13f7..d5e3f3e 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -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