2018-09-23 04:55:13 +00:00
/*
* Irresistible Gaming (c) 2018
2018-12-12 08:21:57 +00:00
* Developed by Lorenc
2018-12-22 23:58:03 +00:00
* Module: cnr\vip\coin_market.pwn
* Purpose: coin market associated information
2018-09-23 04:55:13 +00:00
*/
/* ** Includes ** */
#include < YSI\y_hooks >
2018-12-22 23:58:03 +00:00
/* ** 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
/* ** Coin Market VIP Levels ** */
2018-09-23 04:55:13 +00:00
#define VIP_REGULAR ( 1 )
#define VIP_BRONZE ( 2 )
#define VIP_GOLD ( 3 )
#define VIP_PLATINUM ( 4 )
#define VIP_DIAMOND ( 5 )
2018-12-22 23:58:03 +00:00
/* ** 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 ** */
2018-09-23 04:55:13 +00:00
#define ICM_COKE_BIZ ( 0 )
#define ICM_METH_BIZ ( 1 )
#define ICM_WEED_BIZ ( 2 )
#define ICM_HOUSE ( 3 )
#define ICM_VEHICLE ( 4 )
#define ICM_GATE ( 5 )
#define ICM_GARAGE ( 6 )
#define ICM_NAME ( 7 )
#define ICM_VEH_SLOT ( 8 )
/* ** Variables ** */
enum E_IC_MARKET_DATA
{
E_ID, E_NAME[ 19 ], Float: E_PRICE,
bool: E_MULTI_BUY,
};
2018-12-22 23:58:03 +00:00
static stock
2018-09-23 04:55:13 +00:00
g_irresistibleVipItems [ ] [ E_IC_MARKET_DATA ] =
{
2018-10-22 10:50:11 +00:00
{ VIP_DIAMOND, "Diamond V.I.P", 10000.0 },
{ VIP_PLATINUM, "Platinum V.I.P", 5000.0 },
{ VIP_GOLD, "Gold V.I.P", 2500.0 },
{ VIP_BRONZE, "Bronze V.I.P", 1500.0 },
2018-09-23 04:55:13 +00:00
{ VIP_REGULAR, "Regular V.I.P", 500.0 }
},
2018-12-22 23:58:03 +00:00
2018-09-27 16:52:38 +00:00
g_irresistibleCashCards [ ] [ E_IC_MARKET_DATA ] =
2018-09-23 04:55:13 +00:00
{
2018-09-26 04:16:29 +00:00
{ 1250000, "Tiger Shark", 225.0 },
{ 2750000, "Bull Shark", 450.0 },
{ 6000000, "Great White Shark", 900.0 },
{ 10000000, "Whale Shark", 1350.0 },
{ 20000000, "Megalodon Shark", 2250.0 }
2018-09-23 04:55:13 +00:00
},
2018-12-22 23:58:03 +00:00
2018-09-23 04:55:13 +00:00
g_irresistibleMarketItems [ ] [ E_IC_MARKET_DATA ] =
{
2018-09-25 18:09:20 +00:00
{ ICM_COKE_BIZ, "Gang Facility", 4500.0 },
{ ICM_COKE_BIZ, "Bunker Business", 3900.0 },
2018-09-23 04:55:13 +00:00
{ ICM_COKE_BIZ, "Coke Business", 1500.0 },
{ ICM_METH_BIZ, "Meth Business", 700.0 },
{ ICM_WEED_BIZ, "Weed Business", 500.0 },
2018-10-22 10:50:11 +00:00
{ ICM_VEHICLE, "Select Vehicle", 500.0 },
{ ICM_HOUSE, "Select House", 500.0 },
2018-09-23 04:55:13 +00:00
{ ICM_GATE, "Custom Gate", 350.0 },
{ ICM_VEH_SLOT, "Extra Vehicle Slot", 350.0 },
2018-09-25 18:09:20 +00:00
{ ICM_GARAGE, "Select Garage", 250.0 },
2018-09-23 04:55:13 +00:00
{ ICM_NAME, "Change Your Name", 50.0 }
},
2018-12-22 23:58:03 +00:00
p_CoinMarketPage [ MAX_PLAYERS char ],
2019-06-01 22:31:48 +00:00
p_CoinMarketSelectedItem [ MAX_PLAYERS char ],
p_SelectedPackage [ MAX_PLAYERS char ]
2018-12-22 23:58:03 +00:00
;
2018-09-23 04:55:13 +00:00
2018-12-22 23:58:03 +00:00
/* ** Global Variables ** */
2019-01-01 13:19:17 +00:00
static stock
2018-12-22 23:58:03 +00:00
p_ExtraAssetSlots [ MAX_PLAYERS char ],
Float: p_IrresistibleCoins [ MAX_PLAYERS ]
2018-09-23 04:55:13 +00:00
;
2019-01-01 13:19:17 +00:00
/* ** Forwards ** */
forward Float: GetPlayerIrresistibleCoins( playerid );
2018-09-23 04:55:13 +00:00
/* ** Hooks ** */
2019-01-01 15:51:02 +00:00
#if defined SERVER_PLS_DONATE_MP3
hook OnServerGameDayEnd( )
{
foreach ( new p : Player ) if ( ! p_VIPLevel[ p ] && ! IsPlayerUsingRadio( p ) )
{
PlayAudioStreamForPlayer( p, SERVER_PLS_DONATE_MP3 );
}
return 1;
}
#endif
2018-12-22 11:08:05 +00:00
hook OnPlayerUpdateEx( playerid )
{
CheckPlayerVipExpiry( playerid );
return 1;
}
2019-01-01 13:19:17 +00:00
hook OnPlayerDisconnect( playerid, reason )
{
2019-06-01 22:31:48 +00:00
p_SelectedPackage{ playerid } = -1;
2019-01-01 13:19:17 +00:00
p_ExtraAssetSlots{ playerid } = 0;
p_IrresistibleCoins[ playerid ] = 0.0;
return 1;
}
hook OnPlayerRegister( playerid )
{
p_IrresistibleCoins[ playerid ] = 0.0;
return 1;
}
2018-12-22 11:08:05 +00:00
hook OnPlayerLogin( playerid )
{
CheckPlayerVipExpiry( playerid );
return 1;
}
2018-09-23 04:55:13 +00:00
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
if ( dialogid == DIALOG_IC_MARKET && response )
{
2018-10-22 10:50:11 +00:00
//new current_vip = GetPlayerVIPLevel( playerid );
2018-09-23 04:55:13 +00:00
2018-10-22 10:50:11 +00:00
if ( listitem == sizeof( g_irresistibleVipItems ) ) {
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, ICM_PAGE_CASHCARD );
}
2018-10-22 10:50:11 +00:00
else if ( listitem == sizeof( g_irresistibleVipItems ) + 1 ) {
2018-09-25 18:09:20 +00:00
return ShowPlayerHomeListings( playerid );
}
2018-10-22 10:50:11 +00:00
else if ( listitem > sizeof( g_irresistibleVipItems ) + 1 ) {
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, ICM_PAGE_ASSETS );
}
else {
new Float: iCoinRequirement = g_irresistibleVipItems[ listitem ] [ E_PRICE ] * GetGVarFloat( "vip_discount" );
2018-10-22 10:50:11 +00:00
//new selected_vip = g_irresistibleVipItems[ listitem ] [ E_ID ];
2018-09-23 04:55:13 +00:00
p_CoinMarketPage{ playerid } = ICM_PAGE_DEFAULT;
p_CoinMarketSelectedItem{ playerid } = listitem;
2019-06-02 02:01:17 +00:00
return ShowPlayerDialog( playerid, DIALOG_YOU_SURE_VIP, DIALOG_STYLE_MSGBOX, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Confirmation", sprintf( ""COL_WHITE"Are you sure that you want to spend %s IC?", number_format( iCoinRequirement, .decimals = 2 ) ), "Yes", "No" );
2018-09-23 04:55:13 +00:00
}
}
else if ( dialogid == DIALOG_IC_MARKET_2 || dialogid == DIALOG_IC_MARKET_3 )
{
if ( ! response )
return ShowPlayerCoinMarketDialog( playerid );
new Float: iCoinRequirement = GetGVarFloat( "vip_discount" );
// assets
if ( dialogid == DIALOG_IC_MARKET_2 ) {
iCoinRequirement *= g_irresistibleMarketItems[ listitem ] [ E_PRICE ];
}
// cash cards
else if ( dialogid == DIALOG_IC_MARKET_3 ) {
2018-09-27 16:52:38 +00:00
iCoinRequirement *= g_irresistibleCashCards[ listitem ] [ E_PRICE ];
2018-09-23 04:55:13 +00:00
}
p_CoinMarketPage{ playerid } = ( dialogid == DIALOG_IC_MARKET_3 ) ? ICM_PAGE_CASHCARD : ICM_PAGE_ASSETS;
p_CoinMarketSelectedItem{ playerid } = listitem;
2019-06-02 02:01:17 +00:00
return ShowPlayerDialog( playerid, DIALOG_YOU_SURE_VIP, DIALOG_STYLE_MSGBOX, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Confirmation", sprintf( ""COL_WHITE"Are you sure that you want to spend %s IC?", number_format( iCoinRequirement, .decimals = 2 ) ), "Yes", "No" );
2018-09-23 04:55:13 +00:00
}
else if ( dialogid == DIALOG_YOU_SURE_VIP )
{
if ( !response )
return ShowPlayerCoinMarketDialog( playerid, p_CoinMarketPage{ playerid } );
new Float: player_coins = GetPlayerIrresistibleCoins( playerid );
// restore listitem of whatever player selected
listitem = p_CoinMarketSelectedItem{ playerid };
// default page
2018-10-22 10:50:11 +00:00
if ( p_CoinMarketPage{ playerid } == ICM_PAGE_DEFAULT )
2018-09-23 04:55:13 +00:00
{
new Float: iCoinRequirement = g_irresistibleVipItems[ listitem ] [ E_PRICE ] * GetGVarFloat( "vip_discount" );
new selected_vip = g_irresistibleVipItems[ listitem ] [ E_ID ];
if ( player_coins < iCoinRequirement ) {
2018-09-25 18:09:20 +00:00
SendError( playerid, "You need around %s coins before you can get this V.I.P!", number_format( iCoinRequirement - player_coins, .decimals = 2 ) );
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, p_CoinMarketPage{ playerid } );
}
// Deduct IC
GivePlayerIrresistibleCoins( playerid, -iCoinRequirement );
// Set VIP Level
SetPlayerVipLevel( playerid, selected_vip );
// Send message
2018-09-25 18:09:20 +00:00
SendClientMessageFormatted( playerid, -1, ""COL_GOLD"[VIP PACKAGE]"COL_WHITE" You have redeemed %s V.I.P for %s Irresistible Coins! Congratulations! :D", VIPToString( selected_vip ), number_format( iCoinRequirement, .decimals = 0 ) );
2018-09-23 04:55:13 +00:00
// Redirect player
2018-10-22 10:50:11 +00:00
if ( selected_vip == VIP_DIAMOND )
{
2019-05-29 13:05:13 +00:00
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 " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
2018-10-22 10:50:11 +00:00
}
else if ( selected_vip == VIP_PLATINUM )
{
2019-05-29 13:05:13 +00:00
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 " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
2018-10-22 10:50:11 +00:00
}
else
{
ShowPlayerVipRedeemedDialog( playerid );
}
2018-09-23 04:55:13 +00:00
return 1;
}
// buy cash cards
else if ( p_CoinMarketPage{ playerid } == ICM_PAGE_CASHCARD )
{
2018-09-27 16:52:38 +00:00
new Float: iCoinRequirement = g_irresistibleCashCards[ listitem ] [ E_PRICE ] * GetGVarFloat( "vip_discount" );
2018-09-23 04:55:13 +00:00
if ( player_coins < iCoinRequirement ) {
2018-09-25 18:09:20 +00:00
SendError( playerid, "You need around %s coins before you can get this!", number_format( iCoinRequirement - player_coins, .decimals = 2 ) );
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, p_CoinMarketPage{ playerid } );
}
2018-09-27 16:52:38 +00:00
new cash_amount = g_irresistibleCashCards[ listitem ] [ E_ID ];
2018-09-23 04:55:13 +00:00
GivePlayerCash( playerid, cash_amount );
GivePlayerIrresistibleCoins( playerid, -iCoinRequirement );
2018-09-27 16:52:38 +00:00
SendServerMessage( playerid, "You have ordered a "COL_GREEN"%s Cash Card (%s)"COL_WHITE" for %s Irresistible Coins!", g_irresistibleCashCards[ listitem ] [ E_NAME ], number_format( cash_amount ), number_format( iCoinRequirement, .decimals = 0 ) );
ShowPlayerHelpDialog( playerid, 10000, "You have bought a ~g~%s~w~ %s Cash Card!", number_format( cash_amount ), g_irresistibleCashCards[ listitem ] [ E_NAME ] );
2018-09-23 04:55:13 +00:00
}
// all other market items
else
{
new Float: iCoinRequirement = g_irresistibleMarketItems[ listitem ] [ E_PRICE ] * GetGVarFloat( "vip_discount" );
if ( player_coins < iCoinRequirement ) {
2018-09-25 18:09:20 +00:00
SendError( playerid, "You need around %s coins before you can get this!", number_format( iCoinRequirement - player_coins, .decimals = 2 ) );
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, p_CoinMarketPage{ playerid } );
}
new selectedItemID = g_irresistibleMarketItems[ listitem ] [ E_ID ];
// show new name dialog before charging
if ( selectedItemID == ICM_NAME ) {
ShowPlayerDialog( playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Change your name", ""COL_WHITE"What would you like your new name to be? And also, double check!", "Change", "Back" );
}
else if ( selectedItemID == ICM_VEH_SLOT ) {
if ( p_ExtraAssetSlots{ playerid } >= VIP_MAX_EXTRA_SLOTS ) {
2018-12-22 23:58:03 +00:00
SendError( playerid, "You have reached the limit of additional slots (limit %d).", VIP_MAX_EXTRA_SLOTS );
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, ICM_PAGE_ASSETS );
}
p_ExtraAssetSlots{ playerid } ++;
GivePlayerIrresistibleCoins( playerid, -iCoinRequirement );
2018-09-25 18:09:20 +00:00
SendServerMessage( playerid, "You have redeemed an "COL_GOLD"vehicle slot"COL_WHITE" for %s Irresistible Coins!", number_format( iCoinRequirement, .decimals = 0 ) );
2019-01-01 13:19:17 +00:00
mysql_single_query( sprintf( "UPDATE `USERS` SET `EXTRA_SLOTS` = %d WHERE `ID` = %d", p_ExtraAssetSlots{ playerid }, GetPlayerAccountID( playerid ) ) );
2018-09-23 04:55:13 +00:00
AddPlayerNote( playerid, -1, sprintf( "Bought veh extra slot, has %d extra", p_ExtraAssetSlots{ playerid } ) );
}
else
{
GivePlayerIrresistibleCoins( playerid, -iCoinRequirement );
AddPlayerNote( playerid, -1, sprintf( ""COL_GOLD"%s" #COL_WHITE, g_irresistibleMarketItems[ listitem ] [ E_NAME ] ) );
SendClientMessageToAdmins( -1, ""COL_PINK"[DONOR NEEDS HELP]"COL_GREY" %s(%d) needs a %s. (/viewnotes)", ReturnPlayerName( playerid ), playerid, g_irresistibleMarketItems[ listitem ] [ E_NAME ] );
2018-09-25 18:09:20 +00:00
SendServerMessage( playerid, "You have ordered a "COL_GOLD"%s"COL_WHITE" for %s Irresistible Coins!", g_irresistibleMarketItems[ listitem ] [ E_NAME ], number_format( iCoinRequirement, .decimals = 0 ) );
2018-09-23 04:55:13 +00:00
SendServerMessage( playerid, "Online admins have been notified of your purchase. Use "COL_GREY"/notes"COL_WHITE" to track your orders and to remind online admins." );
2018-09-25 18:09:20 +00:00
ShowPlayerHelpDialog( playerid, 10000, "You can use ~y~/notes~w~ to track your orders.~n~~n~Also, admins will be reminded using this command." );
2018-09-23 04:55:13 +00:00
}
/*case 8:
{
2019-01-01 13:19:17 +00:00
if ( ( iCoinRequirement = 100.0 * GetGVarFloat( "vip_discount" ) ) <= GetPlayerIrresistibleCoins( playerid ) )
2018-09-23 04:55:13 +00:00
{
new
ownerid = INVALID_PLAYER_ID,
vehicleid = GetPlayerVehicleID( playerid ),
buyableid = getVehicleSlotFromID( vehicleid, ownerid ),
modelid = GetVehicleModel( vehicleid )
;
if ( !vehicleid ) SendError( playerid, "You need to be in a vehicle to use this command." );
else if ( buyableid == -1 ) SendError( playerid, "This vehicle isn't a buyable vehicle." );
else if ( playerid != ownerid ) SendError( playerid, "You are not the owner of this vehicle." );
else if ( IsBoatVehicle( modelid ) || IsAirVehicle( modelid ) ) SendError( playerid, "You cannot apply gold rims to this type of vehicle." );
else
{
if ( AddVehicleComponent( vehicleid, 1080 ) )
{
if ( UpdateBuyableVehicleMods( playerid, buyableid ) )
{
new
szMods[ MAX_CAR_MODS * 10 ];
for( new i; i < MAX_CAR_MODS; i++ )
format( szMods, sizeof( szMods ), "%s%d.", szMods, g_vehicleModifications[ playerid ] [ buyableid ] [ i ] );
format( szBigString, sizeof( szBigString ), "UPDATE `VEHICLES` SET `MODS`='%s' WHERE `ID`=%d", szMods, g_vehicleData[ playerid ] [ buyableid ] [ E_SQL_ID ] );
mysql_single_query( szBigString );
}
2019-01-01 13:19:17 +00:00
GivePlayerIrresistibleCoins( playerid, - iCoinRequirement );
2018-09-25 18:09:20 +00:00
SendServerMessage( playerid, "You have redeemed "COL_GOLD"Gold Rims"COL_WHITE" on your vehicle for %s Irresistible Coins!", number_format( iCoinRequirement, .decimals = 0 ) );
2018-09-23 04:55:13 +00:00
// Receipt
AddPlayerNote( playerid, -1, sprintf( "Bought gold rims on vehicle #%d", g_vehicleData[ playerid ] [ buyableid ] [ E_SQL_ID ] ) );
}
else SendError( playerid, "We were unable to place gold rims on this vehicle (0xF92D)." );
}
return ShowPlayerCoinMarketDialog( playerid, true );
}
else
{
2019-01-01 13:19:17 +00:00
SendError( playerid, "You need around %s coins before you can get this!", number_format( iCoinRequirement - GetPlayerIrresistibleCoins( playerid ), .decimals = 2 ) );
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, true );
}
}*/
}
}
else if ( dialogid == DIALOG_CHANGENAME )
{
if ( !response )
return ShowPlayerCoinMarketDialog( playerid, ICM_PAGE_ASSETS );
new selected_item = p_CoinMarketSelectedItem{ playerid };
if ( ! ( 0 <= selected_item < sizeof( g_irresistibleMarketItems ) && g_irresistibleMarketItems[ selected_item ] [ E_ID ] == ICM_NAME ) ) {
return SendError( playerid, "Invalid option selected, please try again." );
}
new Float: iCoinRequirement = g_irresistibleMarketItems[ selected_item ] [ E_PRICE ] * GetGVarFloat( "vip_discount" );
new Float: player_coins = GetPlayerIrresistibleCoins( playerid );
if ( player_coins < iCoinRequirement ) {
2018-09-25 18:09:20 +00:00
SendError( playerid, "You need around %s coins before you can get this!", number_format( iCoinRequirement - player_coins, .decimals = 2 ) );
2018-09-23 04:55:13 +00:00
return ShowPlayerCoinMarketDialog( playerid, ICM_PAGE_ASSETS );
}
new szName[ 20 ];
if ( sscanf( inputtext, "s[20]", szName ) ) SendError( playerid, "The name you have input is considered invalid." );
else if ( !isValidPlayerName( szName ) ) SendError( playerid, "This name consists of invalid characters." );
else {
return mysql_function_query( dbHandle, sprintf( "SELECT `NAME` FROM `BANS` WHERE `NAME`='%s'", mysql_escape( szName ) ), true, "OnNewNameCheckBanned", "dfs", playerid, iCoinRequirement, szName );
}
return ShowPlayerDialog( playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Change your name", ""COL_WHITE"What would you like your new name to be? And also, double check!", "Change", "Back" );
}
2019-06-01 22:31:48 +00:00
else if ( dialogid == DIALOG_VIP_MAIN && response )
2018-10-22 11:35:55 +00:00
{
static
2019-06-01 22:31:48 +00:00
vip_description[ 1420 ];
2018-10-22 11:35:55 +00:00
2019-06-01 22:31:48 +00:00
switch ( listitem )
2018-10-22 11:35:55 +00:00
{
2019-06-02 02:01:17 +00:00
case 0: format( vip_description, sizeof( vip_description ), "\t"COL_GREY"Feature\t"COL_GREY"Reward\n"\
"Money Provided\t"COL_GREEN"$25,000,000\n"\
"House Provided\t"COL_GREEN"Yes\n"\
"Vehicle Provided\t"COL_GREEN"Yes\n"\
"Garage Provided\t"COL_GREEN"Yes\n"\
"Gate Provided\t"COL_GREEN"Yes\n"\
"Weed Business Provided\t"COL_GREEN"Yes\n"\
"House Customization\t"COL_GREEN"Large\n"\
"Total house slots\t"COL_GREEN"No limit\n"\
"Total garage slots\t"COL_GREEN"No limit\n"\
"Total business slots\t"COL_GREEN"No limit\n"\
"Total vehicle slots\t"COL_GREEN"20\n"\
"Weapons on spawn\t"COL_GREEN"3\n"\
"Armour on spawn\t"COL_GREEN"Yes\n"\
"Coin generation increase\t"COL_GREEN"25%%\n"\
"Ability to transfer coins P2P\t"COL_GREEN"Yes\n"\
"Ability to sell coins on the coin market (/ic sell)\t"COL_GREEN"Yes\n"\
"Ability to use two jobs (/vipjob)\t"COL_GREEN"Yes\n"\
"Premium home listing fees waived\t"COL_GREEN"Yes\n"\
"Tax reduction\t"COL_GREEN"50%%\n"\
"Inactive asset protection\t"COL_GREEN"30 days\n"\
"Total Vehicle component editing slots\t"COL_GREEN"10\n"\
"Furniture slots available\t"COL_GREEN"50\n"\
"V.I.P Lounge Weapon Redeeming Cooldown\t"COL_GREEN"No limit\n"\
"V.I.P Tag On Forum\t"COL_GREEN"Yes\n"\
"Access to V.I.P chat\t"COL_GREEN"Yes\n"\
"Access to V.I.P lounge\t"COL_GREEN"Yes\n"\
"Can spawn with a specific skin\t"COL_GREEN"Yes\n"\
"Access to V.I.P toys\t"COL_GREEN"Yes\n"\
"Access to custom gang colors (/gangcolor)\t"COL_GREEN"Yes\n"\
"Access to extra house weapon storage slots\t"COL_GREEN"Yes\n"\
"Can play custom radio URLs (/radio)\t"COL_GREEN"Yes\n"\
"Ability to adjust your label's color (/labelcolor)\t"COL_GREEN"Yes\n"\
"Can show a message to people you kill (/deathmsg)\t"COL_GREEN"Yes\n"\
"Can adjust the sound of your hitmarker (/hitmarker)\t"COL_GREEN"Yes" );
case 1: format( vip_description, sizeof( vip_description ), "\t"COL_GREY"Feature\t"COL_GREY"Reward\n"\
"Money Provided\t"COL_GREEN"$12,500,000\n"\
"House Provided\t"COL_GREEN"Yes\n"\
"Vehicle Provided\t"COL_GREEN"Yes\n"\
"Garage Provided\t"COL_RED"No\n"\
"Gate Provided\t"COL_RED"No\n"\
"Weed Business Provided\t"COL_RED"No\n"\
"House Customization\t"COL_GREEN"Medium\n"\
"Total house slots\t"COL_GREEN"10\n"\
"Total garage slots\t"COL_GREEN"10\n"\
"Total business slots\t"COL_GREEN"10\n"\
"Total vehicle slots\t"COL_GREEN"10\n"\
"Weapons on spawn\t"COL_GREEN"3\n"\
"Armour on spawn\t"COL_GREEN"Yes\n"\
"Coin generation increase\t"COL_GREEN"10%%\n"\
"Ability to transfer coins P2P\t"COL_GREEN"Yes\n"\
"Ability to sell coins on the coin market (/ic sell)\t"COL_GREEN"Yes\n"\
"Ability to use two jobs (/vipjob)\t"COL_RED"No\n"\
"Premium home listing fees waived\t"COL_GREEN"Yes\n"\
"Tax reduction\t"COL_RED"0%%\n"\
"Inactive asset protection\t"COL_GREEN"14 days\n"\
"Total Vehicle component editing slots\t"COL_GREEN"8\n"\
"Furniture slots available\t"COL_GREEN"45\n"\
"V.I.P Lounge Weapon Redeeming Cooldown\t"COL_GREEN"1 minutes\n"\
"V.I.P Tag On Forum\t"COL_GREEN"Yes\n"\
"Access to V.I.P chat\t"COL_GREEN"Yes\n"\
"Access to V.I.P lounge\t"COL_GREEN"Yes\n"\
"Can spawn with a specific skin\t"COL_GREEN"Yes\n"\
"Access to V.I.P toys\t"COL_GREEN"Yes\n"\
"Access to custom gang colors (/gangcolor)\t"COL_GREEN"Yes\n"\
"Access to extra house weapon storage slots\t"COL_GREEN"Yes\n"\
"Can play custom radio URLs (/radio)\t"COL_GREEN"Yes\n"\
"Ability to adjust your label's color (/labelcolor)\t"COL_GREEN"Yes\n"\
"Can show a message to people you kill (/deathmsg)\t"COL_GREEN"Yes\n"\
"Can adjust the sound of your hitmarker (/hitmarker)\t"COL_GREEN"Yes" );
case 2: format( vip_description, sizeof( vip_description ), "\t"COL_GREY"Feature\t"COL_GREY"Reward\n"\
"Money Provided\t"COL_GREEN"$5,000,000\n"\
"House Provided\t"COL_GREEN"Yes\n"\
"Vehicle Provided\t"COL_GREEN"Yes\n"\
"Garage Provided\t"COL_RED"No\n"\
"Gate Provided\t"COL_RED"No\n"\
"Weed Business Provided\t"COL_RED"No\n"\
"House Customization\t"COL_GREEN"Small\n"\
"Total house slots\t"COL_GREEN"8\n"\
"Total garage slots\t"COL_GREEN"8\n"\
"Total business slots\t"COL_GREEN"8\n"\
"Total vehicle slots\t"COL_GREEN"6\n"\
"Weapons on spawn\t"COL_GREEN"2\n"\
"Armour on spawn\t"COL_GREEN"Yes\n"\
"Coin generation increase\t"COL_RED"0%%\n"\
"Ability to transfer coins P2P\t"COL_GREEN"Yes\n"\
"Ability to sell coins on the coin market (/ic sell)\t"COL_GREEN"Yes\n"\
"Ability to use two jobs (/vipjob)\t"COL_RED"No\n"\
"Premium home listing fees waived\t"COL_RED"No\n"\
"Tax reduction\t"COL_RED"0%%\n"\
"Inactive asset protection\t"COL_GREEN"14 days\n"\
"Total Vehicle component editing slots\t"COL_GREEN"6\n"\
"Furniture slots available\t"COL_GREEN"40\n"\
"V.I.P Lounge Weapon Redeeming Cooldown\t"COL_GREEN"5 minutes\n"\
"V.I.P Tag On Forum\t"COL_GREEN"Yes\n"\
"Access to V.I.P chat\t"COL_GREEN"Yes\n"\
"Access to V.I.P lounge\t"COL_GREEN"Yes\n"\
"Can spawn with a specific skin\t"COL_GREEN"Yes\n"\
"Access to V.I.P toys\t"COL_GREEN"Yes\n"\
"Access to custom gang colors (/gangcolor)\t"COL_GREEN"Yes\n"\
"Access to extra house weapon storage slots\t"COL_GREEN"Yes\n"\
"Can play custom radio URLs (/radio)\t"COL_GREEN"Yes\n"\
"Ability to adjust your label's color (/labelcolor)\t"COL_GREEN"Yes\n"\
"Can show a message to people you kill (/deathmsg)\t"COL_GREEN"Yes\n"\
"Can adjust the sound of your hitmarker (/hitmarker)\t"COL_GREEN"Yes" );
case 3: format( vip_description, sizeof( vip_description ), "\t"COL_GREY"Feature\t"COL_GREY"Reward\n"\
"Money Provided\t"COL_GREEN"$2,500,000\n"\
"House Provided\t"COL_RED"No\n"\
"Vehicle Provided\t"COL_RED"No\n"\
"Garage Provided\t"COL_RED"No\n"\
"Gate Provided\t"COL_RED"No\n"\
"Weed Business Provided\t"COL_RED"No\n"\
"House Customization\t"COL_RED"No\n"\
"Total house slots\t"COL_GREEN"6\n"\
"Total garage slots\t"COL_GREEN"6\n"\
"Total business slots\t"COL_GREEN"6\n"\
"Total vehicle slots\t"COL_GREEN"4\n"\
"Weapons on spawn\t"COL_GREEN"1\n"\
"Armour on spawn\t"COL_RED"No\n"\
"Coin generation increase\t"COL_RED"0%%\n"\
"Ability to transfer coins P2P\t"COL_GREEN"Yes\n"\
"Ability to sell coins on the coin market (/ic sell)\t"COL_GREEN"Yes\n"\
"Ability to use two jobs (/vipjob)\t"COL_RED"No\n"\
"Premium home listing fees waived\t"COL_RED"No\n"\
"Tax reduction\t"COL_RED"0%%\n"\
"Inactive asset protection\t"COL_GREEN"14 days\n"\
"Total Vehicle component editing slots\t"COL_GREEN"4\n"\
"Furniture slots available\t"COL_GREEN"35\n"\
"V.I.P Lounge Weapon Redeeming Cooldown\t"COL_GREEN"5 minutes\n"\
"V.I.P Tag On Forum\t"COL_GREEN"Yes\n"\
"Access to V.I.P chat\t"COL_GREEN"Yes\n"\
"Access to V.I.P lounge\t"COL_GREEN"Yes\n"\
"Can spawn with a specific skin\t"COL_GREEN"Yes\n"\
"Access to V.I.P toys\t"COL_GREEN"Yes\n"\
"Access to custom gang colors (/gangcolor)\t"COL_GREEN"Yes\n"\
"Access to extra house weapon storage slots\t"COL_GREEN"Yes\n"\
"Can play custom radio URLs (/radio)\t"COL_GREEN"Yes\n"\
"Ability to adjust your label's color (/labelcolor)\t"COL_GREEN"Yes\n"\
"Can show a message to people you kill (/deathmsg)\t"COL_GREEN"Yes\n"\
"Can adjust the sound of your hitmarker (/hitmarker)\t"COL_GREEN"Yes" );
case 4: format( vip_description, sizeof( vip_description ), "\t"COL_GREY"Feature\t"COL_GREY"Reward\n"\
"Money Provided\t"COL_GREEN"$500,000\n"\
"House Provided\t"COL_RED"No\n"\
"Vehicle Provided\t"COL_RED"No\n"\
"Garage Provided\t"COL_RED"No\n"\
"Gate Provided\t"COL_RED"No\n"\
"Weed Business Provided\t"COL_RED"No\n"\
"House Customization\t"COL_RED"No\n"\
"Total house slots\t"COL_GREEN"5\n"\
"Total garage slots\t"COL_GREEN"5\n"\
"Total business slots\t"COL_GREEN"5\n"\
"Total vehicle slots\t"COL_GREEN"3\n"\
"Weapons on spawn\t"COL_GREEN"1\n"\
"Armour on spawn\t"COL_RED"No\n"\
"Coin generation increase\t"COL_RED"0%%\n"\
"Ability to transfer coins P2P\t"COL_RED"No\n"\
"Ability to sell coins on the coin market (/ic sell)\t"COL_RED"No\n"\
"Ability to use two jobs (/vipjob)\t"COL_RED"No\n"\
"Premium home listing fees waived\t"COL_RED"No\n"\
"Tax reduction\t"COL_RED"0%%\n"\
"Inactive asset protection\t"COL_GREEN"14 days\n"\
"Total Vehicle component editing slots\t"COL_GREEN"3\n"\
"Furniture slots available\t"COL_GREEN"30\n"\
"V.I.P Lounge Weapon Redeeming Cooldown\t"COL_GREEN"5 minutes\n"\
"V.I.P Tag On Forum\t"COL_GREEN"Yes\n"\
"Access to V.I.P chat\t"COL_GREEN"Yes\n"\
"Access to V.I.P lounge\t"COL_GREEN"Yes\n"\
"Can spawn with a specific skin\t"COL_GREEN"Yes\n"\
"Access to V.I.P toys\t"COL_GREEN"Yes\n"\
"Access to custom gang colors (/gangcolor)\t"COL_GREEN"Yes\n"\
"Access to extra house weapon storage slots\t"COL_GREEN"Yes\n"\
"Can play custom radio URLs (/radio)\t"COL_GREEN"Yes\n"\
"Ability to adjust your label's color (/labelcolor)\t"COL_GREEN"Yes\n"\
"Can show a message to people you kill (/deathmsg)\t"COL_GREEN"Yes\n"\
"Can adjust the sound of your hitmarker (/hitmarker)\t"COL_GREEN"Yes" );
2018-10-22 11:35:55 +00:00
}
2019-06-01 22:31:48 +00:00
2019-06-02 02:01:17 +00:00
ShowPlayerDialog( playerid, DIALOG_BUY_VIP_MAIN, DIALOG_STYLE_TABLIST_HEADERS, sprintf( ""COL_GOLD"%s", g_irresistibleVipItems[ listitem ][ E_NAME ] ), vip_description, "Buy", "Back" );
2019-06-01 22:31:48 +00:00
return 1;
}
else if ( dialogid == DIALOG_BUY_VIP_MAIN )
{
// if the player clicked on the right button, return /vip
if ( ! response ) return cmd_vip( playerid, " " );
else if ( response ) return ShowPlayerCoinMarketDialog( playerid );
2018-10-22 11:35:55 +00:00
}
2019-06-01 22:31:48 +00:00
2018-09-23 04:55:13 +00:00
else if ( dialogid == DIALOG_BUY_VIP && response )
{
return ShowPlayerCoinMarketDialog( playerid );
}
2018-10-22 10:50:11 +00:00
else if ( dialogid == DIALOG_DONATED_PLATBRONZE )
{
if ( response )
{
new
pID;
if ( sscanf( inputtext, "u", pID ) )
{
SendError( playerid, "Please enter a player's ID or name." );
2019-05-29 13:05:13 +00:00
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 " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
2018-10-22 10:50:11 +00:00
}
else if ( !IsPlayerConnected( pID ) )
{
SendError( playerid, "This player is not connected." );
2019-05-29 13:05:13 +00:00
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 " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
2018-10-22 10:50:11 +00:00
}
else
{
SendClientMessageFormatted( playerid, -1, ""COL_GOLD"[V.I.P]"COL_WHITE" You have gifted Bronze V.I.P to %s(%d)!", ReturnPlayerName( pID ), pID );
SetPlayerVipLevel( pID, VIP_BRONZE );
ShowPlayerVipRedeemedDialog( playerid );
}
}
else
{
AddPlayerNote( playerid, -1, "{CD7F32}Bronze V.I.P" #COL_WHITE );
SendServerMessage( playerid, "This has been noted down for your account and will be given to you at a stage that you want, contact an executive." );
ShowPlayerVipRedeemedDialog( playerid );
}
}
else if ( dialogid == DIALOG_DONATED_DIAGOLD )
{
if ( response )
{
new
pID;
if ( sscanf( inputtext, "u", pID ) )
{
SendError( playerid, "Please enter a player's ID or name." );
2019-05-29 13:05:13 +00:00
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 " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
2018-10-22 10:50:11 +00:00
}
else if ( !IsPlayerConnected( pID ) )
{
SendError( playerid, "This player is not connected." );
2019-05-29 13:05:13 +00:00
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 " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
2018-10-22 10:50:11 +00:00
}
else
{
SendClientMessageFormatted( playerid, -1, ""COL_GOLD"[V.I.P]"COL_WHITE" You have gifted Gold V.I.P to %s(%d)!", ReturnPlayerName( pID ), pID );
SetPlayerVipLevel( pID, VIP_GOLD );
ShowPlayerVipRedeemedDialog( playerid );
}
}
else
{
AddPlayerNote( playerid, -1, ""COL_GOLD"Gold V.I.P" #COL_WHITE );
SendServerMessage( playerid, "This has been noted down for your account and will be given to you at a stage that you want, contact an executive." );
ShowPlayerVipRedeemedDialog( playerid );
}
}
2018-09-23 04:55:13 +00:00
return 1;
}
/* ** Commands ** */
2018-12-22 23:58:03 +00:00
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" ) )
{
2019-01-01 13:19:17 +00:00
return SendServerMessage( playerid, "You currently have precisely "COL_GOLD"%s"COL_WHITE" Irresistible Coins!", number_format( GetPlayerIrresistibleCoins( playerid ) ) );
2018-12-22 23:58:03 +00:00
}
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." );
2019-05-30 14:15:31 +00:00
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" );
2019-01-15 23:04:57 +00:00
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." );
2018-12-22 23:58:03 +00:00
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...
2019-01-01 13:19:17 +00:00
else if ( GetPlayerIrresistibleCoins( playerid ) < coins ) return SendError( playerid, "You do not have this number of coins to send." );
2018-12-22 23:58:03 +00:00
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
{
2019-01-25 04:39:34 +00:00
if ( GetDistanceBetweenPlayers( playerid, senttoid ) > 8.0 || p_Spectating{ senttoid } )
2018-12-22 23:58:03 +00:00
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 );
2019-01-01 13:19:17 +00:00
GivePlayerIrresistibleCoins( senttoid, coins );
GivePlayerIrresistibleCoins( playerid, -coins );
2018-12-22 23:58:03 +00:00
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]" );
}
2018-09-23 04:55:13 +00:00
CMD:donate( playerid, params[ ] ) return cmd_vip( playerid, params );
CMD:vip( playerid, params[ ] )
{
2019-06-01 22:31:48 +00:00
p_SelectedPackage{ playerid } = -1;
2019-06-02 02:01:17 +00:00
ShowPlayerDialog( playerid, DIALOG_VIP_MAIN, DIALOG_STYLE_TABLIST, ""COL_GOLD"VIP Packages", "{4EE2EC}Diamond VIP\t"COL_GREEN"$100.00 USD\n{E0E0E0}Platinum VIP\t"COL_GREEN"$50.00 USD\n"COL_GOLD"Gold VIP\t"COL_GREEN"$25.00 USD\n{CD7F32}Bronze VIP\t"COL_GREEN"$15.00 USD\n"COL_GREY"Regular VIP\t"COL_GREEN"$5.00 USD)", "Select", "Close" );
2018-09-23 04:55:13 +00:00
return 1;
}
2019-01-01 06:54:34 +00:00
CMD:vipcmds( playerid, params[ ] )
{
if ( p_VIPLevel[ playerid ] < 1 ) return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
erase( szLargeString );
2019-06-02 02:01:17 +00:00
strcat( szLargeString, ""COL_GREY"/vipspawnwep"COL_WHITE" - Configure your spawning weapons\n"\
""COL_GREY"/vipskin"COL_WHITE" - Configure your spawning skin\n"\
""COL_GREY"/viplist"COL_WHITE" - A list of all online V.I.P. players.\n"\
""COL_GREY"/vipgun"COL_WHITE" - Redeem weapons or an armour vest from the gun locker\n"\
""COL_GREY"/vsay"COL_WHITE" - Global V.I.P Chat\n"\
""COL_GREY"/vipjob"COL_WHITE" - Choose your V.I.P. job that allows you to have two jobs at once.\n"\
""COL_GREY"/mynotes"COL_WHITE" - Access your VIP notes and material" );
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"V.I.P Commands", szLargeString, "Okay", "" );
2019-01-01 06:54:34 +00:00
return 1;
}
2018-09-23 04:55:13 +00:00
/* ** Functions ** */
stock ShowPlayerCoinMarketDialog( playerid, page = ICM_PAGE_DEFAULT )
{
// if ( p_accountSecurityData[ playerid ] [ E_ID ] && ! p_accountSecurityData[ playerid ] [ E_VERIFIED ] && p_accountSecurityData[ playerid ] [ E_MODE ] != SECURITY_MODE_DISABLED )
// return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" );
new Float: discount = GetGVarFloat( "vip_discount" );
new szMarket[ 512 ] = ""COL_GREY"Item Name\t"COL_GREY"Coins Needed\n";
2018-10-22 10:50:11 +00:00
if ( page == ICM_PAGE_DEFAULT )
2018-09-23 04:55:13 +00:00
{
2018-10-22 10:50:11 +00:00
//new current_vip = GetPlayerVIPLevel( playerid );
2018-09-23 04:55:13 +00:00
for( new i = 0; i < sizeof( g_irresistibleVipItems ); i++ )
{
new Float: iCoinRequirement = g_irresistibleVipItems[ i ] [ E_PRICE ] * discount;
2018-10-22 10:50:11 +00:00
/*if ( current_vip != 0 && current_vip != g_irresistibleVipItems[ i ] [ E_ID ] ) {
2018-09-25 18:09:20 +00:00
format( szMarket, sizeof( szMarket ), "%s{333333}%s\t{333333}%s\n", szMarket, g_irresistibleVipItems[ i ] [ E_NAME ], number_format( iCoinRequirement, .decimals = 0 ) );
2018-10-22 10:50:11 +00:00
} else { }*/
2018-09-25 18:09:20 +00:00
2018-10-22 10:50:11 +00:00
format( szMarket, sizeof( szMarket ), "%s%s\t"COL_GOLD"%s\n", szMarket, g_irresistibleVipItems[ i ] [ E_NAME ], number_format( iCoinRequirement, .decimals = 0 ) );
2018-09-23 04:55:13 +00:00
}
// thats it
strcat( szMarket, ""COL_GREEN"Buy shark cards...\t"COL_GREEN">>>\n" );
2018-09-25 18:09:20 +00:00
strcat( szMarket, ""COL_PURPLE"Buy premium homes...\t"COL_PURPLE">>>\n" );
2018-09-23 04:55:13 +00:00
strcat( szMarket, ""COL_GREY"See other items...\t"COL_GREY">>>" );
2019-06-02 02:01:17 +00:00
return ShowPlayerDialog( playerid, DIALOG_IC_MARKET, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Market", szMarket, "Select", "" );
2018-09-23 04:55:13 +00:00
}
else if ( page == ICM_PAGE_CASHCARD )
{
szMarket = ""COL_GREY"Cash Card\t"COL_GREY"Amount ($)\t"COL_GREY"Coins Needed\n";
2018-09-27 16:52:38 +00:00
for( new i = 0; i < sizeof( g_irresistibleCashCards ); i++ )
2018-09-23 04:55:13 +00:00
{
2018-09-27 16:52:38 +00:00
new iCoinRequirement = floatround( g_irresistibleCashCards[ i ] [ E_PRICE ] * discount );
format( szMarket, sizeof( szMarket ), "%s%s\t"COL_GREEN"%s\t"COL_GOLD"%s\n", szMarket, g_irresistibleCashCards[ i ] [ E_NAME ], number_format( g_irresistibleCashCards[ i ] [ E_ID ] ), number_format( iCoinRequirement, .decimals = 0 ) );
2018-09-23 04:55:13 +00:00
}
2019-06-02 02:01:17 +00:00
return ShowPlayerDialog( playerid, DIALOG_IC_MARKET_3, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Cash Cards", szMarket, "Select", "Back" );
2018-09-23 04:55:13 +00:00
}
else
{
for( new i = 0; i < sizeof( g_irresistibleMarketItems ); i++ )
{
2018-09-25 18:09:20 +00:00
new iCoinRequirement = floatround( g_irresistibleMarketItems[ i ] [ E_PRICE ] * discount );
format( szMarket, sizeof( szMarket ), "%s%s\t"COL_GOLD"%s\n", szMarket, g_irresistibleMarketItems[ i ] [ E_NAME ], number_format( iCoinRequirement, .decimals = 0 ) );
2018-09-23 04:55:13 +00:00
}
2019-06-02 02:01:17 +00:00
return ShowPlayerDialog( playerid, DIALOG_IC_MARKET_2, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Asset Market", szMarket, "Select", "Back" );
2018-09-23 04:55:13 +00:00
}
}
stock GetPlayerHouseSlots( playerid )
{
new vip_level = GetPlayerVIPLevel( playerid );
new slots = 3;
switch( vip_level )
{
2018-10-22 10:50:11 +00:00
case VIP_DIAMOND:
slots = 255; // infinite
2018-09-23 04:55:13 +00:00
2018-10-22 10:50:11 +00:00
case VIP_PLATINUM:
2018-09-23 04:55:13 +00:00
slots = 10;
2018-10-22 10:50:11 +00:00
case VIP_GOLD:
slots = 8;
case VIP_BRONZE:
slots = 6;
2018-09-23 04:55:13 +00:00
case VIP_REGULAR:
slots = 5;
}
return slots; // + p_ExtraAssetSlots{ playerid };
}
stock GetPlayerBusinessSlots( playerid ) return GetPlayerHouseSlots( playerid );
stock GetPlayerGarageSlots( playerid ) return GetPlayerHouseSlots( playerid );
stock GetPlayerVehicleSlots( playerid )
{
static const
2018-10-22 11:35:55 +00:00
slots[ 6 ] = { 3, 4, 6, 8, 10, 20 };
2018-09-23 04:55:13 +00:00
2018-10-22 10:50:11 +00:00
return slots[ GetPlayerVIPLevel( playerid ) ] + p_ExtraAssetSlots{ playerid };
2018-09-23 04:55:13 +00:00
}
stock GetPlayerPimpVehicleSlots( playerid )
{
static const
2018-10-22 11:35:55 +00:00
slots[ 6 ] = { 2, 3, 4, 6, 8, 10 };
2018-09-23 04:55:13 +00:00
2018-10-22 10:50:11 +00:00
return slots[ GetPlayerVIPLevel( playerid ) ];
2018-09-23 04:55:13 +00:00
}
stock VIPToString( viplvl )
{
static
string[ 16 ];
switch( viplvl )
{
2018-10-22 10:50:11 +00:00
case VIP_DIAMOND: string = "Diamond";
case VIP_PLATINUM: string = "Platinum";
2018-09-23 04:55:13 +00:00
case VIP_GOLD: string = "Gold";
case VIP_BRONZE: string = "Bronze";
case VIP_REGULAR: string = "Regular";
default: string = "N/A";
}
return string;
}
2018-09-24 01:29:48 +00:00
stock VIPToColor( viplvl )
{
static
string[ 16 ];
switch( viplvl )
{
case VIP_DIAMOND: string = COL_DIAMOND;
case VIP_PLATINUM: string = COL_PLATINUM;
case VIP_GOLD: string = COL_GOLD;
case VIP_BRONZE: string = COL_BRONZE;
case VIP_REGULAR: string = COL_GREY;
default: string = COL_WHITE;
}
return string;
}
2018-09-25 18:09:20 +00:00
2018-11-18 11:41:41 +00:00
stock SetPlayerVipLevel( playerid, level, interval = 2592000, bool: credit_assets = true )
2018-09-25 18:09:20 +00:00
{
2018-10-22 10:50:11 +00:00
if ( ! IsPlayerConnected( playerid ) )
return;
2018-09-25 18:09:20 +00:00
2018-10-22 10:50:11 +00:00
// force upgrade
if ( p_VIPLevel[ playerid ] < level ) {
p_VIPLevel[ playerid ] = level;
}
2018-09-25 18:09:20 +00:00
2018-10-22 10:50:11 +00:00
// check if player already has vip
if ( level ) {
if ( p_VIPExpiretime[ playerid ] > g_iTime ) p_VIPExpiretime[ playerid ] += interval;
else p_VIPExpiretime[ playerid ] += ( g_iTime + interval );
}
2018-09-25 18:09:20 +00:00
2018-10-22 10:50:11 +00:00
// expire the players vip if level 0
else {
p_VIPExpiretime[ playerid ] = 0;
2018-09-25 18:09:20 +00:00
}
2018-10-22 10:50:11 +00:00
// give player appropriate notes/items
2018-11-18 11:41:41 +00:00
if ( credit_assets )
2018-10-22 10:50:11 +00:00
{
2018-11-18 11:41:41 +00:00
switch ( level )
2018-10-22 10:50:11 +00:00
{
2018-11-18 11:41:41 +00:00
case VIP_REGULAR:
{
GivePlayerCash( playerid, 500000 );
}
case VIP_BRONZE:
{
GivePlayerCash( playerid, 2500000 );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P House (Bronze)" # COL_WHITE );
SendClientMessageToAdmins( -1, ""COL_PINK"[VIP NOTE]"COL_GREY" %s(%d) needs a House. (/viewnotes)", ReturnPlayerName( playerid ), playerid );
}
case VIP_GOLD:
{
GivePlayerCash( playerid, 5000000 );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P House (Gold)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Vehicle (Gold)" # COL_WHITE );
SendClientMessageToAdmins( -1, ""COL_PINK"[VIP NOTE]"COL_GREY" %s(%d) needs a House and Vehicle. (/viewnotes)", ReturnPlayerName( playerid ), playerid );
}
case VIP_PLATINUM:
{
GivePlayerCash( playerid, 12500000 );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P House (Platinum)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Vehicle (Platinum)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Garage" # COL_WHITE );
SendClientMessageToAdmins( -1, ""COL_PINK"[VIP NOTE]"COL_GREY" %s(%d) needs a House, Vehicle and Garage. (/viewnotes)", ReturnPlayerName( playerid ), playerid );
}
case VIP_DIAMOND:
{
GivePlayerCash( playerid, 25000000 );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P House (Diamond)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Vehicle (Diamond)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Garage (Diamond)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Gate (Diamond)" # COL_WHITE );
AddPlayerNote( playerid, -1, COL_GOLD # "V.I.P Weed Business (Diamond)" # COL_WHITE );
SendClientMessageToAdmins( -1, ""COL_PINK"[VIP NOTE]"COL_GREY" %s(%d) needs a House, Vehicle, Garage, Gate and Weed Biz. (/viewnotes)", ReturnPlayerName( playerid ), playerid );
}
2018-10-22 10:50:11 +00:00
}
}
2018-09-25 18:09:20 +00:00
}
2018-12-22 11:08:05 +00:00
static stock CheckPlayerVipExpiry( playerid )
{
if ( p_VIPLevel[ playerid ] > 0 && g_iTime > p_VIPExpiretime[ playerid ] )
{
SetPlayerArmour( playerid, 0.0 );
p_VIPExpiretime[ playerid ] = 0;
SendClientMessage( playerid, -1, ""COL_GREY"[NOTIFICATION]"COL_WHITE" Your V.I.P has expired, consider another donation to have your V.I.P restored again for another period." );
p_VIPLevel[ playerid ] = 0;
p_VIPWep1{ playerid } = 0;
p_VIPWep2{ playerid } = 0;
p_VIPWep3{ playerid } = 0;
}
2018-12-23 00:41:04 +00:00
}
2019-01-01 06:54:34 +00:00
static stock ShowPlayerVipRedeemedDialog( playerid )
{
szLargeString[ 0 ] = '\0';
strcat( szLargeString, ""COL_WHITE"You've just blew quite a bit of Irresistible Coins for your V.I.P, so congratulations! :D\n\n"\
""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"\
2019-05-29 13:05:13 +00:00
""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire " SERVER_OPERATOR " via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" );
2019-01-01 06:54:34 +00:00
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" );
}
2019-01-01 15:37:45 +00:00
stock SendClientMessageToVips( colour, const format[ ], va_args<> )
{
static
out[ 144 ];
va_format( out, sizeof( out ), format, va_start<2> );
foreach ( new i : Player ) if ( p_VIPLevel[ i ] >= VIP_REGULAR ) {
SendClientMessage( i, colour, out );
}
return 1;
}
2018-12-23 00:41:04 +00:00
stock IsPlayerPlatinumVIP( playerid ) return p_VIPLevel[ playerid ] >= VIP_PLATINUM;
2019-01-01 13:19:17 +00:00
stock Float: GetPlayerIrresistibleCoins( playerid ) {
return p_IrresistibleCoins[ playerid ];
}
stock GivePlayerIrresistibleCoins( playerid, Float: amount )
{
// set variable prior, then just save the value of it
p_IrresistibleCoins[ playerid ] += amount;
// save player coins on a out/inflow of coins
mysql_single_query( sprintf( "UPDATE `USERS` SET `COINS` = %f WHERE `ID` = %d", p_IrresistibleCoins[ playerid ], GetPlayerAccountID( playerid ) ) );
}
stock SetPlayerIrresistibleCoins( playerid, Float: amount ) {
GivePlayerIrresistibleCoins( playerid, - p_IrresistibleCoins[ playerid ] + amount );
}
stock SetPlayerExtraSlots( playerid, slots ) {
p_ExtraAssetSlots{ playerid } = slots;
2019-01-01 15:37:45 +00:00
}