From a176b9a7014554e8d819d3d2092c70449be8c99a Mon Sep 17 00:00:00 2001 From: Damen Date: Thu, 17 Jan 2019 20:39:47 -0500 Subject: [PATCH] adds check to fix casino damaging players --- .../cnr/features/visage/casino.pwn | 18 ++++++++++++++++++ gamemodes/sf-cnr.pwn | 9 --------- scriptfiles/updates.txt | 10 +++++++++- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/visage/casino.pwn b/gamemodes/irresistible/cnr/features/visage/casino.pwn index 6ee2402..bae838c 100644 --- a/gamemodes/irresistible/cnr/features/visage/casino.pwn +++ b/gamemodes/irresistible/cnr/features/visage/casino.pwn @@ -359,3 +359,21 @@ 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 d5e3f3e..86f13f7 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -6893,15 +6893,6 @@ 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 diff --git a/scriptfiles/updates.txt b/scriptfiles/updates.txt index 981dd53..c272b53 100644 --- a/scriptfiles/updates.txt +++ b/scriptfiles/updates.txt @@ -1,6 +1,14 @@ +(+) A percentage is showed in the top donor bar, which is the required total funding of the server for the month. +(+) Server features are shown to newly registered players. (/) Breaking Cuffs is now at a 75% chance success rate. (/) Jail Multiplier is now lowered from 3 to 2. (/) /sm is no longer capped at a 90M transaction. (/) /ic send limit has been increased from 5,000 to 10,000. +(/) Player money is saved on an inflow/outflow basis. Before, it saved only when you disconnected. +(/) You need 50 score to send private messages in the server. +(/) Players can no longer damage eachother within casinos. (*) Bank Money changes now trigger it to be saved. Fixing IC & Stock selling issue. -(*) Fireworks purchasing is now functional and grants you the item upon purchase. \ No newline at end of file +(*) Fireworks purchasing is now functional and grants you the item upon purchase. +(*) Fixed issue with cop chat behaving abnormally. +(*) You cannot use /sync in jail. +(-) Knives have been removed due to abuse. \ No newline at end of file