From 4b79a5eba33eee27ab0f1e6d0beba65f90d59f7c Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 23 Dec 2018 10:58:03 +1100 Subject: [PATCH] move more code associated with vip to its own appropriate modules --- gamemodes/irresistible/README.md | 4 + .../cnr/features/visage/roulette.pwn | 5 +- .../cnr/features/visage/slot_machines.pwn | 7 +- gamemodes/irresistible/cnr/global.pwn | 2 - gamemodes/irresistible/cnr/vip/_vip.pwn | 3 +- .../irresistible/cnr/vip/coin_generation.pwn | 94 +++++++++++++++ .../cnr/vip/{vip.pwn => coin_market.pwn} | 95 +++++++++++++--- .../irresistible/cnr/vip/player_market.pwn | 5 + .../irresistible/cnr/vip/redeem_code.pwn | 5 + gamemodes/sf-cnr.pwn | 107 +----------------- 10 files changed, 199 insertions(+), 128 deletions(-) create mode 100644 gamemodes/irresistible/cnr/vip/coin_generation.pwn rename gamemodes/irresistible/cnr/vip/{vip.pwn => coin_market.pwn} (89%) diff --git a/gamemodes/irresistible/README.md b/gamemodes/irresistible/README.md index 49bfc5b..648384e 100644 --- a/gamemodes/irresistible/README.md +++ b/gamemodes/irresistible/README.md @@ -11,9 +11,13 @@ - Called when a player is attempting to be respawned somewhere randomly - `public OnServerUpdate( )` - Called every second (or sooner) indefinitely +- `public OnServerTickSecond( )` + - Called every second (specifically) indefinitely - `public OnPlayerUpdateEx( playerid )` - Same interval as OnServerUpdate, but it is called indefinitely for every player in-game - When you wish to update something frequently, but not use OnPlayerUpdate +- `public OnPlayerTickSecond( playerid )` + - Called every second (specifically a second) for a player, indefinitely - `OnServerGameDayEnd( )` - Called every 24 minutes in-game (basically when a new day starts) - `OnNpcConnect( npcid )` diff --git a/gamemodes/irresistible/cnr/features/visage/roulette.pwn b/gamemodes/irresistible/cnr/features/visage/roulette.pwn index 8d6ab47..e3dfda6 100644 --- a/gamemodes/irresistible/cnr/features/visage/roulette.pwn +++ b/gamemodes/irresistible/cnr/features/visage/roulette.pwn @@ -21,7 +21,6 @@ #define MAX_ROULETTE_TABLES 30 /* ** Macros ** */ -#define IsPlayerOnRoulette(%0) (p_RouletteTable[%0]!=-1) #define IsRedRouletteNumber(%0) (%0 == 1 || %0 == 3 || %0 == 5 || %0 == 7 || %0 == 9 || %0 == 12 || %0 == 14 || %0 == 16 || %0 == 18 || %0 == 19 || %0 == 21 || %0 == 23 || %0 == 25 || %0 == 27 || %0 == 30 || %0 == 32 || %0 == 34 || %0 == 36) /* ** Constants ** */ @@ -921,3 +920,7 @@ stock ConvertRouletteChipValue( value ) { } return string; } + +stock IsPlayerOnRoulette( playerid ) { + return p_RouletteTable[ playerid ] != -1; +} diff --git a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn index 117e1a8..98a84f4 100644 --- a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn +++ b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn @@ -13,9 +13,6 @@ #define MAX_SLOT_POOLS ( 3 ) #define POOL_ENTITIES ( 5 ) -/* ** Macros ** */ -#define IsPlayerOnSlotMachine(%0) ( p_usingSlotMachine[ %0 ] != -1 ) - /* ** Constants ** */ enum E_SLOT_ODD_DATA { @@ -756,3 +753,7 @@ stock StopPlayerUsingSlotMachine( playerid ) TogglePlayerControllable( playerid, 1 ); return 1; } + +stock IsPlayerOnSlotMachine( playerid ) { + return p_usingSlotMachine[ playerid ] != -1; +} \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/global.pwn b/gamemodes/irresistible/cnr/global.pwn index 239211f..3cd5428 100644 --- a/gamemodes/irresistible/cnr/global.pwn +++ b/gamemodes/irresistible/cnr/global.pwn @@ -31,8 +31,6 @@ new bool: g_Debugging = false, bool: g_Driveby = false, bool: g_VipPrivateMsging = false, - bool: g_HappyHour = false, - Float: g_HappyHourRate = 0.0, g_iTime = 0, g_VehicleLastAttacker [ MAX_VEHICLES ] = { INVALID_PLAYER_ID, ... }, g_VehicleLastAttacked [ MAX_VEHICLES ], diff --git a/gamemodes/irresistible/cnr/vip/_vip.pwn b/gamemodes/irresistible/cnr/vip/_vip.pwn index e108505..414b9b3 100644 --- a/gamemodes/irresistible/cnr/vip/_vip.pwn +++ b/gamemodes/irresistible/cnr/vip/_vip.pwn @@ -6,6 +6,7 @@ */ /* ** Includes ** */ -#include "irresistible\cnr\vip\vip.pwn" +#include "irresistible\cnr\vip\coin_market.pwn" +#include "irresistible\cnr\vip\coin_generation.pwn" #include "irresistible\cnr\vip\redeem_code.pwn" #include "irresistible\cnr\vip\player_market.pwn" diff --git a/gamemodes/irresistible/cnr/vip/coin_generation.pwn b/gamemodes/irresistible/cnr/vip/coin_generation.pwn new file mode 100644 index 0000000..a19844e --- /dev/null +++ b/gamemodes/irresistible/cnr/vip/coin_generation.pwn @@ -0,0 +1,94 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Lorenc + * Module: cnr\vip\happy_hour.pwn + * Purpose: coin generation ("proof of playing") mechanism + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Error Checking ** */ +#if !defined __cnr__irresistiblecoins + #endinput +#endif + +/* ** Variables ** */ +static stock + bool: g_HappyHour = false, + Float: g_HappyHourRate = 0.0 +; + +/* ** Hooks ** */ +hook OnServerUpdate( ) +{ + new Float: fLastRate; + new playersOnline = Iter_Count(Player); + + // Happy Hour + if ( ( g_HappyHour = playersOnline <= 20 ) == true ) { + // Maximum of 25% decrease + g_HappyHourRate = 0.25 - ( playersOnline / 80.0 ); + + // Only update colors if neccessary + if ( fLastRate != g_HappyHourRate ) + { + TextDrawSetString( g_NotManyPlayersTD, sprintf( "Coin generation increased by %0.1f%% as there aren't many players online!", g_HappyHourRate * 100.0 ) ); + TextDrawColor( g_NotManyPlayersTD, setAlpha( COLOR_RED, floatround( 200.0 - 10.0 * float( playersOnline ) ) ) ); + TextDrawShowForAllSpawned( g_NotManyPlayersTD ); + } + + // Update last rate + fLastRate = g_HappyHourRate; + } else { + // Disable Color + g_HappyHourRate = 0.0; + TextDrawColor( g_NotManyPlayersTD, 0 ); + TextDrawHideForAll( g_NotManyPlayersTD ); + } + return 1; +} + +hook OnPlayerTickSecond( playerid ) +{ + static + iKeys, iUpDownKeys, iLeftRightKeys; + + // Increase Irresistible Coins (1/20 = cred/min) + if ( ! IsPlayerAFK( playerid ) && GetPlayerKeys( playerid, iKeys, iUpDownKeys, iLeftRightKeys ) && ! IsPlayerOnRoulette( playerid ) && ! IsPlayerOnSlotMachine( playerid ) && GetPlayerVehicleSeat( playerid ) <= 0 ) + { + if ( iKeys != 0 || iUpDownKeys != 0 || iLeftRightKeys != 0 ) { // GetPlayerScore( playerid ) > 10 && + + new + Float: iCoinGenRate = 35.0; + + // VIP check + if ( p_VIPLevel[ playerid ] >= VIP_DIAMOND ) + iCoinGenRate *= 0.75; // Reduce by 25% if Diamond + + else if ( p_VIPLevel[ playerid ] == VIP_PLATINUM ) + iCoinGenRate *= 0.90; // Reduce by 10% if Diamond + + // Happy Hour + if ( g_HappyHour && ( 0.0 <= g_HappyHourRate <= 0.25 ) ) + iCoinGenRate *= 1.0 - g_HappyHourRate; + + p_IrresistibleCoins[ playerid ] += ( 1.0 / iCoinGenRate ) / 60.0; // Prev 25.92 + } + } + return 1; +} + +hook OnPlayerLoadTextdraws( playerid ) { + if ( g_HappyHour ) { + TextDrawShowForPlayer( playerid, g_NotManyPlayersTD ); + } + return 1; +} + +hook OnPlayerUnloadTextdraws( playerid ) { + TextDrawHideForPlayer( playerid, g_NotManyPlayersTD ); + return 1; +} + +/* ** Functions ** */ diff --git a/gamemodes/irresistible/cnr/vip/vip.pwn b/gamemodes/irresistible/cnr/vip/coin_market.pwn similarity index 89% rename from gamemodes/irresistible/cnr/vip/vip.pwn rename to gamemodes/irresistible/cnr/vip/coin_market.pwn index 2ccc218..275fb3b 100644 --- a/gamemodes/irresistible/cnr/vip/vip.pwn +++ b/gamemodes/irresistible/cnr/vip/coin_market.pwn @@ -1,13 +1,23 @@ /* * Irresistible Gaming (c) 2018 * Developed by Lorenc - * Module: vip.inc - * Purpose: vip associated information + * Module: cnr\vip\coin_market.pwn + * Purpose: coin market associated information */ /* ** Includes ** */ #include < YSI\y_hooks > +/* ** Error Checking ** */ +#if !defined __cnr__irresistiblecoins + #define __cnr__irresistiblecoins +#endif + +/* ** Settings ** */ +#define VIP_ALLOW_OVER_LIMIT ( true ) // allow player from using house/vehicle/garage cmds if over the limit + +#define VIP_MAX_EXTRA_SLOTS ( 5 ) // max extra slots a person can buy + /* ** Macros ** */ #define GetPlayerIrresistibleCoins(%0) \ (p_IrresistibleCoins[%0]) @@ -15,20 +25,20 @@ #define GivePlayerIrresistibleCoins(%0,%1) \ (p_IrresistibleCoins[%0] += %1) -/* ** Definitions ** */ -#define VIP_MAX_EXTRA_SLOTS 5 - -#define ICM_PAGE_DEFAULT ( 0 ) -#define ICM_PAGE_CASHCARD ( 1 ) -#define ICM_PAGE_ASSETS ( 2 ) -//#define ICM_PAGE_UPGRADE ( 3 ) - +/* ** Coin Market VIP Levels ** */ #define VIP_REGULAR ( 1 ) #define VIP_BRONZE ( 2 ) #define VIP_GOLD ( 3 ) #define VIP_PLATINUM ( 4 ) #define VIP_DIAMOND ( 5 ) +/* ** Coin Market Pages ** */ +#define ICM_PAGE_DEFAULT ( 0 ) +#define ICM_PAGE_CASHCARD ( 1 ) +#define ICM_PAGE_ASSETS ( 2 ) +//#define ICM_PAGE_UPGRADE ( 3 ) + +/* ** Coin Market Items ** */ #define ICM_COKE_BIZ ( 0 ) #define ICM_METH_BIZ ( 1 ) #define ICM_WEED_BIZ ( 2 ) @@ -39,8 +49,6 @@ #define ICM_NAME ( 7 ) #define ICM_VEH_SLOT ( 8 ) -#define VIP_ALLOW_OVER_LIMIT ( true ) - /* ** Variables ** */ enum E_IC_MARKET_DATA { @@ -48,7 +56,7 @@ enum E_IC_MARKET_DATA bool: E_MULTI_BUY, }; -new +static stock g_irresistibleVipItems [ ] [ E_IC_MARKET_DATA ] = { { VIP_DIAMOND, "Diamond V.I.P", 10000.0 }, @@ -57,6 +65,7 @@ new { VIP_BRONZE, "Bronze V.I.P", 1500.0 }, { VIP_REGULAR, "Regular V.I.P", 500.0 } }, + g_irresistibleCashCards [ ] [ E_IC_MARKET_DATA ] = { { 1250000, "Tiger Shark", 225.0 }, @@ -65,6 +74,7 @@ new { 10000000, "Whale Shark", 1350.0 }, { 20000000, "Megalodon Shark", 2250.0 } }, + g_irresistibleMarketItems [ ] [ E_IC_MARKET_DATA ] = { { ICM_COKE_BIZ, "Gang Facility", 4500.0 }, @@ -79,12 +89,15 @@ new { ICM_GARAGE, "Select Garage", 250.0 }, { ICM_NAME, "Change Your Name", 50.0 } }, + p_CoinMarketPage [ MAX_PLAYERS char ], - p_CoinMarketSelectedItem [ MAX_PLAYERS char ], - - Float: p_IrresistibleCoins [ MAX_PLAYERS ], - p_ExtraAssetSlots [ MAX_PLAYERS char ] + p_CoinMarketSelectedItem [ MAX_PLAYERS char ] +; +/* ** Global Variables ** */ +new + p_ExtraAssetSlots [ MAX_PLAYERS char ], + Float: p_IrresistibleCoins [ MAX_PLAYERS ] ; /* ** Hooks ** */ @@ -226,7 +239,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) } else if ( selectedItemID == ICM_VEH_SLOT ) { if ( p_ExtraAssetSlots{ playerid } >= VIP_MAX_EXTRA_SLOTS ) { - SendError( playerid, "You have reached the limit of additional slots (limit " #VIP_MAX_EXTRA_SLOTS ")." ); + SendError( playerid, "You have reached the limit of additional slots (limit %d).", VIP_MAX_EXTRA_SLOTS ); return ShowPlayerCoinMarketDialog( playerid, ICM_PAGE_ASSETS ); } @@ -438,6 +451,52 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) } /* ** Commands ** */ +CMD:ic( playerid, params[ ] ) return cmd_irresistiblecoins( playerid, params ); +CMD:irresistiblecoins( playerid, params[ ] ) +{ + if ( ! IsPlayerSecurityVerified( playerid ) ) + return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" ); + + if ( strmatch( params, "balance" ) ) + { + return SendServerMessage( playerid, "You currently have precisely "COL_GOLD"%s"COL_WHITE" Irresistible Coins!", number_format( p_IrresistibleCoins[ playerid ] ) ); + } + else if ( strmatch( params, "market" ) ) + { + return ShowPlayerCoinMarketDialog( playerid ); + } + else if ( !strcmp( params, "send", false, 4 ) ) + { + new + senttoid, Float: coins; + + 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 ( coins < 0.1 || coins > 5000.0 ) return SendError( playerid, "You can only send between 0.1 and 5,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 ( p_IrresistibleCoins[ playerid ] < coins ) return SendError( playerid, "You do not have this number of coins to send." ); + else if ( GetPlayerScore( playerid ) < 1000 ) return SendError( playerid, "You need at least 1,000 score to send coins to other players." ); + else if ( senttoid == playerid ) return SendError( playerid, "You cannot send yourself coins." ); + else + { + if ( GetDistanceBetweenPlayers( playerid, senttoid ) > 8.0 ) + return SendError( playerid, "Please make sure you are close to the player before sending coins to them." ); + + format( szNormalString, sizeof( szNormalString ), "INSERT INTO `TRANSACTIONS_IC` (`TO_ID`, `FROM_ID`, `IC`) VALUES (%d, %d, %f)", p_AccountID[ senttoid ], p_AccountID[ playerid ], coins ); + mysql_single_query( szNormalString ); + + p_IrresistibleCoins[ senttoid ] += coins; + p_IrresistibleCoins[ playerid ] -= coins; + + SendServerMessage( playerid, "You have sent "COL_GOLD"%s"COL_WHITE" Irresistible Coins to %s(%d)!", number_format( coins, .decimals = 2 ), ReturnPlayerName( senttoid ), senttoid ); + SendServerMessage( senttoid, "You have received "COL_GOLD"%s"COL_WHITE" Irresistible Coins from %s(%d)!", number_format( coins, .decimals = 2 ), ReturnPlayerName( playerid ), playerid ); + } + return 1; + } + return SendUsage( playerid, "/irresistiblecoins [BALANCE/BUY/SELL/MARKET/SEND/CANCEL]" ); +} + CMD:donate( playerid, params[ ] ) return cmd_vip( playerid, params ); CMD:vip( playerid, params[ ] ) { diff --git a/gamemodes/irresistible/cnr/vip/player_market.pwn b/gamemodes/irresistible/cnr/vip/player_market.pwn index 69ef46a..3df003f 100644 --- a/gamemodes/irresistible/cnr/vip/player_market.pwn +++ b/gamemodes/irresistible/cnr/vip/player_market.pwn @@ -8,6 +8,11 @@ /* ** Includes ** */ #include < YSI\y_hooks > +/* ** Error Checking ** */ +#if !defined __cnr__irresistiblecoins + #endinput +#endif + /* ** Definitions ** */ // #define DIALOG_IC_SELLORDERS ( 5921 ) // #define DIALOG_IC_BUY ( 5922 ) diff --git a/gamemodes/irresistible/cnr/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/vip/redeem_code.pwn index 510f73f..ce764e3 100644 --- a/gamemodes/irresistible/cnr/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/vip/redeem_code.pwn @@ -8,6 +8,11 @@ /* ** Includes ** */ #include < YSI\y_hooks > +/* ** Error Checking ** */ +#if !defined __cnr__irresistiblecoins + #endinput +#endif + /* ** Definitions ** */ #define szRedemptionSalt "7resta#ecacakumedeM=yespawr!d@et" diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 37909a3..e00f1d2 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -266,8 +266,7 @@ public OnGameModeExit( ) public OnServerUpdateTimer( ) { static - iWeapon, iAmmo, - Float: fLastRate + iWeapon, iAmmo ; // for hooks @@ -282,31 +281,6 @@ public OnServerUpdateTimer( ) BeginEconomyTax( ); } - // Happy Hour - new - playersOnline = Iter_Count(Player); - - if ( ( g_HappyHour = playersOnline <= 20 ) == true ) { - // Maximum of 25% decrease - g_HappyHourRate = 0.25 - ( playersOnline / 80.0 ); - - // Only update colors if neccessary - if ( fLastRate != g_HappyHourRate ) - { - TextDrawSetString( g_NotManyPlayersTD, sprintf( "Coin generation increased by %0.1f%% as there aren't many players online!", g_HappyHourRate * 100.0 ) ); - TextDrawColor( g_NotManyPlayersTD, setAlpha( COLOR_RED, floatround( 200.0 - 10.0 * float( playersOnline ) ) ) ); - TextDrawShowForAllSpawned( g_NotManyPlayersTD ); - } - - // Update last rate - fLastRate = g_HappyHourRate; - } else { - // Disable Color - g_HappyHourRate = 0.0; - TextDrawColor( g_NotManyPlayersTD, 0 ); - TextDrawHideForAll( g_NotManyPlayersTD ); - } - // Begin iterating all players foreach ( new playerid : Player ) { @@ -468,9 +442,6 @@ public OnServerUpdateTimer( ) public OnServerSecondTick( ) { - new - iKeys, iUpDownKeys, iLeftRightKeys; - SendRconCommand( sprintf( "worldtime %s, %s", GetDayToString( g_WorldDayCount ), TimeConvert( g_WorldClockSeconds++ ) ) ); if ( g_WorldClockSeconds >= 1440 ) @@ -502,6 +473,9 @@ public OnServerSecondTick( ) SetPlayerWeather( playerid, ( GetPlayerInterior( playerid ) || GetPlayerVirtualWorld( playerid ) ) ? 1 : g_WorldWeather ); UpdatePlayerTime( playerid ); + // Callback + CallLocalFunction( "OnPlayerTickSecond", "d", playerid ); + // Increment Variables Whilst Not AFK if ( !IsPlayerAFK( playerid ) ) // New addition { @@ -518,28 +492,6 @@ public OnServerSecondTick( ) case 86400: ShowAchievement( playerid, "You have been online for ~r~1~w~~h~ day!", 15 ); } - // Increase Irresistible Coins (1/20 = cred/min) - if ( GetPlayerKeys( playerid, iKeys, iUpDownKeys, iLeftRightKeys ) && ! IsPlayerOnRoulette( playerid ) && ! IsPlayerOnSlotMachine( playerid ) && GetPlayerVehicleSeat( playerid ) <= 0 ) - { - if ( iKeys != 0 || iUpDownKeys != 0 || iLeftRightKeys != 0 ) { // GetPlayerScore( playerid ) > 10 && - - new - Float: iCoinGenRate = 35.0; - - // VIP check - if ( p_VIPLevel[ playerid ] >= VIP_DIAMOND ) - iCoinGenRate *= 0.75; // Reduce by 25% if Diamond - - else if ( p_VIPLevel[ playerid ] == VIP_PLATINUM ) - iCoinGenRate *= 0.90; // Reduce by 10% if Diamond - - // Happy Hour - if ( g_HappyHour && ( 0.0 <= g_HappyHourRate <= 0.25 ) ) - iCoinGenRate *= 1.0 - g_HappyHourRate; - - p_IrresistibleCoins[ playerid ] += ( 1.0 / iCoinGenRate ) / 60.0; // Prev 25.92 - } - } } // CIA Visible On Radar after firing a shot @@ -558,7 +510,6 @@ public OnPlayerRequestClass( playerid, classid ) PlayerTextDrawHide( playerid, p_WantedLevelTD[ playerid ] ); TextDrawHideForPlayer( playerid, g_MotdTD ); PlayerTextDrawHide( playerid, g_ZoneOwnerTD[ playerid ] ); - TextDrawHideForPlayer( playerid, g_NotManyPlayersTD ); TextDrawHideForPlayer( playerid, p_FPSCounterTD[ playerid ] ); TextDrawHideForPlayer( playerid, g_AdminOnDutyTD ); TextDrawHideForPlayer( playerid, g_WorldDayTD ); @@ -1050,7 +1001,6 @@ public OnPlayerSpawn( playerid ) TextDrawShowForPlayer( playerid, g_WebsiteTD ); TextDrawShowForPlayer( playerid, g_MotdTD ); PlayerTextDrawShow( playerid, g_ZoneOwnerTD[ playerid ] ); - if ( g_HappyHour ) TextDrawShowForPlayer( playerid, g_NotManyPlayersTD ); TextDrawShowForPlayer( playerid, g_WorldDayTD ); if ( p_AdminOnDuty{ playerid } ) TextDrawShowForPlayer( playerid, g_AdminOnDutyTD ); if ( p_AdminLog{ playerid } ) TextDrawShowForPlayer( playerid, g_AdminLogTD ); @@ -1685,7 +1635,6 @@ public OnPlayerDeath( playerid, killerid, reason ) PlayerTextDrawHide( playerid, p_WantedLevelTD[ playerid ] ); TextDrawHideForPlayer( playerid, g_MotdTD ); PlayerTextDrawHide( playerid, g_ZoneOwnerTD[ playerid ] ); - TextDrawHideForPlayer( playerid, g_NotManyPlayersTD ); TextDrawHideForPlayer( playerid, p_FPSCounterTD[ playerid ] ); TextDrawHideForPlayer( playerid, g_AdminOnDutyTD ); TextDrawHideForPlayer( playerid, g_WorldDayTD ); @@ -2256,52 +2205,6 @@ thread readplayervipnotes( playerid ) return SendError( playerid, "You do not have any V.I.P notes." ); } -CMD:ic( playerid, params[ ] ) return cmd_irresistiblecoins( playerid, params ); -CMD:irresistiblecoins( playerid, params[ ] ) -{ - if ( ! IsPlayerSecurityVerified( playerid ) ) - return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" ); - - if ( strmatch( params, "balance" ) ) - { - return SendServerMessage( playerid, "You currently have precisely "COL_GOLD"%s"COL_WHITE" Irresistible Coins!", number_format( p_IrresistibleCoins[ playerid ] ) ); - } - else if ( strmatch( params, "market" ) ) - { - return ShowPlayerCoinMarketDialog( playerid ); - } - else if ( !strcmp( params, "send", false, 4 ) ) - { - new - senttoid, Float: coins; - - 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 ( coins < 0.1 || coins > 5000.0 ) return SendError( playerid, "You can only send between 0.1 and 5,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 ( p_IrresistibleCoins[ playerid ] < coins ) return SendError( playerid, "You do not have this number of coins to send." ); - else if ( GetPlayerScore( playerid ) < 1000 ) return SendError( playerid, "You need at least 1,000 score to send coins to other players." ); - else if ( senttoid == playerid ) return SendError( playerid, "You cannot send yourself coins." ); - else - { - if ( GetDistanceBetweenPlayers( playerid, senttoid ) > 8.0 ) - return SendError( playerid, "Please make sure you are close to the player before sending coins to them." ); - - format( szNormalString, sizeof( szNormalString ), "INSERT INTO `TRANSACTIONS_IC` (`TO_ID`, `FROM_ID`, `IC`) VALUES (%d, %d, %f)", p_AccountID[ senttoid ], p_AccountID[ playerid ], coins ); - mysql_single_query( szNormalString ); - - p_IrresistibleCoins[ senttoid ] += coins; - p_IrresistibleCoins[ playerid ] -= coins; - - SendServerMessage( playerid, "You have sent "COL_GOLD"%s"COL_WHITE" Irresistible Coins to %s(%d)!", number_format( coins, .decimals = 2 ), ReturnPlayerName( senttoid ), senttoid ); - SendServerMessage( senttoid, "You have received "COL_GOLD"%s"COL_WHITE" Irresistible Coins from %s(%d)!", number_format( coins, .decimals = 2 ), ReturnPlayerName( playerid ), playerid ); - } - return 1; - } - return SendUsage( playerid, "/irresistiblecoins [BALANCE/BUY/SELL/MARKET/SEND/CANCEL]" ); -} - CMD:top( playerid, params[ ] ) return cmd_highscores( playerid, params ); CMD:highscores( playerid, params[ ] ) { @@ -3350,7 +3253,6 @@ CMD:moviemode( playerid, params[ ] ) TextDrawShowForPlayer( playerid, g_WebsiteTD ); if ( p_WantedLevel[ playerid ] ) PlayerTextDrawShow( playerid, p_WantedLevelTD[ playerid ] ); TextDrawShowForPlayer( playerid, g_MotdTD ); - if ( g_HappyHour ) TextDrawShowForPlayer( playerid, g_NotManyPlayersTD ); if ( p_FPSCounter{ playerid } ) TextDrawShowForPlayer( playerid, p_FPSCounterTD[ playerid ] ); if ( p_AdminOnDuty{ playerid } ) TextDrawShowForPlayer( playerid, g_AdminOnDutyTD ); TextDrawShowForPlayer( playerid, g_WorldDayTD ); @@ -3370,7 +3272,6 @@ CMD:moviemode( playerid, params[ ] ) TextDrawHideForPlayer( playerid, g_AdminOnDutyTD ); TextDrawHideForPlayer( playerid, g_DoubleXPTD ); TextDrawHideForPlayer( playerid, g_MotdTD ); - TextDrawHideForPlayer( playerid, g_NotManyPlayersTD ); TextDrawHideForPlayer( playerid, g_WorldDayTD ); TextDrawHideForPlayer( playerid, p_FPSCounterTD[ playerid ] ); for( new i; i < sizeof( g_MovieModeTD ); i ++ ) TextDrawShowForPlayer( playerid, g_MovieModeTD[ i ] );