From cb64786cff192aa9d0765efdfa9b71c047c5ef48 Mon Sep 17 00:00:00 2001 From: Damen Date: Sat, 6 Apr 2019 02:39:46 -0400 Subject: [PATCH 01/22] Adjusts Stephanie's Messages & Adds Changelog --- gamemodes/irresistible/cnr/features/random_messages.pwn | 4 ++-- scriptfiles/changelogs/cnr/v11.53.154.txt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 scriptfiles/changelogs/cnr/v11.53.154.txt diff --git a/gamemodes/irresistible/cnr/features/random_messages.pwn b/gamemodes/irresistible/cnr/features/random_messages.pwn index dbdbc28..2182e83 100644 --- a/gamemodes/irresistible/cnr/features/random_messages.pwn +++ b/gamemodes/irresistible/cnr/features/random_messages.pwn @@ -66,7 +66,7 @@ static stock { "{8ADE47}Stephanie:"COL_WHITE" Play Poker with your friends at any casino! Beat your way to riches!" }, { "{8ADE47}Stephanie:"COL_WHITE" Get casino rewards points by gambling at any casino! Use "COL_GREY"/casino rewards"COL_WHITE" to spend them!" }, { "{8ADE47}Stephanie:"COL_WHITE" Race your friends in a street race or outrun race by using "COL_GREY"/race"COL_WHITE"!" }, - { "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" }, + //{ "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" }, { "{8ADE47}Stephanie:"COL_WHITE" Contribute to our feature "COL_GREY"/crowdfunds"COL_WHITE"! Early supporters get benefits!" }, { "{8ADE47}Stephanie:"COL_WHITE" You can buy premium player homes using "COL_GREY"/estate"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" You can buy Irresistible Coins from players using "COL_GREY"/ic buy"COL_WHITE"!" }, @@ -101,7 +101,7 @@ hook OnServerUpdate( ) } // throttle - g_randomMessageTick = GetServerTime( ) + 30; + g_randomMessageTick = GetServerTime( ) + 60; } return Y_HOOKS_CONTINUE_RETURN_1; } diff --git a/scriptfiles/changelogs/cnr/v11.53.154.txt b/scriptfiles/changelogs/cnr/v11.53.154.txt new file mode 100644 index 0000000..5a4cfe2 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.53.154.txt @@ -0,0 +1,4 @@ +(-) Passive mode has been removed from the game. (Spawn protection still exists.) +(*) LEO Commands now check to see if a player is dead or not prior to casting. +(*) Personal Vehicle commands, such as /v park, should now work while in the water. +(/) Stephanie now sends a random message every 60 seconds rather than 30. \ No newline at end of file From ca1965b9e9b48f3772521726f82c5ac3a391576b Mon Sep 17 00:00:00 2001 From: Damen Date: Sat, 6 Apr 2019 23:15:20 -0400 Subject: [PATCH 02/22] Adds /disableemp --- .../irresistible/cnr/features/cop/_cop.pwn | 1 + .../irresistible/cnr/features/cop/emp.pwn | 98 +++++++++++++++++++ gamemodes/sf-cnr.pwn | 73 +------------- 3 files changed, 100 insertions(+), 72 deletions(-) create mode 100644 gamemodes/irresistible/cnr/features/cop/emp.pwn diff --git a/gamemodes/irresistible/cnr/features/cop/_cop.pwn b/gamemodes/irresistible/cnr/features/cop/_cop.pwn index ab2b9d4..62a65da 100644 --- a/gamemodes/irresistible/cnr/features/cop/_cop.pwn +++ b/gamemodes/irresistible/cnr/features/cop/_cop.pwn @@ -11,3 +11,4 @@ #include "irresistible\cnr\features\cop\arrest.pwn" #include "irresistible\cnr\features\cop\bail.pwn" #include "irresistible\cnr\features\cop\ticket.pwn" +#include "irresistible\cnr\features\cop\emp.pwn" \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/cop/emp.pwn b/gamemodes/irresistible/cnr/features/cop/emp.pwn new file mode 100644 index 0000000..59f2d47 --- /dev/null +++ b/gamemodes/irresistible/cnr/features/cop/emp.pwn @@ -0,0 +1,98 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Lorenc + * Module: \cnr\features\cop\emp.pwn + * Purpose: handle vehicle emp + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Commands ** */ +CMD:emp( playerid, params[ ] ) +{ + new + pID + ; + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to Police only." ); + else if ( p_inCIA{ playerid } == false || p_inArmy{ playerid } == true ) return SendError( playerid, "This is restricted to CIA only." ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/emp [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( pID == playerid ) return SendError( playerid, "You cannot do this to yourself." ); + else if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); + else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + else if ( IsPlayerAdminOnDuty( pID ) ) return SendError( playerid, "This person is an admin on duty!" ); + else if ( IsPlayerAdminOnDuty( playerid ) ) return SendError( playerid, "You cannot use this command while AOD." ); + else if ( p_Class[ pID ] == CLASS_POLICE ) return SendError( playerid, "This person is a apart of the Police Force." ); + else if ( !p_WantedLevel[ pID ] ) return SendError( playerid, "This person is innocent!" ); + else if ( !IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player isn't inside any vehicle." ); + else if ( GetPlayerState( pID ) != PLAYER_STATE_DRIVER ) return SendError( playerid, "This player is not a driver of any vehicle." ); + else if ( GetDistanceBetweenPlayers( playerid, pID ) < 30.0 ) + { + /* ** ANTI EMP SPAM ** */ + if ( p_AntiEmpSpam[ pID ] > g_iTime ) + return SendError( playerid, "You cannot EMP this person for %s.", secondstotime( p_AntiEmpSpam[ pID ] - g_iTime ) ); + /* ** END OF ANTI SPAM ** */ + + new + iVehicle = GetPlayerVehicleID( pID ); + + if ( g_buyableVehicle{ iVehicle } ) + return SendError( playerid, "Failed to place a Electromagnetic Pulse on this player's vehicle." ); + + p_AntiEmpSpam[ pID ] = g_iTime + 60; + + if ( p_AntiEMP[ pID ] > 0 ) + { + p_AntiEMP[ pID ] --; + + new + iRandom = random( 101 ); + + if ( iRandom < 90 ) + { + SendClientMessage( playerid, -1, ""COL_RED"[EMP]{FFFFFF} An Electromagnetic Pulse attempt has been repelled by an aluminum foil!" ); + SendClientMessage( pID, -1, ""COL_GREEN"[EMP]{FFFFFF} Electromagnetic Pulse had been repelled by aluminum foil set on vehicle." ); + p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; + return 1; + } + } + + SendClientMessageFormatted( pID, -1, ""COL_RED"[EMP]{FFFFFF} %s(%d) has sent an electromagnetic pulse on your vehicle causing it to crash for 30 seconds.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[EMP]{FFFFFF} You have activated a electromagnetic pulse on %s(%d)'s vehicle!", ReturnPlayerName( pID ), pID ); + p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; + SetTimerEx( "emp_deactivate", 30000, false, "d", GetPlayerVehicleID( pID ) ); + GetVehicleParamsEx( iVehicle, engine, lights, alarm, doors, bonnet, boot, objective ); + SetVehicleParamsEx( iVehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective ); + } + else SendError( playerid, "This player is not nearby." ); + return 1; +} + +CMD:demp( playerid, params[ ] ) return cmd_disableemp(playerid, params); +CMD:disableemp( playerid, params[ ] ) +{ + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to Police only." ); + else if ( p_inCIA{ playerid } == false || p_inArmy{ playerid } == true ) return SendError( playerid, "This is restricted to CIA only." ); + else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You are not in any vehicle." ); + + new + iVehicle = GetPlayerVehicleID( playerid ); + + GetVehicleParamsEx( iVehicle, engine, lights, alarm, doors, bonnet, boot, objective ); + + if ( engine != VEHICLE_PARAMS_OFF ) return SendError( playerid, "This has not been affected by any EMP attacks."); + + SetVehicleParamsEx( iVehicle, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective ); + + return SendServerMessage( playerid, "You have successfully re-initialized the vehicle." ); +} + +function emp_deactivate( vehicleid ) +{ + if ( !IsValidVehicle( vehicleid ) ) return 0; + GetVehicleParamsEx( vehicleid, engine, lights, alarm, doors, bonnet, boot, objective ); + SetVehicleParamsEx( vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective ); + return 1; +} \ No newline at end of file diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 7356a20..c11dbb3 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1670,15 +1670,6 @@ stock UntiePlayer( playerid ) SendGlobalMessage( -1, ""COL_GREY"[SERVER]{FFFFFF} %s(%d) has been untied by the anti-abuse system.", ReturnPlayerName( playerid ), playerid ); } -function emp_deactivate( vehicleid ) -{ - if ( !IsValidVehicle( vehicleid ) ) return 0; - GetVehicleParamsEx( vehicleid, engine, lights, alarm, doors, bonnet, boot, objective ); - SetVehicleParamsEx( vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective ); - return 1; -} - - public OnPlayerProgressUpdate( playerid, progressid, bool: canceled, params ) { return 1; @@ -2641,69 +2632,6 @@ thread OnPlayerWeeklyTime( playerid, irc, player[ ] ) return 1; } -CMD:emp( playerid, params[ ] ) -{ - new - pID - ; - if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to Police only." ); - else if ( p_inCIA{ playerid } == false || p_inArmy{ playerid } == true ) return SendError( playerid, "This is restricted to CIA only." ); - else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/emp [PLAYER_ID]" ); - else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); - else if ( pID == playerid ) return SendError( playerid, "You cannot do this to yourself." ); - else if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); - else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); - else if ( IsPlayerAdminOnDuty( pID ) ) return SendError( playerid, "This person is an admin on duty!" ); - else if ( p_Class[ pID ] == CLASS_POLICE ) return SendError( playerid, "This person is a apart of the Police Force." ); - else if ( !p_WantedLevel[ pID ] ) return SendError( playerid, "This person is innocent!" ); - else if ( !IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player isn't inside any vehicle." ); - else if ( GetPlayerState( pID ) != PLAYER_STATE_DRIVER ) return SendError( playerid, "This player is not a driver of any vehicle." ); - //else if ( g_buyableVehicle{ GetPlayerVehicleID( pID ) } == true ) return SendError( playerid, "Failed to place a Electromagnetic Pulse on this player's vehicle." ); - else if ( GetDistanceBetweenPlayers( playerid, pID ) < 30.0 ) - { - /* ** ANTI EMP SPAM ** */ - if ( p_AntiEmpSpam[ pID ] > g_iTime ) - return SendError( playerid, "You cannot EMP this person for %s.", secondstotime( p_AntiEmpSpam[ pID ] - g_iTime ) ); - /* ** END OF ANTI SPAM ** */ - - new - iVehicle = GetPlayerVehicleID( pID ); - - if ( g_buyableVehicle{ iVehicle } ) - return SendError( playerid, "Failed to place a Electromagnetic Pulse on this player's vehicle." ); - - p_AntiEmpSpam[ pID ] = g_iTime + 60; - - if ( p_AntiEMP[ pID ] > 0 ) - { - p_AntiEMP[ pID ] --; - - new - iRandom = random( 101 ); - - //if ( g_buyableVehicle{ iVehicle } ) - //iRandom -= 50; - - if ( iRandom < 90 ) - { - SendClientMessage( playerid, -1, ""COL_RED"[EMP]{FFFFFF} An Electromagnetic Pulse attempt has been repelled by an aluminum foil!" ); - SendClientMessage( pID, -1, ""COL_GREEN"[EMP]{FFFFFF} Electromagnetic Pulse had been repelled by aluminum foil set on vehicle." ); - p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; - return 1; - } - } - - SendClientMessageFormatted( pID, -1, ""COL_RED"[EMP]{FFFFFF} %s(%d) has sent an electromagnetic pulse on your vehicle causing it to crash for 30 seconds.", ReturnPlayerName( playerid ), playerid ); - SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[EMP]{FFFFFF} You have activated a electromagnetic pulse on %s(%d)'s vehicle!", ReturnPlayerName( pID ), pID ); - p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; - SetTimerEx( "emp_deactivate", 30000, false, "d", GetPlayerVehicleID( pID ) ); - GetVehicleParamsEx( iVehicle, engine, lights, alarm, doors, bonnet, boot, objective ); - SetVehicleParamsEx( iVehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective ); - } - else SendError( playerid, "This player is not nearby." ); - return 1; -} - public OnPlayerLoadTextdraws( playerid ) { PlayerTextDrawShow( playerid, p_LocationTD[ playerid ] ); @@ -5226,6 +5154,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) ""COL_GREY"/dss{FFFFFF} - Destroys a specified spike set id.\n"\ ""COL_GREY"/dssall{FFFFFF} - Removes all spike sets.\n"\ ""COL_GREY"/emp{FFFFFF} - Shuts down the engine of a driver's vehicle.\n"\ + ""COL_GREY"/disableemp - /demp -{FFFFFF} - Reinitializes the engine of a driver's vehicle.\n"\ ""COL_GREY"/bruteforce{FFFFFF} - Brute forces a houses' password." ); ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Police Commands", szCMDS, "Okay", "Back" ); } From 9fc85cc224db434f25fe3181b7dd3cdf23003f3c Mon Sep 17 00:00:00 2001 From: Damen Date: Sun, 7 Apr 2019 20:49:40 -0400 Subject: [PATCH 03/22] Name Directed Adjustments Changed names to Damen instead of Lorenc for issues. --- gamemodes/irresistible/cnr/commands/cmd_help.pwn | 2 +- .../irresistible/cnr/features/gangs/gangs.pwn | 2 +- .../irresistible/cnr/features/houses/house.pwn | 4 ++-- .../cnr/features/player/irresistibleguard.pwn | 2 +- .../irresistible/cnr/features/robbery/clerks.pwn | 2 +- .../irresistible/cnr/features/vip/coin_market.pwn | 14 +++++++------- .../irresistible/cnr/features/vip/player_note.pwn | 2 +- .../irresistible/cnr/features/vip/redeem_code.pwn | 6 +++--- .../irresistible/cnr/features/visage/blackjack.pwn | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/cmd_help.pwn b/gamemodes/irresistible/cnr/commands/cmd_help.pwn index b103d51..5526263 100644 --- a/gamemodes/irresistible/cnr/commands/cmd_help.pwn +++ b/gamemodes/irresistible/cnr/commands/cmd_help.pwn @@ -58,7 +58,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) return cmd_help( playerid, "" ); if ( listitem >= 64 ) - return SendError( playerid, "Unable to process request, contact Lorenc in regards to this." ); + return SendError( playerid, "Unable to process request, contact Damen in regards to this." ); new digits[ 64 ]; diff --git a/gamemodes/irresistible/cnr/features/gangs/gangs.pwn b/gamemodes/irresistible/cnr/features/gangs/gangs.pwn index ce9f7f2..0e4b538 100644 --- a/gamemodes/irresistible/cnr/features/gangs/gangs.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/gangs.pwn @@ -639,7 +639,7 @@ thread OnPlayerGangLoaded( playerid ) else { p_GangID[ playerid ] = -1; - SendServerMessage( playerid, "Had an issue loading your gang. Contact Lorenc (0x92F)." ); + SendServerMessage( playerid, "Had an issue loading your gang. Contact Damen (0x92F)." ); printf("[GANG] [ERROR] Had an issue loading a gang row id %d", gang_sql_id ); } } diff --git a/gamemodes/irresistible/cnr/features/houses/house.pwn b/gamemodes/irresistible/cnr/features/houses/house.pwn index 992029a..a3d91f2 100644 --- a/gamemodes/irresistible/cnr/features/houses/house.pwn +++ b/gamemodes/irresistible/cnr/features/houses/house.pwn @@ -630,10 +630,10 @@ thread OnHouseLoad( ) } printf( "[HOUSES]: %d houses have been loaded. (Tick: %dms)", rows, GetTickCount( ) - loadingTick ); - // Make Lorenc the owner of unowned VIP houses + // Make Damen the owner of unowned VIP houses foreach ( new houseid : houses ) if ( g_houseData[ houseid ] [ E_COST ] < 10000 ) { if ( strmatch( g_houseData[ houseid ] [ E_OWNER ], "No-one" ) ) { - SetHouseOwner( houseid, 1, "Lorenc" ); + SetHouseOwner( houseid, 1, "Damen" ); } } return 1; diff --git a/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn b/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn index b1cba72..889f9b5 100644 --- a/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn +++ b/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn @@ -353,7 +353,7 @@ thread OnAccountGuardDelete( playerid ) ; if ( id != p_accountSecurityData[ playerid ] [ E_ID ] ) - return SendError( playerid, "Something is wrong with your email. Talk to Lorenc." ), 1; + return SendError( playerid, "Something is wrong with your email. Talk to Damen." ), 1; if ( g_iTime - last_changed < 300 ) { return SendError( playerid, "You can use this feature in %s.", secondstotime( 300 - ( g_iTime - last_changed ) ) ); diff --git a/gamemodes/irresistible/cnr/features/robbery/clerks.pwn b/gamemodes/irresistible/cnr/features/robbery/clerks.pwn index cdad707..0de4a0d 100644 --- a/gamemodes/irresistible/cnr/features/robbery/clerks.pwn +++ b/gamemodes/irresistible/cnr/features/robbery/clerks.pwn @@ -557,7 +557,7 @@ function OnPlayerHoldupStore( playerid, clerkid, step ) } if ( !( 0 <= amount < 10000 ) ) - return SendError( playerid, "A money exploit occurred. Contact Lorenc ASAP." ); + return SendError( playerid, "A money exploit occurred. Contact Damen ASAP." ); GivePlayerCash( playerid, amount ); GivePlayerExperience( playerid, E_ROBBERY, 0.2 ); // give 10% of what it normally does, since it does this for like 4-5 times diff --git a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn index b40adf2..c7f2580 100644 --- a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn +++ b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn @@ -210,11 +210,11 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) // Redirect player if ( selected_vip == VIP_DIAMOND ) { - ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else if ( selected_vip == VIP_PLATINUM ) { - ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else { @@ -416,12 +416,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) if ( sscanf( inputtext, "u", pID ) ) { SendError( playerid, "Please enter a player's ID or name." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else if ( !IsPlayerConnected( pID ) ) { SendError( playerid, "This player is not connected." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else { @@ -447,12 +447,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) if ( sscanf( inputtext, "u", pID ) ) { SendError( playerid, "Please enter a player's ID or name." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else if ( !IsPlayerConnected( pID ) ) { SendError( playerid, "This player is not connected." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else { @@ -801,7 +801,7 @@ static stock ShowPlayerVipRedeemedDialog( playerid ) ""COL_GREY" * What are the commands?"COL_WHITE" Use /vipcmds to view a detailed list of VIP commands.\n"\ ""COL_GREY" * What did I receive?"COL_WHITE" Check through your V.I.P package contents via our site (forum -> announcements board).\n" ); strcat( szLargeString, ""COL_GREY" * How to redeem my houses/vehicles?"COL_WHITE" You will be announced to the admins and noted down for assistance, so please wait!\n"\ - ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Lorenc via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" ); + ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Damen via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" ); ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" ); } diff --git a/gamemodes/irresistible/cnr/features/vip/player_note.pwn b/gamemodes/irresistible/cnr/features/vip/player_note.pwn index c440c10..45de4a6 100644 --- a/gamemodes/irresistible/cnr/features/vip/player_note.pwn +++ b/gamemodes/irresistible/cnr/features/vip/player_note.pwn @@ -146,7 +146,7 @@ thread deleteplayernote( playerid, noteid ) if ( rows ) { SaveToAdminLog( playerid, noteid, "removed note" ); mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", p_AccountID[ playerid ], noteid ) ); - SendServerMessage( playerid, "You have removed note id %d. If there are any problems, contact Lorenc/Council.", noteid ); + SendServerMessage( playerid, "You have removed note id %d. If there are any problems, contact Damen/Council.", noteid ); AddAdminLogLineFormatted( "%s(%d) has deleted note id %d", ReturnPlayerName( playerid ), playerid, noteid ); return 1; } diff --git a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn index e636f41..a8b1a96 100644 --- a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn @@ -44,7 +44,7 @@ hook OnScriptInit( ) SetDynamicObjectMaterialText( ( g_TopDonorWall = CreateDynamicObject( 3074, -1574.3559, 885.1296, 14.0153, 0.0000, 0.0000, -0.0156 ) ), 0, "Nobody donated :(", 130, "Arial", 48, 0, -65536, 0, 1 ); // Latest Donor TD - g_TopDonorTD = TextDrawCreate(320.000000, 2.000000, "Top Donor Lorenc - $0.00, ~w~~h~~h~Latest Donor Lorenc - $0.00"); + g_TopDonorTD = TextDrawCreate(320.000000, 2.000000, "Top Donor Damen - $0.00, ~w~~h~~h~Latest Donor Damen - $0.00"); TextDrawAlignment(g_TopDonorTD, 2); TextDrawBackgroundColor(g_TopDonorTD, 0); TextDrawFont(g_TopDonorTD, 1); @@ -87,7 +87,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) strcat( szLargeString, ""COL_WHITE"Thank you a lot for donating! :D In return for your dignity, you have received Irresistible Coins.\n\n"\ ""COL_GREY" * What do I do with Irresistible Coins?"COL_WHITE" You can claim the V.I.P of your choice via "COL_GREY"/irresistiblecoins market"COL_WHITE".\n" ); strcat( szLargeString, ""COL_GREY" * How many do I have?"COL_WHITE" You can see how many Irresistible Coins you have via "COL_GREY"/irresistiblecoins"COL_WHITE".\n" \ - ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Lorenc via the forums!\n\nThank you once again for your contribution to our community! :P" ); + ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Damen via the forums!\n\nThank you once again for your contribution to our community! :P" ); return ShowPlayerDialog( playerid, DIALOG_FINISHED_DONATING, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" ); } else if ( dialogid == DIALOG_FINISHED_DONATING ) @@ -97,7 +97,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) else if ( dialogid == DIALOG_LATEST_DONOR ) { if ( GetPVarType( playerid, "just_donated" ) != PLAYER_VARTYPE_FLOAT ) - return SendError( playerid, "Seems to be an issue where we couldn't find how much you donated. Report to Lorenc." ); + return SendError( playerid, "Seems to be an issue where we couldn't find how much you donated. Report to Damen." ); new Float: fAmount = GetPVarFloat( playerid, "just_donated" ); diff --git a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn index 800bf0c..b57c66f 100644 --- a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn +++ b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn @@ -706,7 +706,7 @@ stock SendClientMessageToBlackjack( tableid, colour, format[ ], va_args<> ) stock InitializeBlackjackTextdraws( id ) { - g_blackjackTurnTD[ id ] = TextDrawCreate(330.000000, 204.000000, "Lorenc has 5 seconds"); + g_blackjackTurnTD[ id ] = TextDrawCreate(330.000000, 204.000000, "Damen has 5 seconds"); TextDrawAlignment(g_blackjackTurnTD[ id ], 2); TextDrawBackgroundColor(g_blackjackTurnTD[ id ], 255); TextDrawFont(g_blackjackTurnTD[ id ], 1); From da68b881cb975708ec99be6fcc32557c1f613388 Mon Sep 17 00:00:00 2001 From: Damen Date: Mon, 8 Apr 2019 01:13:20 -0400 Subject: [PATCH 04/22] additions and changes - adds /chatban - adds /chatbanlist - adds migration file to support chatban - adjusts admin level commands to reflect new commands and also old - moves command into correct admin level file --- gamemodes/irresistible/cnr/auth/account.pwn | 4 + .../cnr/commands/admin/_admin.pwn | 35 +----- .../cnr/commands/admin/admin_one.pwn | 28 +++++ .../cnr/commands/admin/admin_three.pwn | 109 ++++++++++++------ .../cnr/commands/admin/admin_two.pwn | 34 ++++++ gamemodes/irresistible/cnr/player.pwn | 5 + .../cnr/20190405_cnr_chat_ban_creation | 14 +++ gamemodes/sf-cnr.pwn | 14 ++- 8 files changed, 174 insertions(+), 69 deletions(-) create mode 100644 gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation diff --git a/gamemodes/irresistible/cnr/auth/account.pwn b/gamemodes/irresistible/cnr/auth/account.pwn index ec63404..ad59eb0 100644 --- a/gamemodes/irresistible/cnr/auth/account.pwn +++ b/gamemodes/irresistible/cnr/auth/account.pwn @@ -315,6 +315,10 @@ thread OnAttemptPlayerLogin( playerid, password[ ] ) // Log in player SendServerMessage( playerid, "You have " COL_GREEN "successfully" COL_WHITE " logged in!" ); + + // Chat Ban Player + format( szBigString, sizeof( szBigString ), "SELECT * FROM `CHAT_BANS` WHERE `ID` = '%d' LIMIT 0,1", p_AccountID[ playerid ] ); + mysql_function_query( dbHandle, szBigString, true, "ChatBanUponLogin", "d", playerid ); } else { diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index 68c1e89..2c3137b 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -72,11 +72,13 @@ static stock { 2, "/mute", "Muting a player" }, { 2, "/unmute", "Unmuting a player" }, { 2, "/kick", "Kicking a player from the server" }, + { 2, "/smlog", "Cash transaction log from a player" }, + { 2, "/iclog", "IC transaction log from a player" }, /* ** Level 3 Commands ** */ + { 3, "/chatban", "Bans a player from using all forms of chat" }, + { 3, "/unchatban", "Unbans a player from using all forms of chat" }, { 3, "/banlog", "Finding ban information about a player" }, - { 3, "/smlog", "Cash transaction log from a player" }, - { 3, "/iclog", "IC transaction log from a player" }, { 3, "/resetwep", "Resetting weapons from a player" }, { 3, "/getip", "Getting IP of a player" }, { 3, "/geolocate", "Geographical location of a player" }, @@ -105,6 +107,7 @@ static stock { 3, "/countdown", "Countdown" }, { 3, "/pingimmune", "Making a player immune from ping kicker" }, { 3, "/ban", "Banning a player" }, + { 3, "/forceac" "Force a player to use CAC while playing the server" }, { 3, "/bring", "Bring a player to you" }, /* ** Level 4 Commands ** */ @@ -260,34 +263,6 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) return 1; } -/*CMD:acmds( playerid, params[ ] ) -{ - if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - SendClientMessage( playerid, COLOR_GREY, "|______________________________________| Admin Commands |_____________________________________|" ); - SendClientMessage( playerid, COLOR_WHITE, " " ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /goto, /spec(off), /(un)jail, /asay, /slap, /a, /getstats, /stpfr, /setskin, /frules, /fpc, /ticketlog" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /pinfo, /warn, /aspawn, /ans, /stpfa, /alog, /(un)freeze, /aod, /respawnalluv, /reports, /questions" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /respond, /mutelist, /aka, /arepair, /viewdeathmsg" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 2: /kick, /vdestroy, /(un)mute, /explode, /vrespawn, /arenas, /suspend, /viewnotes, /slay" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /ban, /bring, /clearchat, /(ann)ounce, /giveweapon, /vadminpark, /vcreate, /healall, /getip, /smlog, /iclog" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /vadminstats, /pingimmune, /vbring, /countdown, /forcecoptutorial, /vgoto, /copwarn, /armywarn, /resetwep" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /venter, /geolocate" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 4: /circleall, /giveweaponall, /resetwepall, /motd, /uncopban, /unarmyban, /setworld, /destroyallav, /gotopos" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 4: /addnote, /removenote" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /createhouse, /destroyhouse, /respawnallv, /achangename, /toggleviewpm, /unban(ip)" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /createcar, /destroycar, /stripcarmods, /createbribe, /destroybribe, /doublexp, /(h/v)adminsell" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /autovehrespawn, /megaban, /acunban, /creategate, /editgate, /connectsong, /discordurl" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /creategarage, /destroygarage, /check, /reconnectchuff" ); - - if ( p_AdminLevel[ playerid ] > 5 ) { - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 6: /setirc, /seteventhost, /setlevel, /setleveloffline, /svrstats, /playaction, /playanimation" ); - SendClientMessage( playerid, COLOR_WHITE, " LEVEL 6: /updaterules, /truncate, /broadcast, /setgangleader, /viewgangtalk, /createentrance, /destroyentrance" ); - } - - SendClientMessage( playerid, COLOR_GREY, "|_____________________________________________________________________________________________|" ); - return 1; -}*/ - /* ** Modules ** */ #include "irresistible\cnr\commands\admin\admin_one.pwn" #include "irresistible\cnr\commands\admin\admin_two.pwn" diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn index 7c0ae98..e7d751c 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn @@ -714,3 +714,31 @@ CMD:mutelist( playerid, params[ ] ) else return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Muted List", szNormalString, "Close", "" ), 1; } + +CMD:chatbanlist( playerid, params[ ] ) +{ + new + count = 0; + + if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + + szNormalString[ 0 ] = '\0'; + foreach( new i : Player ) + { + if ( p_ChatBanned{ i } ) + { + format( szNormalString, sizeof( szNormalString ), "%s"COL_WHITE"%s(%d)\t"COL_GREY"By %s for '%s'\n", + szNormalString, + ReturnPlayerName( i ), i, + p_ChatBannedBy[ playerid ], + p_ChatBanReason[ playerid ] + ); + + count ++; + } + } + if ( count == 0 ) + return SendError( playerid, "There are no chat banned players online." ); + else + return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Chat Ban List", szNormalString, "Close", "" ), 1; +} \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn index e01717f..d3a63af 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn @@ -6,40 +6,6 @@ */ /* ** Commands ** */ -CMD:smlog( playerid, params[ ] ) -{ - new - pID - ; - - if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/smlog [PLAYER_ID]" ); - else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); - else - { - format( szBigString, 160, "SELECT u.`NAME`,t.`CASH`,t.`DATE` FROM `TRANSACTIONS` t INNER JOIN `USERS` u ON t.`TO_ID`=u.`ID` WHERE FROM_ID=%d ORDER BY DATE DESC LIMIT 10", p_AccountID[ pID ] ); - mysql_function_query( dbHandle, szBigString, true, "readmoneylog", "dd", playerid, pID ); - } - return 1; -} - -CMD:iclog( playerid, params[ ] ) -{ - new - pID - ; - - if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/iclog [PLAYER_ID]" ); - else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); - else - { - format( szBigString, 160, "SELECT u.`NAME`,t.`IC`,t.`DATE` FROM `TRANSACTIONS_IC` t INNER JOIN `USERS` u ON t.`TO_ID`=u.`ID` WHERE FROM_ID=%d ORDER BY DATE DESC LIMIT 10", p_AccountID[ pID ] ); - mysql_function_query( dbHandle, szBigString, true, "readiclog", "dd", playerid, pID ); - } - return 1; -} - CMD:resetwep( playerid, params[ ] ) { new @@ -622,9 +588,9 @@ CMD:forceac( playerid, params[ ] ) pID; if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "u", pID ) ) SendUsage( playerid, "/forceac [PLAYER_ID]" ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/forceac [PLAYER_ID]" ); else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); - else if ( pID == playerid ) return SendError( playerid, "You cant use this command on yourself." ); + else if ( pID == playerid ) return SendError( playerid, "You can't use this command on yourself." ); else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." ); //else if ( GetPlayerScore( pID ) < 100 ) return SendError( playerid, "This player's score is under 100, please spectate instead." ); else @@ -643,4 +609,75 @@ CMD:forceac( playerid, params[ ] ) } } return 1; +} + +CMD:chatban( playerid, params[ ] ) +{ + + new pID, reason[ 25 ]; + + if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "us[50]", pID, reason ) ) return SendUsage( playerid, "/chatban [PLAYER_ID] [REASON]" ); + else if ( strlen( reason ) < 3 || strlen( reason ) > 25 ) return SendError( playerid, "Please keep your chat ban reason between 3 - 25 characters." ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( pID == playerid ) return SendError( playerid, "You can't use this command on yourself." ); + else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." ); + else if ( IsPlayerChatBanned( pID ) ) return SendError( playerid, "This player is already chat banned." ); + else + { + p_ChatBanned{ pID } = true; + p_ChatBannedBy[ pID ] = ReturnPlayerName( playerid ); + p_ChatBanReason[ pID ] = reason; + mysql_single_query( sprintf( "INSERT INTO `CHAT_BANS` (`ID`, `NAME`, `BANNED_BY_ID`, `BANNED_BY`, `REASON`) VALUES (%d, '%s', %d, '%s', '%s')", p_AccountID[ pID ], mysql_escape( ReturnPlayerName( pID ) ), p_AccountID[ playerid ], mysql_escape( ReturnPlayerName( playerid ) ), mysql_escape( reason ) ) ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat banned by %s for '%s'.", ReturnPlayerName( pID ), reason ); + AddAdminLogLineFormatted( "%s(%d) has chat banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + SaveToAdminLog( playerid, p_AccountID[ pID ], "chat ban" ); + } + + return 1; +} + +CMD:unchatban( playerid, params[ ] ) +{ + + new pID; + + if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/chatban [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( pID == playerid ) return SendError( playerid, "You can't use this command on yourself." ); + else if ( !IsPlayerChatBanned( pID ) ) return SendError( playerid, "This player is not chat banned." ); + else + { + p_ChatBanned{ pID } = false; + mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( pID ) ); + AddAdminLogLineFormatted( "%s(%d) has chat unbanned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + SaveToAdminLog( playerid, p_AccountID[ pID ], "chat unban" ); + } + + return 1; + +} + +thread ChatBanUponLogin( playerid ) +{ + new + rows, fields + ; + cache_get_data( rows, fields ); + + if ( rows ) + { + new banned_by[ MAX_PLAYER_NAME ], reason[ 25 ]; + + cache_get_field_content( 0, "BANNED_BY", banned_by ); + cache_get_field_content( 0, "REASON", reason ); + + p_ChatBanned{ playerid } = true; + p_ChatBannedBy[ playerid ] = banned_by; + p_ChatBanReason[ playerid ] = reason; + print("done with chatbanuponlogin"); + } + return 1; } \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn index 5921793..715fbcd 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn @@ -6,6 +6,40 @@ */ /* ** Commands ** */ +CMD:smlog( playerid, params[ ] ) +{ + new + pID + ; + + if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/smlog [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else + { + format( szBigString, 160, "SELECT u.`NAME`,t.`CASH`,t.`DATE` FROM `TRANSACTIONS` t INNER JOIN `USERS` u ON t.`TO_ID`=u.`ID` WHERE FROM_ID=%d ORDER BY DATE DESC LIMIT 10", p_AccountID[ pID ] ); + mysql_function_query( dbHandle, szBigString, true, "readmoneylog", "dd", playerid, pID ); + } + return 1; +} + +CMD:iclog( playerid, params[ ] ) +{ + new + pID + ; + + if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/iclog [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else + { + format( szBigString, 160, "SELECT u.`NAME`,t.`IC`,t.`DATE` FROM `TRANSACTIONS_IC` t INNER JOIN `USERS` u ON t.`TO_ID`=u.`ID` WHERE FROM_ID=%d ORDER BY DATE DESC LIMIT 10", p_AccountID[ pID ] ); + mysql_function_query( dbHandle, szBigString, true, "readiclog", "dd", playerid, pID ); + } + return 1; +} + CMD:slay( playerid, params[ ] ) { new diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 88f36fe..142fbdc 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -52,6 +52,9 @@ new // p_XP [ MAX_PLAYERS ], bool: p_Spectating [ MAX_PLAYERS char ], bool: p_Muted [ MAX_PLAYERS char ], + bool: p_ChatBanned [ MAX_PLAYERS char ], + p_ChatBannedBy [ MAX_PLAYERS ] [ MAX_PLAYER_NAME ], + p_ChatBanReason [ MAX_PLAYERS ] [ 25 ], bool: p_InfectedHIV [ MAX_PLAYERS char ], p_AntiTextSpam [ MAX_PLAYERS ], bool: p_BlockedPM [ MAX_PLAYERS ] [ MAX_PLAYERS ], @@ -218,3 +221,5 @@ stock IsPlayerSpawned( playerid ) return p_Spawned{ playerid }; stock IsPlayerJailed( playerid ) return p_Jailed{ playerid }; stock IsPlayerAdminOnDuty( playerid ) return p_AdminOnDuty{ playerid }; + +stock IsPlayerChatBanned( playerid ) return p_ChatBanned{ playerid }; \ No newline at end of file diff --git a/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation b/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation new file mode 100644 index 0000000..697b008 --- /dev/null +++ b/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation @@ -0,0 +1,14 @@ +-- CREATE A MIGRATION ENTRY +INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190405_cnr_chat_ban_creation'); + +--BEGIN + +-- CREATE TABLE +CREATE TABLE IF NOT EXISTS `CHAT_BANS` ( + `ID` int(11) NOT NULL, + `NAME` varchar(25) DEFAULT NULL, + `BANNED_BY_ID` int(11) NOT NULL, + `BANNED_BY` varchar(25) DEFAULT NULL, + `REASON` varchar(25) DEFAULT NULL, + UNIQUE KEY `ID` (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index c11dbb3..f66a3bb 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -521,6 +521,9 @@ public OnPlayerDisconnect( playerid, reason ) p_Cuffed { playerid } = false; justConnected { playerid } = true; p_Muted { playerid } = false; + p_ChatBanned { playerid } = false; + p_ChatBannedBy [ playerid ] [ 0 ] = '\0'; + p_ChatBanReason [ playerid ] [ 0 ] = '\0'; p_MetalMelter [ playerid ] = 0; p_LeftCuffed { playerid } = false; p_PmResponder [ playerid ] = INVALID_PLAYER_ID; @@ -1508,12 +1511,15 @@ public OnPlayerText( playerid, text[ ] ) return SendError( playerid, "An error occured, please try again." ), 0; #endif + if ( IsPlayerChatBanned( playerid ) ) + return SendError( playerid, "You have been chat banned and are not allowed to chat."), 0; + if ( textContainsIP( text ) ) return SendServerMessage( playerid, "Please do not advertise." ), 0; new tick_count = GetTickCount( ); - if ( p_AntiTextSpam[ playerid ] > tick_count ) + if ( p_AntiTextSpam[ playerid ] > tick_count && p_AdminLevel[ playerid ] != 6 ) { p_AntiTextSpam[ playerid ] = tick_count + 750; p_AntiTextSpamCount{ playerid } ++; @@ -2105,7 +2111,8 @@ CMD:cw( playerid, params[ ] ) return cmd_carwhisper( playerid, params ); CMD:carwhisper( playerid, params[ ] ) { new msg[ 100 ]; - if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You must be inside a vehicle to use this command." ); + if ( p_ChatBanned{ playerid } ) return SendError( playerid, "You have been chat banned and are not allowed to chat." ); + else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You must be inside a vehicle to use this command." ); else if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/carwhisper [MESSAGE]" ); else if ( textContainsIP( msg ) ) return SendError( playerid, "Advertising is forbidden." ); else @@ -2124,7 +2131,8 @@ CMD:w( playerid, params[ ] ) return cmd_whisper( playerid, params ); CMD:whisper( playerid, params[ ] ) { new msg[ 100 ]; - if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/whisper [MESSAGE]" ); + if ( p_ChatBanned{ playerid } ) return SendError( playerid, "You have been chat banned and are not allowed to chat." ); + else if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/whisper [MESSAGE]" ); else if ( textContainsIP( msg ) ) return SendError( playerid, "Advertising is forbidden." ); else { From acc1f2318c91145819b929c5b96e062e5c83b0c0 Mon Sep 17 00:00:00 2001 From: Damen Date: Mon, 8 Apr 2019 01:17:32 -0400 Subject: [PATCH 05/22] create changelog v11.54.157 --- scriptfiles/changelogs/cnr/v11.54.157.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 scriptfiles/changelogs/cnr/v11.54.157.txt diff --git a/scriptfiles/changelogs/cnr/v11.54.157.txt b/scriptfiles/changelogs/cnr/v11.54.157.txt new file mode 100644 index 0000000..bdc7eaa --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.54.157.txt @@ -0,0 +1,4 @@ +(+) Adds /(demp)disableemp to reinitialize a recently EMP'd vehicle. +(+) Adds /(un)chatban to ban low quality members from chat instead of banning. +(+) Adds /chatbanlist to view all online chat banned members. +(*) Moved /smlog and /iclog for admins into their correct level section of /acmds. \ No newline at end of file From 0866adc2bad5bed80c8f1fb92c8e8ab0f97ee928 Mon Sep 17 00:00:00 2001 From: Damen Date: Mon, 8 Apr 2019 01:48:29 -0400 Subject: [PATCH 06/22] adjusts changelogs.cfg --- scriptfiles/changelogs/cnr/_changelogs.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index 1f64f0e..2090170 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -1,3 +1,5 @@ +v11.54.157 +v11.53.154 v11.52.150 v11.50.142 v11.50.140 \ No newline at end of file From a05da377877513f154d45f725e40622e0a77be6a Mon Sep 17 00:00:00 2001 From: Damen Date: Mon, 8 Apr 2019 18:37:52 -0400 Subject: [PATCH 07/22] fixes minor /acmds typo --- gamemodes/irresistible/cnr/commands/admin/_admin.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index 2c3137b..d4c6574 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -107,7 +107,7 @@ static stock { 3, "/countdown", "Countdown" }, { 3, "/pingimmune", "Making a player immune from ping kicker" }, { 3, "/ban", "Banning a player" }, - { 3, "/forceac" "Force a player to use CAC while playing the server" }, + { 3, "/forceac", "Force a player to use CAC while playing the server" }, { 3, "/bring", "Bring a player to you" }, /* ** Level 4 Commands ** */ From 654b304d2f2715000e6578e5acad883cdeaaef46 Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 00:55:02 -0400 Subject: [PATCH 08/22] adds discord in-game command --- gamemodes/irresistible/cnr/discord/discord_commands.pwn | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gamemodes/irresistible/cnr/discord/discord_commands.pwn b/gamemodes/irresistible/cnr/discord/discord_commands.pwn index 748c5de..005aa28 100644 --- a/gamemodes/irresistible/cnr/discord/discord_commands.pwn +++ b/gamemodes/irresistible/cnr/discord/discord_commands.pwn @@ -452,4 +452,10 @@ DQCMD:rcon( DCC_Channel: channel, DCC_User: user, params[ ] ) } } return 1; +} + +/* ** In-Game Discord Commands * **/ +CMD:discord( playerid, params[ ] ) +{ + return SendServerMessage( playerid, "You can access our Discord server at {7289da}sfcnr.com/discord" ); } \ No newline at end of file From c95767b7fa28aab7afcea827b094df1885b3bcaa Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 01:06:06 -0400 Subject: [PATCH 09/22] removes ability to use /perks will in army vehicles --- gamemodes/irresistible/cnr/features/perks.pwn | 7 +++++-- gamemodes/sf-cnr.pwn | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/perks.pwn b/gamemodes/irresistible/cnr/features/perks.pwn index 457950f..f3993be 100644 --- a/gamemodes/irresistible/cnr/features/perks.pwn +++ b/gamemodes/irresistible/cnr/features/perks.pwn @@ -217,9 +217,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) /* ** Commands ** */ CMD:perks( playerid, params[ ] ) { - if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) { + if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); - } + + if ( IsPlayerInArmyVehicle( playerid ) ) + return SendError( playerid, "You cannot use this command while in an army vehicle." ); + return ShowPlayerDialog( playerid, DIALOG_PERKS, DIALOG_STYLE_LIST, "{FFFFFF}Game Perks", "Player Perks\nVehicle Perks", "Select", "Cancel" ); } diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index f66a3bb..0e5566a 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -7063,4 +7063,17 @@ stock IsPlayerDead( playerid ) return health <= 0.0; return GetPlayerState( playerid ) == PLAYER_STATE_WASTED; +} + +stock IsPlayerInArmyVehicle( playerid ) +{ + new + vehicleid = GetPlayerVehicleID( playerid ), + vehiclemodelid = GetVehicleModel( vehicleid ) + ; + + if ( vehiclemodelid == 425 || vehiclemodelid == 432 || vehiclemodelid == 520 ) //Rhino, Tank, Hydra + return true; + else + return false; } \ No newline at end of file From d9477703280a0d06759a3750a9cea57d3263e6fe Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 01:12:58 -0400 Subject: [PATCH 10/22] increase house list text for spawn --- gamemodes/irresistible/helpers.pwn | 1 + gamemodes/sf-cnr.pwn | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gamemodes/irresistible/helpers.pwn b/gamemodes/irresistible/helpers.pwn index b61b8c6..9d405db 100644 --- a/gamemodes/irresistible/helpers.pwn +++ b/gamemodes/irresistible/helpers.pwn @@ -41,6 +41,7 @@ stock szNormalString[ 144 ]; stock szBigString[ 256 ]; stock szLargeString[ 1024 ]; stock szHugeString[ 2048 ]; +stock szMassiveString[ 4096 ]; stock g_szSprintfBuffer[ 1024 ]; stock tmpVariable; diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 0e5566a..614eee1 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5594,7 +5594,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) new bool: has = false; // erase large string for ease - erase( szHugeString ); + erase( szMassiveString ); erase( szLargeString ); // show items @@ -5611,13 +5611,13 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) case 1: { foreach ( new i : houses ) if ( strmatch( g_houseData[ i ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) { - format( szHugeString, sizeof( szHugeString ), "%s%s\n", szHugeString, g_houseData[ i ] [ E_HOUSE_NAME ] ), has = true; + format( szMassiveString, sizeof( szMassiveString ), "%s%s\n", szMassiveString, g_houseData[ i ] [ E_HOUSE_NAME ] ), has = true; } if ( ! has ) return SendError( playerid, "You do not own any home." ), ShowPlayerSpawnMenu( playerid ); - return ShowPlayerDialog( playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, "{FFFFFF}Set Spawn Location", szHugeString, "Select", "Back" ); + return ShowPlayerDialog( playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, "{FFFFFF}Set Spawn Location", szMassiveString, "Select", "Back" ); } // businesses From 43303726de8a1d442a3c4a5736c920cf63174f5b Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 01:40:28 -0400 Subject: [PATCH 11/22] adds 'hide gambling win msgs' setting in cp --- .../irresistible/cnr/features/player/player_settings.pwn | 5 +++-- gamemodes/irresistible/cnr/features/visage/blackjack.pwn | 8 ++++++-- gamemodes/irresistible/cnr/features/visage/roulette.pwn | 6 +++++- .../irresistible/cnr/features/visage/slot_machines.pwn | 7 ++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index fed63e4..3208cd2 100644 --- a/gamemodes/irresistible/cnr/features/player/player_settings.pwn +++ b/gamemodes/irresistible/cnr/features/player/player_settings.pwn @@ -9,7 +9,7 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define MAX_SETTINGS ( 12 ) +#define MAX_SETTINGS ( 13 ) #define SETTING_BAILOFFERS ( 0 ) #define SETTING_EVENT_TP ( 1 ) @@ -23,13 +23,14 @@ #define SETTING_COINS_BAR ( 9 ) #define SETTING_TOP_DONOR ( 10 ) #define SETTING_WEAPON_PICKUP ( 11 ) +#define SETTING_HIDE_GAMB_MSG ( 12 ) /* ** Variables ** */ static stock g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = { { "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" }, { "Display User ID In Chat" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" }, - { "Manual Pickup Weapon" } + { "Manual Pickup Weapon" }, { "Hide Gambling Win Msgs" } }, bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ] ; diff --git a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn index b57c66f..0a2d1bb 100644 --- a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn +++ b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn @@ -627,8 +627,12 @@ stock CheckForBlackjack( tableid ) // alert world if ( g_blackjackPlayerState[ tableid ] [ player_index ] == BLACKJACK_STATE_WIN && payout > g_blackjackData[ tableid ] [ E_PAYOUT ] && payout >= 10000 ) { UpdateServerVariable( "blackjack_wins", 0, GetGVarFloat( "blackjack_wins" ) + ( float( payout ) / 1000000.0 ), "", GLOBAL_VARTYPE_FLOAT ); - SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); - } + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); + } + } } } return dealer_score; diff --git a/gamemodes/irresistible/cnr/features/visage/roulette.pwn b/gamemodes/irresistible/cnr/features/visage/roulette.pwn index 40a3953..d509f1e 100644 --- a/gamemodes/irresistible/cnr/features/visage/roulette.pwn +++ b/gamemodes/irresistible/cnr/features/visage/roulette.pwn @@ -686,7 +686,11 @@ public OnRouletteWheelStop( rouletteid, winner ) // inform users if ( profit >= 10000 ) { - SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); + } } // give user points diff --git a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn index 98a84f4..fd7c0e2 100644 --- a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn +++ b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn @@ -288,7 +288,12 @@ public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, thir // alert user if ( iNetWin > g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] ) { SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, cash_format( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] >= 25000 ? ( "Visage" ) : ( "Caligulas" ) ) ); - } else { + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, cash_format( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] >= 25000 ? ( "Visage" ) : ( "Caligulas" ) ) ); + } + } else { SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", cash_format( iNetWin ) ); } From f55d13d7c69dc1c089b9898e63d2622785a8e951 Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 18:13:24 -0400 Subject: [PATCH 12/22] reduces /admins score req. to 50 --- gamemodes/sf-cnr.pwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 614eee1..a068a40 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -2150,8 +2150,8 @@ CMD:whisper( playerid, params[ ] ) CMD:admins( playerid, params[ ] ) { - if ( GetPlayerScore( playerid ) < 500 && !IsPlayerUnderCover( playerid ) && p_AdminLevel[ playerid ] < 1 ) - return SendError( playerid, "You need at least 500 score to view the online adminstrators." ); + if ( GetPlayerScore( playerid ) < 50 && !IsPlayerUnderCover( playerid ) && p_AdminLevel[ playerid ] < 1 ) + return SendError( playerid, "You need at least 50 score to view the online adminstrators." ); new g_adminList[ MAX_PLAYERS ] [ 2 ], bool: is_empty = true; From 50220121fc0cfd9a7f9c479ff5231dcf3efdf120 Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 19:30:42 -0400 Subject: [PATCH 13/22] fixes vip commands guide --- gamemodes/sf-cnr.pwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index a068a40..d76ca6d 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5209,7 +5209,13 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) case 8: { if ( p_VIPLevel[ playerid ] < VIP_REGULAR ) return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); - cmd_vipcmds( playerid, "" ); + szCMDS[ 0 ] = '\0'; + strcat( szCMDS, ""COL_GREY"/viplist{FFFFFF} - A list of all online V.I.P. players.\n"\ + ""COL_GREY"/vipspawnwep{FFFFFF} - Configure your V.I.P. weapons that you are given on spawning.\n"\ + ""COL_GREY"/vipgun{FFFFFF} - Use the V.I.P. Lounge Weapon vending machine.\n"\ + ""COL_GREY"/vipskin{FFFFFF} - Configure your V.I.P. skin.\n"\ + ""COL_GREY"/vipjob{FFFFFF} - Choose your V.I.P. job that allows you to have two jobs at once.\n" ); + ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, ""COL_GOLD"V.I.P. Commands", szCMDS, "Okay", "Back" ); } } return 1; From 3a9d6127b9db451312b1a30a4265452b0b367e04 Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 21:50:45 -0400 Subject: [PATCH 14/22] add peak player counter --- gamemodes/sf-cnr.pwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index d76ca6d..1b649b0 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -197,6 +197,8 @@ public OnServerUpdateTimer( ) // better to store in a variable as we are getting the timestamp from hardware g_iTime = gettime( ); + + UpdatePlayerCounters(); // for hooks CallLocalFunction( "OnServerUpdate", "" ); @@ -7082,4 +7084,19 @@ stock IsPlayerInArmyVehicle( playerid ) return true; else return false; +} + +new playersPeakCount = 0; + +stock UpdatePlayerCounters() +{ + new total_online = Iter_Count( Player ); + + if ( total_online > playersPeakCount ) playersPeakCount = total_online; +} + +CMD:peak( playerid, params[] ) +{ + if ( p_AdminLevel[ playerid ] != 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + return SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" The current peak player count since startup is: %i", playersPeakCount ); } \ No newline at end of file From 0922f8d8a0d066350d605373fc697bd667b0e7d5 Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 22:22:50 -0400 Subject: [PATCH 15/22] add new player LEO arresting support --- .../irresistible/cnr/features/cop/arrest.pwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 04382ea..05f4b6f 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -546,4 +546,20 @@ hook OnPlayerAccessEntrance( playerid, entranceid, worldid, interiorid ) } } return 1; +} + +hook OnPlayerUpdateEx( playerid ) +{ + if ( p_Class[ playerid ] == CLASS_POLICE && GetPlayerScore( playerid ) < 50 ) + { + new + Float: radius = 25.0, + closestCivilian = GetClosestPlayerEx( playerid, CLASS_CIVILIAN, radius ); + + if ( GetPlayerWantedLevel( closestCivilian ) != 0 ) + { + return ShowPlayerHelpDialog( playerid, 4000, "Use ~y~/taze [ID]~w~, ~b~/cuff [ID]~w~, and ~r~/ar [ID] ~w~commands to arrest." ); + } + } + return 1; } \ No newline at end of file From 6894da91be6541d3cf14a347fc1a73adb46e6a8a Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 23:06:20 -0400 Subject: [PATCH 16/22] adds SFPD protection for cops --- .../irresistible/cnr/features/cop/_cop.pwn | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/cop/_cop.pwn b/gamemodes/irresistible/cnr/features/cop/_cop.pwn index 62a65da..429fe51 100644 --- a/gamemodes/irresistible/cnr/features/cop/_cop.pwn +++ b/gamemodes/irresistible/cnr/features/cop/_cop.pwn @@ -11,4 +11,19 @@ #include "irresistible\cnr\features\cop\arrest.pwn" #include "irresistible\cnr\features\cop\bail.pwn" #include "irresistible\cnr\features\cop\ticket.pwn" -#include "irresistible\cnr\features\cop\emp.pwn" \ No newline at end of file +#include "irresistible\cnr\features\cop\emp.pwn" + +/* ** Hooks ** */ +hook OnPlayerGiveDamage( playerid, damagedid, Float: amount, weaponid, bodypart ) +{ + if ( p_Class[ damagedid ] == CLASS_POLICE ) + { + new Float: x, Float: y, Float: z; + + GetPlayerPos( damagedid, x, y, z ); + + if ( x >= -1650.0 && x <= -1571.0 && y >= 647.0 && y <= 711.0 ) + return ShowPlayerHelpDialog( playerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0; + } + return 1; +} \ No newline at end of file From 438e25e7d7239ef7fc379a2102a444cd25caf9c0 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 10 Apr 2019 12:06:10 -0400 Subject: [PATCH 17/22] attempt to fix casino point theft --- gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn b/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn index 8ad61f6..1af1694 100644 --- a/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn +++ b/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn @@ -213,6 +213,7 @@ CMD:casino( playerid, params[ ] ) /* ** Functions ** */ stock GivePlayerCasinoRewardsPoints( playerid, bet_amount, Float: house_edge ) { + if ( bet_amount == 0 ) return 1; if ( bet_amount < 0 ) bet_amount *= -1; // profit or loss, does not matter // printf("(%f * ((%f * 100.0) * (%f / 100.0))) / %f\n",bet_amount, house_edge, CASINO_REWARDS_PAYOUT_PERCENT, CASINO_REWARDS_DIVISOR); new Float: final_points = ( bet_amount * ( ( house_edge / 100.0 ) * ( CASINO_REWARDS_PAYOUT_PERCENT / 100.0 ) ) ) / CASINO_REWARDS_DIVISOR; From 7d301176506814125b7fa015190fc503dbe9add6 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 10 Apr 2019 13:27:53 -0400 Subject: [PATCH 18/22] adjustments, fixes, etc. --- .../cnr/commands/admin/admin_three.pwn | 6 ++++-- gamemodes/irresistible/cnr/features/cop/_cop.pwn | 10 +++++----- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 2 +- .../irresistible/cnr/features/vip/coin_market.pwn | 2 +- .../irresistible/cnr/features/visage/blackjack.pwn | 14 +++++++------- .../cnr/features/visage/rewardspoints.pwn | 1 - .../irresistible/cnr/features/visage/roulette.pwn | 2 +- gamemodes/sf-cnr.pwn | 7 ++++++- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn index d3a63af..317db5a 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn @@ -629,7 +629,8 @@ CMD:chatban( playerid, params[ ] ) p_ChatBannedBy[ pID ] = ReturnPlayerName( playerid ); p_ChatBanReason[ pID ] = reason; mysql_single_query( sprintf( "INSERT INTO `CHAT_BANS` (`ID`, `NAME`, `BANNED_BY_ID`, `BANNED_BY`, `REASON`) VALUES (%d, '%s', %d, '%s', '%s')", p_AccountID[ pID ], mysql_escape( ReturnPlayerName( pID ) ), p_AccountID[ playerid ], mysql_escape( ReturnPlayerName( playerid ) ), mysql_escape( reason ) ) ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat banned by %s for '%s'.", ReturnPlayerName( pID ), reason ); + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat banned by %s for '%s'.", ReturnPlayerName( playerid ), reason ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat banned %s for '%s'.", ReturnPlayerName( pID ), reason ); AddAdminLogLineFormatted( "%s(%d) has chat banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); SaveToAdminLog( playerid, p_AccountID[ pID ], "chat ban" ); } @@ -651,7 +652,8 @@ CMD:unchatban( playerid, params[ ] ) { p_ChatBanned{ pID } = false; mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( pID ) ); + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( pID ) ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat unbanned %s.", ReturnPlayerName( pID ) ); AddAdminLogLineFormatted( "%s(%d) has chat unbanned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); SaveToAdminLog( playerid, p_AccountID[ pID ], "chat unban" ); } diff --git a/gamemodes/irresistible/cnr/features/cop/_cop.pwn b/gamemodes/irresistible/cnr/features/cop/_cop.pwn index 429fe51..53379cc 100644 --- a/gamemodes/irresistible/cnr/features/cop/_cop.pwn +++ b/gamemodes/irresistible/cnr/features/cop/_cop.pwn @@ -14,16 +14,16 @@ #include "irresistible\cnr\features\cop\emp.pwn" /* ** Hooks ** */ -hook OnPlayerGiveDamage( playerid, damagedid, Float: amount, weaponid, bodypart ) +/*hook OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid, bodypart ) { - if ( p_Class[ damagedid ] == CLASS_POLICE ) + if ( p_Class[ playerid ] == CLASS_POLICE && !IsPlayerNPC( playerid ) ) { new Float: x, Float: y, Float: z; - GetPlayerPos( damagedid, x, y, z ); + GetPlayerPos( playerid, x, y, z ); if ( x >= -1650.0 && x <= -1571.0 && y >= 647.0 && y <= 711.0 ) - return ShowPlayerHelpDialog( playerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0; + return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0; } return 1; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 05f4b6f..866e8ee 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -556,7 +556,7 @@ hook OnPlayerUpdateEx( playerid ) Float: radius = 25.0, closestCivilian = GetClosestPlayerEx( playerid, CLASS_CIVILIAN, radius ); - if ( GetPlayerWantedLevel( closestCivilian ) != 0 ) + if ( closestCivilian != INVALID_PLAYER_ID && GetPlayerWantedLevel( closestCivilian ) != 0 ) { return ShowPlayerHelpDialog( playerid, 4000, "Use ~y~/taze [ID]~w~, ~b~/cuff [ID]~w~, and ~r~/ar [ID] ~w~commands to arrest." ); } diff --git a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn index c7f2580..197d8ff 100644 --- a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn +++ b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn @@ -493,7 +493,7 @@ CMD:irresistiblecoins( playerid, params[ ] ) if ( sscanf( params[ 5 ],"uf", senttoid, coins ) ) return SendUsage( playerid, "/irresistiblecoins send [PLAYER_ID] [COINS]" ); else if ( !IsPlayerConnected( senttoid ) || IsPlayerNPC( senttoid ) ) return SendError( playerid, "Invalid Player ID." ); - else if ( p_VIPLevel[ playerid ] < VIP_BRONZE ) return SendError( playerid, "You are not a Bronze V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); + else if ( p_VIPLevel[ playerid ] < VIP_REGULAR ) return SendError( playerid, "You are not a Regular V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); else if ( coins < 0.1 || coins > 10000.0 ) return SendError( playerid, "You can only send between 0.1 and 10,000.0 coins at a single time." ); else if ( coins > 99999999 || coins < 0 ) return SendError( playerid, "You can only send between 0.1 and 5,000.0 coins at a single time." ); // Making cash go over billions... else if ( GetPlayerIrresistibleCoins( playerid ) < coins ) return SendError( playerid, "You do not have this number of coins to send." ); diff --git a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn index 0a2d1bb..54c4fdf 100644 --- a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn +++ b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn @@ -572,7 +572,7 @@ stock CheckForBlackjack( tableid ) g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has been returned %s due to a push.", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); GameTextForPlayer( playerid, sprintf( "~n~~n~~y~%s returned!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } @@ -585,18 +585,18 @@ stock CheckForBlackjack( tableid ) SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a card count of 21!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); } GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } else if ( dealer_score == 21 ) { - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a dealer %s.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ), IsDealerHandBlackjack( tableid, dealer_score ) ? ( "blackjack" ) : ( "21" ) ); GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 ); } else if ( player_score > 21 ) { - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ); GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 ); @@ -605,12 +605,12 @@ stock CheckForBlackjack( tableid ) g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } else if ( player_score < dealer_score && dealer_score >= 17 ) { - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ); GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 ); @@ -619,7 +619,7 @@ stock CheckForBlackjack( tableid ) g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ); GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } diff --git a/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn b/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn index 1af1694..8ad61f6 100644 --- a/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn +++ b/gamemodes/irresistible/cnr/features/visage/rewardspoints.pwn @@ -213,7 +213,6 @@ CMD:casino( playerid, params[ ] ) /* ** Functions ** */ stock GivePlayerCasinoRewardsPoints( playerid, bet_amount, Float: house_edge ) { - if ( bet_amount == 0 ) return 1; if ( bet_amount < 0 ) bet_amount *= -1; // profit or loss, does not matter // printf("(%f * ((%f * 100.0) * (%f / 100.0))) / %f\n",bet_amount, house_edge, CASINO_REWARDS_PAYOUT_PERCENT, CASINO_REWARDS_DIVISOR); new Float: final_points = ( bet_amount * ( ( house_edge / 100.0 ) * ( CASINO_REWARDS_PAYOUT_PERCENT / 100.0 ) ) ) / CASINO_REWARDS_DIVISOR; diff --git a/gamemodes/irresistible/cnr/features/visage/roulette.pwn b/gamemodes/irresistible/cnr/features/visage/roulette.pwn index d509f1e..7d8c56a 100644 --- a/gamemodes/irresistible/cnr/features/visage/roulette.pwn +++ b/gamemodes/irresistible/cnr/features/visage/roulette.pwn @@ -694,7 +694,7 @@ public OnRouletteWheelStop( rouletteid, winner ) } // give user points - GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 ); + if ( profit != 0 ) GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 ); // gametext if ( profit > 0 ) { diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 1b649b0..c58173e 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -16,7 +16,7 @@ #pragma option -d3 #pragma dynamic 7200000 -// #define DEBUG_MODE +#define DEBUG_MODE #if defined DEBUG_MODE #pragma option -d3 @@ -2519,6 +2519,11 @@ CMD:myaccid( playerid, params[ ] ) return 1; } +CMD:discord( playerid, params[ ] ) +{ + return SendServerMessage( playerid, "Visit 'sfcnr.com/discord' to join our Discord server!" ); +} + CMD:job( playerid, params[ ] ) { if ( p_VIPLevel[ playerid ] >= VIP_PLATINUM && p_VIPJob{ playerid } != p_Job{ playerid } ) From 56360d06c1af31076192bf75828a2b45b4328059 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 10 Apr 2019 13:40:12 -0400 Subject: [PATCH 19/22] removes MMB arrest, MOTD preset, changelog addition --- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 4 ++-- gamemodes/irresistible/cnr/textdraws.pwn | 2 ++ gamemodes/sf-cnr.pwn | 2 +- scriptfiles/changelogs/cnr/_changelogs.cfg | 1 + scriptfiles/changelogs/cnr/changelog_template.txt | 4 ++++ scriptfiles/changelogs/cnr/v11.55.168.txt | 13 +++++++++++++ 6 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 scriptfiles/changelogs/cnr/changelog_template.txt create mode 100644 scriptfiles/changelogs/cnr/v11.55.168.txt diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 866e8ee..04c98fc 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -51,7 +51,7 @@ hook OnPlayerDeath( playerid, killerid, reason ) hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { - if ( PRESSED( KEY_LOOK_BEHIND ) ) // MMB to taze/cuff/ar + /*if ( PRESSED( KEY_LOOK_BEHIND ) ) // MMB to taze/cuff/ar { if ( p_Class[ playerid ] == CLASS_POLICE && ! IsPlayerSpawnProtected( playerid ) ) { @@ -68,7 +68,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) } } } - } + }*/ return 1; } diff --git a/gamemodes/irresistible/cnr/textdraws.pwn b/gamemodes/irresistible/cnr/textdraws.pwn index b25ee89..c263eb6 100644 --- a/gamemodes/irresistible/cnr/textdraws.pwn +++ b/gamemodes/irresistible/cnr/textdraws.pwn @@ -42,6 +42,8 @@ new /* ** Hooks ** */ hook OnScriptInit( ) { + TextDrawSetString( g_MotdTD, "~w~Want more ~g~money, houses, and xp~w~? Consider donating! ~y~/vip" ); + g_currentXPTD = TextDrawCreate(529.000000, 405.000000, "Current XP"); TextDrawBackgroundColor(g_currentXPTD, 255); TextDrawFont(g_currentXPTD, 3); diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index c58173e..a40f0ee 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -16,7 +16,7 @@ #pragma option -d3 #pragma dynamic 7200000 -#define DEBUG_MODE +//#define DEBUG_MODE #if defined DEBUG_MODE #pragma option -d3 diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index 2090170..69ebaeb 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -1,3 +1,4 @@ +v11.55.168 v11.54.157 v11.53.154 v11.52.150 diff --git a/scriptfiles/changelogs/cnr/changelog_template.txt b/scriptfiles/changelogs/cnr/changelog_template.txt new file mode 100644 index 0000000..af7f2ab --- /dev/null +++ b/scriptfiles/changelogs/cnr/changelog_template.txt @@ -0,0 +1,4 @@ +(+) +(/) +(*) +(-) \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.55.168.txt b/scriptfiles/changelogs/cnr/v11.55.168.txt new file mode 100644 index 0000000..bdab2d6 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.55.168.txt @@ -0,0 +1,13 @@ +(+) You can now disable global gambling messages in /cp. +(+) /discord now displays what the discord server URL is. +(+) /cmds -> V.I.P. Commands now displays a list of V.I.P. commands. +(+) Players below 50 score, playing as a LEO, will now have a help dialog on how to arrest. +(/) The old arrest system, which is command-based, has been added back. (MMB Disabled) +(/) Regular V.I.P. players are not allowed to send IC with /ic send. +(/) /admins only requires 50 score now. +(/) The MOTD will now be preset upon server startup. +(*) Removes the ability to farm points within the Casino on a $0 payout. +(*) Fixed issue with /spawn not allowing 100+ houses to appear. +(*) A typo in /acmds has been fixed. +(*) Fixed an issue with /chatban showing the wrong player name. +(-) You are no longer able to use /perks while in an army vehicle. \ No newline at end of file From cab1bc7f0ee48c27d60e5908b7515edf988b87df Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 10 Apr 2019 13:43:20 -0400 Subject: [PATCH 20/22] adds missing changelog from dedi into config --- scriptfiles/changelogs/cnr/_changelogs.cfg | 1 + scriptfiles/changelogs/cnr/v11.51.145.txt | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 scriptfiles/changelogs/cnr/v11.51.145.txt diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index 69ebaeb..0607c59 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -2,5 +2,6 @@ v11.55.168 v11.54.157 v11.53.154 v11.52.150 +v11.51.145 v11.50.142 v11.50.140 \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.51.145.txt b/scriptfiles/changelogs/cnr/v11.51.145.txt new file mode 100644 index 0000000..f17d2b1 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.51.145.txt @@ -0,0 +1,5 @@ +(+) Adds Battle Royale minigame to the SF Stadium. +(+) Random airdrops drop every minute for Battle Royale players. +(/) Replaces ordinary plane for an andromanda model. +(*) Battle Royale games cannot be started without the leader starting. +(*) Battle Royale players will be autokilled if they AFK out of the playable area. \ No newline at end of file From 5e13d3a7eb385d771693a217810e20e6ced34330 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 10 Apr 2019 13:44:39 -0400 Subject: [PATCH 21/22] adds ban/cac lift into changelog --- scriptfiles/changelogs/cnr/v11.55.168.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scriptfiles/changelogs/cnr/v11.55.168.txt b/scriptfiles/changelogs/cnr/v11.55.168.txt index bdab2d6..d7c63ca 100644 --- a/scriptfiles/changelogs/cnr/v11.55.168.txt +++ b/scriptfiles/changelogs/cnr/v11.55.168.txt @@ -10,4 +10,6 @@ (*) Fixed issue with /spawn not allowing 100+ houses to appear. (*) A typo in /acmds has been fixed. (*) Fixed an issue with /chatban showing the wrong player name. -(-) You are no longer able to use /perks while in an army vehicle. \ No newline at end of file +(-) You are no longer able to use /perks while in an army vehicle. + +Note: All bans and CAC forces have been lifted. (Except for Chargeback-related bans) \ No newline at end of file From b35d1012c3f95f5556aef23e65b5975d4619f4ed Mon Sep 17 00:00:00 2001 From: Damen Date: Thu, 11 Apr 2019 16:27:47 -0400 Subject: [PATCH 22/22] corrects typo in changelog --- scriptfiles/changelogs/cnr/v11.55.168.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scriptfiles/changelogs/cnr/v11.55.168.txt b/scriptfiles/changelogs/cnr/v11.55.168.txt index d7c63ca..4a3e799 100644 --- a/scriptfiles/changelogs/cnr/v11.55.168.txt +++ b/scriptfiles/changelogs/cnr/v11.55.168.txt @@ -3,7 +3,7 @@ (+) /cmds -> V.I.P. Commands now displays a list of V.I.P. commands. (+) Players below 50 score, playing as a LEO, will now have a help dialog on how to arrest. (/) The old arrest system, which is command-based, has been added back. (MMB Disabled) -(/) Regular V.I.P. players are not allowed to send IC with /ic send. +(/) Regular V.I.P. players are now allowed to send IC with /ic send. (/) /admins only requires 50 score now. (/) The MOTD will now be preset upon server startup. (*) Removes the ability to farm points within the Casino on a $0 payout.