From bfa237c5e45d345d8becb8f93acb6240f08ea15d Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Wed, 29 May 2019 17:34:54 +0300 Subject: [PATCH 01/66] Update jail.pwn --- gamemodes/irresistible/cnr/features/cop/jail.pwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/cop/jail.pwn b/gamemodes/irresistible/cnr/features/cop/jail.pwn index 2a13ec1..c6df2e5 100644 --- a/gamemodes/irresistible/cnr/features/cop/jail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/jail.pwn @@ -264,6 +264,7 @@ stock JailPlayer( playerid, seconds, admin = 0 ) p_DetainedLabel [ playerid ] = Text3D: INVALID_3DTEXT_ID; p_DetainedBy [ playerid ] = INVALID_PLAYER_ID; + RemovePlayerFromEvent ( playerid, true ); CancelEdit ( playerid ); RemovePlayerStolensFromHands( playerid ); StopPlayerUsingSlotMachine ( playerid ); @@ -541,4 +542,4 @@ stock jailDoors( playerid, remove = false, set_closed = true ) DestroyDynamicObject( p_AlcatrazObject[ playerid ] ), p_AlcatrazObject[ playerid ] = INVALID_OBJECT_ID; } -} \ No newline at end of file +} From 0af017149fc331c9080f1079aa339726c968f289 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Wed, 29 May 2019 17:38:21 +0300 Subject: [PATCH 02/66] Update jail.pwn Removes player from event upon getting jailed --- gamemodes/irresistible/cnr/features/cop/jail.pwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/cop/jail.pwn b/gamemodes/irresistible/cnr/features/cop/jail.pwn index 2a13ec1..6c27297 100644 --- a/gamemodes/irresistible/cnr/features/cop/jail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/jail.pwn @@ -268,6 +268,7 @@ stock JailPlayer( playerid, seconds, admin = 0 ) RemovePlayerStolensFromHands( playerid ); StopPlayerUsingSlotMachine ( playerid ); RemoveEquippedOre ( playerid ); + RemovePlayerFromEvent ( playerid, true ); ClearPlayerWantedLevel ( playerid ); ResetPlayerWeapons ( playerid ); UntiePlayer ( playerid ); @@ -541,4 +542,4 @@ stock jailDoors( playerid, remove = false, set_closed = true ) DestroyDynamicObject( p_AlcatrazObject[ playerid ] ), p_AlcatrazObject[ playerid ] = INVALID_OBJECT_ID; } -} \ No newline at end of file +} From a2f11b3786b8fda141ac9f200ccd0451daf69cbb Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Thu, 30 May 2019 09:10:05 +0300 Subject: [PATCH 03/66] Update jail.pwn --- gamemodes/irresistible/cnr/features/cop/jail.pwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gamemodes/irresistible/cnr/features/cop/jail.pwn b/gamemodes/irresistible/cnr/features/cop/jail.pwn index c6df2e5..df75ad4 100644 --- a/gamemodes/irresistible/cnr/features/cop/jail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/jail.pwn @@ -264,7 +264,9 @@ stock JailPlayer( playerid, seconds, admin = 0 ) p_DetainedLabel [ playerid ] = Text3D: INVALID_3DTEXT_ID; p_DetainedBy [ playerid ] = INVALID_PLAYER_ID; + #if defined __cloudy_event_system RemovePlayerFromEvent ( playerid, true ); + #endif CancelEdit ( playerid ); RemovePlayerStolensFromHands( playerid ); StopPlayerUsingSlotMachine ( playerid ); From 954fc549d422e2e5bd7c4f2bc3ad42f1c6fb2216 Mon Sep 17 00:00:00 2001 From: Dusan Date: Thu, 30 May 2019 16:41:27 +0200 Subject: [PATCH 04/66] Realestate for cash --- .../cnr/features/houses/realestate.pwn | 50 +-- .../cnr/features/houses/realestate.pwn.old | 372 ++++++++++++++++++ .../cnr/20190530_cnr_realestate_ask.sql | 7 + 3 files changed, 404 insertions(+), 25 deletions(-) create mode 100644 gamemodes/irresistible/cnr/features/houses/realestate.pwn.old create mode 100644 gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql diff --git a/gamemodes/irresistible/cnr/features/houses/realestate.pwn b/gamemodes/irresistible/cnr/features/houses/realestate.pwn index fe16431..a69c340 100644 --- a/gamemodes/irresistible/cnr/features/houses/realestate.pwn +++ b/gamemodes/irresistible/cnr/features/houses/realestate.pwn @@ -118,18 +118,18 @@ CMD:estate( playerid, params[ ] ) else if ( !strcmp( params, "list", false, 4 ) ) { new - Float: coins; + cash; - if ( sscanf( params[ 5 ], "f", coins ) ) return SendUsage( playerid, "/estate list [IC_ASK_PRICE/CANCEL]"); + if ( sscanf( params[ 5 ], "d", cash ) ) return SendUsage( playerid, "/estate list [CASH_ASK_PRICE/CANCEL]"); else if ( ! Iter_Contains( houses, houseid ) ) return SendError( playerid, "You are not inside of any home." ); else if ( g_houseData[ houseid ] [ E_COST ] > 2500 ) return SendError( playerid, "This home is not a V.I.P home." ); else if ( ! IsPlayerHomeOwner( playerid, houseid ) ) return SendError( playerid, "You are not the owner of this home." ); - else if ( coins < 25.0 ) return SendError( playerid, "Please specify an ask price greater than 25.00 IC." ); - else if ( coins > 25000.0 ) return SendError( playerid, "Please specify an ask price less than 25,000 IC." ); + else if ( cash < 10000 ) return SendError( playerid, "Please specify an ask price greater than $100.000." ); + else if ( cash > 100000000 ) return SendError( playerid, "Please specify an ask price less than $100.000.000." ); else if ( GetPlayerCash( playerid ) < HOUSE_LISTING_FEE && GetPlayerVIPLevel( playerid ) < VIP_PLATINUM ) return SendError( playerid, "You need at least %s to create a house listing.", cash_format( HOUSE_LISTING_FEE ) ); else { - mysql_tquery( dbHandle, sprintf( "SELECT * FROM `HOUSE_LISTINGS` WHERE `HOUSE_ID` = %d AND `SALE_DATE` IS NULL", houseid ), "HouseListing_OnCreateListing", "ddf", playerid, houseid, coins ); + mysql_tquery( dbHandle, sprintf( "SELECT * FROM `HOUSE_LISTINGS` WHERE `HOUSE_ID` = %d AND `SALE_DATE` IS NULL", houseid ), "HouseListing_OnCreateListing", "ddf", playerid, houseid, cash ); } return 1; } @@ -155,7 +155,7 @@ thread HouseListing_OnShowHomes( playerid, page ) owner[ 24 ]; // set headers - szHugeString = ""COL_GREY"House\t"COL_GREY"Owner\t"COL_GREY"Location\t"COL_GREY"Ask Price (IC)\n"; + szHugeString = ""COL_GREY"House\t"COL_GREY"Owner\t"COL_GREY"Location\t"COL_GREY"Ask Price ($)\n"; for ( new row = 0; row < sizeof ( p_CurrentListings[ ] ); row ++ ) { @@ -172,9 +172,9 @@ thread HouseListing_OnShowHomes( playerid, page ) Get2DCityShort( city, g_houseData[ houseid ] [ E_EX ], g_houseData[ houseid ] [ E_EY ] ); GetZoneFromCoordinates( location, g_houseData[ houseid ] [ E_EX ], g_houseData[ houseid ] [ E_EY ], .placeholder = "Island" ); - new Float: coins = cache_get_field_content_float( row, "ASK" ); + new cash = cache_get_field_content_int( row, "ASK" ); - format( szHugeString, sizeof( szHugeString ), "%s%s\t%s\t%s, %s\t"COL_GREEN"%s IC\n", szHugeString, house_name, owner, location, city, number_format( coins, .decimals = 2 ) ); + format( szHugeString, sizeof( szHugeString ), "%s%s\t%s\t%s, %s\t"COL_GREEN"%s\n", szHugeString, house_name, owner, location, city, cash_format( cash ) ); } else { @@ -193,7 +193,7 @@ thread HouseListing_OnShowHomes( playerid, page ) SetPVarInt( playerid, "houselisting_page", page ); SetPVarInt( playerid, "houselisting_rows", rows ); - return ShowPlayerDialog( playerid, DIALOG_HOUSE_LISTINGS, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin - "COL_WHITE"Premium Home Estate", szHugeString, "Select", "Close" ); + return ShowPlayerDialog( playerid, DIALOG_HOUSE_LISTINGS, DIALOG_STYLE_TABLIST_HEADERS, "Premium Home Estate", szHugeString, "Select", "Close" ); } else { @@ -209,15 +209,15 @@ thread HouseListing_OnShowHome( playerid, house_listing_id ) if ( rows ) { new house_id = cache_get_field_content_int( 0, "HOUSE_ID" ); - new Float: coins = cache_get_field_content_float( 0, "ASK" ); + new cash = cache_get_field_content_int( 0, "ASK" ); SetPVarInt( playerid, "house_listing_viewid", house_listing_id ); SetPVarInt( playerid, "house_listing_houseid", house_id ); return ShowPlayerDialog( playerid, DIALOG_HOUSE_LIST_VIEW, DIALOG_STYLE_TABLIST, - ""COL_GOLD"Irresistible Coin - "COL_WHITE"Premium Home Estate", - sprintf( "Purchase Home\t"COL_GREEN"%s IC\nSet GPS Waypoint\t"COL_GREY">>>", number_format( coins, .decimals = 2 ) ), + "Premium Home Estate", + sprintf( "Purchase Home\t"COL_GREEN"%s\nSet GPS Waypoint\t"COL_GREY">>>", cash_format( cash ) ), "Select", "Back" ); } @@ -235,12 +235,12 @@ thread HouseListing_OnBuyHome( playerid, house_listing_id ) if ( rows ) { new - Float: ask_price = cache_get_field_content_float( 0, "ASK" ); + ask_price = cache_get_field_content_int( 0, "ASK" ); - // does the dude even have the coins - if ( GetPlayerIrresistibleCoins( playerid ) < ask_price ) { + // does the dude even have the cash + if ( GetPlayerCash( playerid ) < ask_price ) { ShowPlayerHomeListing( playerid, house_listing_id ); - return SendError( playerid, "You do not have enough Irresistible Coins for this home (%s IC).", number_format( ask_price, .decimals = 2 ) ); + return SendError( playerid, "You do not have enough money for this home (%s).", cash_format( ask_price ) ); } // check if player is over the limit @@ -278,19 +278,19 @@ thread HouseListing_OnBuyHome( playerid, house_listing_id ) // validate seller id if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) ) { p_OwnedHouses[ sellerid ] --; - GivePlayerIrresistibleCoins( sellerid, ask_price ); - SendServerMessage( sellerid, "You have successfully sold your home (%s) for "COL_GOLD"%s IC"COL_WHITE" to %s(%d)!", g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ), ReturnPlayerName( playerid ), playerid ); + GivePlayerCash( sellerid, ask_price ); + SendServerMessage( sellerid, "You have successfully sold your home (%s) for "COL_GOLD"%s"COL_WHITE" to %s(%d)!", g_houseData[ houseid ] [ E_HOUSE_NAME ], cash_format( ask_price ), ReturnPlayerName( playerid ), playerid ); } else { - mysql_single_query( sprintf( "UPDATE `USERS` SET `COINS` = `COINS` + %f WHERE `ID` = %d", ask_price, owner_account_id ) ); + mysql_single_query( sprintf( "UPDATE `USERS` SET `CASH` = `CASH` + %d WHERE `ID` = %d", ask_price, owner_account_id ) ); } // show sellers name & house name - SendServerMessage( playerid, "You have successfully bought %s's home (%s"COL_WHITE") for "COL_GOLD"%s IC"COL_WHITE"!", g_houseData[ houseid ] [ E_OWNER ], g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ) ); + SendServerMessage( playerid, "You have successfully bought %s's home (%s"COL_WHITE") for "COL_GOLD"%s"COL_WHITE"!", g_houseData[ houseid ] [ E_OWNER ], g_houseData[ houseid ] [ E_HOUSE_NAME ], cash_format( ask_price ) ); // set listing as sold and transfer home mysql_single_query( sprintf( "UPDATE `HOUSE_LISTINGS` SET `SALE_DATE` = CURRENT_TIMESTAMP WHERE `ID` = %d", house_listing_id ) ); SetHouseOwner( houseid, GetPlayerAccountID( playerid ), ReturnPlayerName( playerid ) ); - GivePlayerIrresistibleCoins( playerid, -ask_price ); + GivePlayerCash( playerid, -ask_price ); p_OwnedHouses[ playerid ] ++; return 1; } @@ -300,7 +300,7 @@ thread HouseListing_OnBuyHome( playerid, house_listing_id ) } } -thread HouseListing_OnCreateListing( playerid, houseid, Float: ask_price ) +thread HouseListing_OnCreateListing( playerid, houseid, ask_price ) { new rows = cache_get_row_count( ); @@ -313,7 +313,7 @@ thread HouseListing_OnCreateListing( playerid, houseid, Float: ask_price ) } // insert into database and notify - mysql_single_query( sprintf( "INSERT INTO `HOUSE_LISTINGS` (`HOUSE_ID`, `USER_ID`, `ASK`) VALUES (%d, %d, %f)", houseid, GetPlayerAccountID( playerid ), ask_price ) ); + mysql_single_query( sprintf( "INSERT INTO `HOUSE_LISTINGS` (`HOUSE_ID`, `USER_ID`, `ASK`) VALUES (%d, %d, %d)", houseid, GetPlayerAccountID( playerid ), ask_price ) ); return SendServerMessage( playerid, "You have listed your home. You can retract your listing using "COL_GREY"/estate list cancel"COL_WHITE"." ); } else @@ -364,9 +364,9 @@ stock ShowPlayerHomeListings( playerid, page = 0 ) ID int(11) AUTO_INCREMENT PRIMARY KEY, HOUSE_ID int(11), USER_ID int(11), - ASK float, + ASK int(11), LISTING_DATE TIMESTAMP default CURRENT_TIMESTAMP, SALE_DATE TIMESTAMP nullable default null, FOREIGN KEY (HOUSE_ID) REFERENCES HOUSES (ID) ON DELETE CASCADE ) -*/ +*/ \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/houses/realestate.pwn.old b/gamemodes/irresistible/cnr/features/houses/realestate.pwn.old new file mode 100644 index 0000000..fe16431 --- /dev/null +++ b/gamemodes/irresistible/cnr/features/houses/realestate.pwn.old @@ -0,0 +1,372 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Lorenc + * Module: cnr\features\home\realestate.pwn + * Purpose: home listings for player homes + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Definitions ** */ +// #define DIALOG_HOUSE_LISTINGS 5838 +// #define DIALOG_HOUSE_LIST_VIEW 5839 + +/* ** Macros ** */ +#define ShowPlayerHomeListing(%0,%1) \ + mysql_tquery( dbHandle, sprintf( "SELECT * FROM `HOUSE_LISTINGS` WHERE `ID` = %d", %1 ), "HouseListing_OnShowHome", "dd", %0, %1 ) + +/* ** Constants ** */ +static const + HOUSE_LISTING_FEE = 75000; + +/* ** Variables ** */ +static stock + p_CurrentListings [ MAX_PLAYERS ] [ 20 ]; + +/* ** Hooks ** */ +hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) +{ + if ( dialogid == DIALOG_HOUSE_LISTINGS && response ) + { + new curr_page = GetPVarInt( playerid, "houselisting_page" ); + new curr_page_items = GetPVarInt( playerid, "houselisting_rows" ); + + // pressed previous + if ( listitem >= curr_page_items + 1 ) + { + return ShowPlayerHomeListings( playerid, curr_page - 1 ); + } + + // pressed previous (on last page) / next page + else if ( listitem == curr_page_items ) + { + // pressed first item, but theres not even 20 items? + if ( curr_page_items < sizeof ( p_CurrentListings[ ] ) ) { + return ShowPlayerHomeListings( playerid, curr_page - 1 ); + } else { + return ShowPlayerHomeListings( playerid, curr_page + 1 ); + } + } + + else + { + for ( new i = 0, x = 0; i < sizeof ( p_CurrentListings[ ] ); i ++ ) if ( p_CurrentListings[ playerid ] [ i ] != -1 ) + { + if ( x == listitem ) + { + ShowPlayerHomeListing( playerid, p_CurrentListings[ playerid ] [ i ] ); + break; + } + x ++; + } + } + return 1; + } + else if ( dialogid == DIALOG_HOUSE_LIST_VIEW ) + { + if ( ! response ) + return ShowPlayerHomeListings( playerid, GetPVarInt( playerid, "houselisting_page" ) ); + + new houseid = GetPVarInt( playerid, "house_listing_houseid" ); + new listingid = GetPVarInt( playerid, "house_listing_viewid" ); + + switch ( listitem ) + { + case 0: mysql_tquery( dbHandle, sprintf( "SELECT *, UNIX_TIMESTAMP(`SALE_DATE`) as `SALE_DATE_TS` FROM `HOUSE_LISTINGS` WHERE `ID` = %d", listingid ), "HouseListing_OnBuyHome", "dd", playerid, listingid ); + case 1: + { + if ( IsPlayerInAnyVehicle( playerid ) ) + { + GPS_SetPlayerWaypoint( playerid, g_houseData[ houseid ] [ E_HOUSE_NAME ], g_houseData[ houseid ] [ E_EX ], g_houseData[ houseid ] [ E_EY ], g_houseData[ houseid ] [ E_EZ ] ); + SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GPS]"COL_WHITE" You have set your destination to %s"COL_WHITE". Follow the arrow to reach your destination.", g_houseData[ houseid ] [ E_HOUSE_NAME ] ); + } + else + { + ShowPlayerHomeListing( playerid, listingid ); + SendError( playerid, "You need to be in a vehicle to set a GPS waypoint." ); + return 1; + } + } + } + } + return 1; +} + +hook OnHouseOwnerChange( houseid, owner ) +{ + mysql_single_query( sprintf( "DELETE FROM `HOUSE_LISTINGS` WHERE `HOUSE_ID` = %d AND `SALE_DATE` IS NULL", houseid ) ); + return 1; +} + +/* ** Commands ** */ +CMD:realestate( playerid, params[ ] ) return cmd_estate( playerid, params ); +CMD:estate( playerid, params[ ] ) +{ + new + houseid = p_InHouse[ playerid ]; + + if ( strmatch( params, "list cancel" ) ) + { + if ( ! Iter_Contains( houses, houseid ) ) return SendError( playerid, "You are not inside of any home." ); + else if ( ! IsPlayerHomeOwner( playerid, houseid ) ) return SendError( playerid, "You are not the owner of this home." ); + { + mysql_tquery( dbHandle, sprintf( "DELETE FROM `HOUSE_LISTINGS` WHERE `HOUSE_ID` = %d AND `SALE_DATE` IS NULL", houseid ), "HouseListing_OnDeleteListing", "dd", playerid, houseid ); + } + return 1; + } + else if ( !strcmp( params, "list", false, 4 ) ) + { + new + Float: coins; + + if ( sscanf( params[ 5 ], "f", coins ) ) return SendUsage( playerid, "/estate list [IC_ASK_PRICE/CANCEL]"); + else if ( ! Iter_Contains( houses, houseid ) ) return SendError( playerid, "You are not inside of any home." ); + else if ( g_houseData[ houseid ] [ E_COST ] > 2500 ) return SendError( playerid, "This home is not a V.I.P home." ); + else if ( ! IsPlayerHomeOwner( playerid, houseid ) ) return SendError( playerid, "You are not the owner of this home." ); + else if ( coins < 25.0 ) return SendError( playerid, "Please specify an ask price greater than 25.00 IC." ); + else if ( coins > 25000.0 ) return SendError( playerid, "Please specify an ask price less than 25,000 IC." ); + else if ( GetPlayerCash( playerid ) < HOUSE_LISTING_FEE && GetPlayerVIPLevel( playerid ) < VIP_PLATINUM ) return SendError( playerid, "You need at least %s to create a house listing.", cash_format( HOUSE_LISTING_FEE ) ); + else + { + mysql_tquery( dbHandle, sprintf( "SELECT * FROM `HOUSE_LISTINGS` WHERE `HOUSE_ID` = %d AND `SALE_DATE` IS NULL", houseid ), "HouseListing_OnCreateListing", "ddf", playerid, houseid, coins ); + } + return 1; + } + else + { + SendServerMessage( playerid, "You can list your own home using "COL_GREY"/estate list"COL_WHITE" for %s.", p_VIPLevel[ playerid ] < VIP_PLATINUM ? ( cash_format( HOUSE_LISTING_FEE ) ) : ( "FREE" ) ); + return ShowPlayerHomeListings( playerid ); + } +} + +/* ** SQL Threads ** */ +thread HouseListing_OnShowHomes( playerid, page ) +{ + new + rows = cache_get_row_count( ); + + if ( rows ) + { + static + location[ MAX_ZONE_NAME ], + city[ 3 ], + house_name[ 32 ], + owner[ 24 ]; + + // set headers + szHugeString = ""COL_GREY"House\t"COL_GREY"Owner\t"COL_GREY"Location\t"COL_GREY"Ask Price (IC)\n"; + + for ( new row = 0; row < sizeof ( p_CurrentListings[ ] ); row ++ ) + { + if ( row < rows ) + { + // store all the listing ids to the player + p_CurrentListings[ playerid ] [ row ] = cache_get_field_content_int( row, "ID" ); + + cache_get_field_content( row, "NAME", house_name ); + cache_get_field_content( row, "OWNER", owner ); + + new houseid = cache_get_field_content_int( row, "HOUSE_ID" ); + + Get2DCityShort( city, g_houseData[ houseid ] [ E_EX ], g_houseData[ houseid ] [ E_EY ] ); + GetZoneFromCoordinates( location, g_houseData[ houseid ] [ E_EX ], g_houseData[ houseid ] [ E_EY ], .placeholder = "Island" ); + + new Float: coins = cache_get_field_content_float( row, "ASK" ); + + format( szHugeString, sizeof( szHugeString ), "%s%s\t%s\t%s, %s\t"COL_GREEN"%s IC\n", szHugeString, house_name, owner, location, city, number_format( coins, .decimals = 2 ) ); + } + else + { + p_CurrentListings[ playerid ] [ row ] = -1; + } + } + + if ( rows >= sizeof ( p_CurrentListings[ ] ) ) { + strcat( szHugeString, ""COL_GREEN"Next Page\t"COL_GREEN">>>\t"COL_GREEN">>>\t"COL_GREEN">>>\t"COL_GREEN">>>\n" ); + } + + if ( page ) { + strcat( szHugeString, ""COL_ORANGE"Previous Page\t"COL_ORANGE"<<<\t"COL_ORANGE"<<<\t"COL_ORANGE"<<<\t"COL_ORANGE"<<<\n" ); + } + + SetPVarInt( playerid, "houselisting_page", page ); + SetPVarInt( playerid, "houselisting_rows", rows ); + + return ShowPlayerDialog( playerid, DIALOG_HOUSE_LISTINGS, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin - "COL_WHITE"Premium Home Estate", szHugeString, "Select", "Close" ); + } + else + { + return SendError( playerid, "There are no available homes for sale at current." ); + } +} + +thread HouseListing_OnShowHome( playerid, house_listing_id ) +{ + new + rows = cache_get_row_count( ); + + if ( rows ) + { + new house_id = cache_get_field_content_int( 0, "HOUSE_ID" ); + new Float: coins = cache_get_field_content_float( 0, "ASK" ); + + SetPVarInt( playerid, "house_listing_viewid", house_listing_id ); + SetPVarInt( playerid, "house_listing_houseid", house_id ); + + return ShowPlayerDialog( + playerid, DIALOG_HOUSE_LIST_VIEW, DIALOG_STYLE_TABLIST, + ""COL_GOLD"Irresistible Coin - "COL_WHITE"Premium Home Estate", + sprintf( "Purchase Home\t"COL_GREEN"%s IC\nSet GPS Waypoint\t"COL_GREY">>>", number_format( coins, .decimals = 2 ) ), + "Select", "Back" + ); + } + else + { + return SendError( playerid, "An error has occurred, please try again." ); + } +} + +thread HouseListing_OnBuyHome( playerid, house_listing_id ) +{ + new + rows = cache_get_row_count( ); + + if ( rows ) + { + new + Float: ask_price = cache_get_field_content_float( 0, "ASK" ); + + // does the dude even have the coins + if ( GetPlayerIrresistibleCoins( playerid ) < ask_price ) { + ShowPlayerHomeListing( playerid, house_listing_id ); + return SendError( playerid, "You do not have enough Irresistible Coins for this home (%s IC).", number_format( ask_price, .decimals = 2 ) ); + } + + // check if player is over the limit + if ( p_OwnedHouses[ playerid ] >= GetPlayerHouseSlots( playerid ) ) { + ShowPlayerHomeListing( playerid, house_listing_id ); + return SendError( playerid, "You cannot purchase any more houses, you've reached the limit." ); + } + + // check if sale already completed + new + sale_date_ts = cache_get_field_content_int( 0, "SALE_DATE_TS" ); + + if ( sale_date_ts != 0 && GetServerTime( ) > sale_date_ts ) { + return SendError( playerid, "You can no longer buy this home as it has been sold." ); + } + + // check if buyer is the player himself + new + owner_account_id = cache_get_field_content_int( 0, "USER_ID" ); + + if ( GetPlayerAccountID( playerid ) == owner_account_id ) { + ShowPlayerHomeListing( playerid, house_listing_id ); + return SendError( playerid, "You cannot buy your own home." ); + } + + // credit seller if they are on/offline + new + houseid = cache_get_field_content_int( 0, "HOUSE_ID" ), + sellerid; + + foreach ( sellerid : Player ) if ( GetPlayerAccountID( sellerid ) == owner_account_id ) { + break; + } + + // validate seller id + if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) ) { + p_OwnedHouses[ sellerid ] --; + GivePlayerIrresistibleCoins( sellerid, ask_price ); + SendServerMessage( sellerid, "You have successfully sold your home (%s) for "COL_GOLD"%s IC"COL_WHITE" to %s(%d)!", g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ), ReturnPlayerName( playerid ), playerid ); + } else { + mysql_single_query( sprintf( "UPDATE `USERS` SET `COINS` = `COINS` + %f WHERE `ID` = %d", ask_price, owner_account_id ) ); + } + + // show sellers name & house name + SendServerMessage( playerid, "You have successfully bought %s's home (%s"COL_WHITE") for "COL_GOLD"%s IC"COL_WHITE"!", g_houseData[ houseid ] [ E_OWNER ], g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ) ); + + // set listing as sold and transfer home + mysql_single_query( sprintf( "UPDATE `HOUSE_LISTINGS` SET `SALE_DATE` = CURRENT_TIMESTAMP WHERE `ID` = %d", house_listing_id ) ); + SetHouseOwner( houseid, GetPlayerAccountID( playerid ), ReturnPlayerName( playerid ) ); + GivePlayerIrresistibleCoins( playerid, -ask_price ); + p_OwnedHouses[ playerid ] ++; + return 1; + } + else + { + return SendError( playerid, "An error has occurred, please try again." ); + } +} + +thread HouseListing_OnCreateListing( playerid, houseid, Float: ask_price ) +{ + new + rows = cache_get_row_count( ); + + if ( ! rows ) + { + // debit user account + if ( GetPlayerVIPLevel( playerid ) < VIP_PLATINUM ) { + GivePlayerCash( playerid, -HOUSE_LISTING_FEE ); + } + + // insert into database and notify + mysql_single_query( sprintf( "INSERT INTO `HOUSE_LISTINGS` (`HOUSE_ID`, `USER_ID`, `ASK`) VALUES (%d, %d, %f)", houseid, GetPlayerAccountID( playerid ), ask_price ) ); + return SendServerMessage( playerid, "You have listed your home. You can retract your listing using "COL_GREY"/estate list cancel"COL_WHITE"." ); + } + else + { + return SendError( playerid, "This home is already listed. You can retract your listing using "COL_GREY"/estate list cancel"COL_WHITE"." ); + } +} + +thread HouseListing_OnDeleteListing( playerid, houseid ) +{ + new + deleted_rows = cache_affected_rows( ); + + if ( deleted_rows ) + { + return SendServerMessage( playerid, "You have delisted your home. You can create a new listing using "COL_GREY"/estate list"COL_WHITE"." ); + } + else + { + return SendError( playerid, "This home is not listed on the premium realestate market." ); + } +} + +/* ** Functions ** */ +stock ShowPlayerHomeListings( playerid, page = 0 ) +{ + // just incase we get some negative page from user ... reset + if ( page < 0 ) { + page = 0; + } + + // format query, offset according to page + format( + szBigString, sizeof( szBigString ), + "SELECT HL.ID, HL.HOUSE_ID, H.NAME, U.NAME AS OWNER, HL.ASK FROM HOUSE_LISTINGS HL " \ + "INNER JOIN HOUSES H ON H.ID = HL.HOUSE_ID " \ + "INNER JOIN USERS U ON U.ID = HL.USER_ID " \ + "WHERE SALE_DATE IS NULL LIMIT %d OFFSET %d", + sizeof( p_CurrentListings[ ] ), page * sizeof( p_CurrentListings[ ] ) + ); + return mysql_tquery( dbHandle, szBigString, "HouseListing_OnShowHomes", "dd", playerid, page ); +} + +/* ** Migrations ** */ +/* + DROP TABLE HOUSE_LISTINGS; + CREATE TABLE IF NOT EXISTS HOUSE_LISTINGS ( + ID int(11) AUTO_INCREMENT PRIMARY KEY, + HOUSE_ID int(11), + USER_ID int(11), + ASK float, + LISTING_DATE TIMESTAMP default CURRENT_TIMESTAMP, + SALE_DATE TIMESTAMP nullable default null, + FOREIGN KEY (HOUSE_ID) REFERENCES HOUSES (ID) ON DELETE CASCADE + ) +*/ diff --git a/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql b/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql new file mode 100644 index 0000000..a37c1b8 --- /dev/null +++ b/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql @@ -0,0 +1,7 @@ +-- CREATE A MIGRATION ENTRY +INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190530_cnr_realestate_ask'); + +-- BEGIN + +-- -- ALTER COLUMN TO BE INT INSTEAD OF FLOAT +ALTER TABLE `house_listings` CHANGE COLUMN `ASK` `ASK` INT NULL DEFAULT NULL AFTER `USER_ID`; \ No newline at end of file From 846d8758b7f24312f50ee18258f6881f5b60f566 Mon Sep 17 00:00:00 2001 From: Stev Date: Thu, 30 May 2019 22:21:54 +0100 Subject: [PATCH 05/66] moving variable, to ensure objects (above head) will show correctly --- gamemodes/irresistible/cnr/features/damage_feed.pwn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/damage_feed.pwn b/gamemodes/irresistible/cnr/features/damage_feed.pwn index 320dcb4..04196d0 100644 --- a/gamemodes/irresistible/cnr/features/damage_feed.pwn +++ b/gamemodes/irresistible/cnr/features/damage_feed.pwn @@ -221,9 +221,10 @@ public OnPlayerTakenDamage( playerid, issuerid, Float: amount, weaponid, bodypar SetTimerEx( "HideDamageObject", 1000, false, "d", playerid ); } - // mark player as hit - p_GotHit{ playerid } = true; } + + // mark player as hit + p_GotHit{ playerid } = true; } /* ** Hitmarker ** */ From a3be94a4b868af21982882e2caaa50b2cbd05942 Mon Sep 17 00:00:00 2001 From: Dusan Date: Fri, 31 May 2019 10:36:46 +0200 Subject: [PATCH 06/66] Fixed turf bug --- .../irresistible/cnr/features/gangs/turfs.pwn | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn index ed33b22..aaeebc1 100644 --- a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn @@ -285,14 +285,7 @@ hook OnPlayerEnterDynArea( playerid, areaid ) new first_turf = Turf_GetFirstTurf( playerid ); - if ( ! IsPlayerMovieMode( playerid ) ) - { - if ( first_turf == INVALID_GANG_TURF ) - return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" ); - - // if ( p_GangID[ playerid ] != INVALID_GANG_ID && g_gangTurfData[ first_turf ] [ E_OWNER ] == INVALID_GANG_ID ) ShowPlayerHelpDialog( playerid, 2000, "You can take over this turf by typing ~g~/takeover" ); - PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(%s)~n~~w~~h~%s", g_gangTurfData[ first_turf ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ? ( "FACILITY" ) : ( "TERRITORY" ), ReturnGangName( g_gangTurfData[ first_turf ] [ E_OWNER ] ) ) ); - } + CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf ); } return Y_HOOKS_CONTINUE_RETURN_1; } @@ -346,6 +339,21 @@ hook OnPlayerLeaveDynArea( playerid, areaid ) return Y_HOOKS_CONTINUE_RETURN_1; } +public OnPlayerUpdateGangZone( playerid, zoneid ) +{ + if ( ! IsPlayerMovieMode( playerid ) ) + { + if ( zoneid == INVALID_GANG_TURF ) + return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" ); + + if ( p_GangID[ playerid ] != INVALID_GANG_ID && g_gangTurfData[ zoneid ] [ E_OWNER ] == INVALID_GANG_ID ) + ShowPlayerHelpDialog( playerid, 6000, "You can take over this turf by typing ~g~/takeover" ); + + PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(%s)~n~~w~~h~%s", g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ? ( "FACILITY" ) : ( "TERRITORY" ), g_gangTurfData[ zoneid ] [ E_OWNER ] == -1 ? ( "Uncaptured" ) : ( ReturnGangName( g_gangTurfData[ zoneid ] [ E_OWNER ] ) ) ) ); + } + return 1; +} + /* ** Commands ** */ CMD:takeover( playerid, params[ ] ) { From 33de4b0722d8da67bda4c9768c13e71037187d61 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 19:24:56 +1000 Subject: [PATCH 07/66] fix cloudy merge potential issue --- gamemodes/irresistible/cnr/features/cop/jail.pwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/cop/jail.pwn b/gamemodes/irresistible/cnr/features/cop/jail.pwn index 6c27297..ef4976b 100644 --- a/gamemodes/irresistible/cnr/features/cop/jail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/jail.pwn @@ -268,7 +268,6 @@ stock JailPlayer( playerid, seconds, admin = 0 ) RemovePlayerStolensFromHands( playerid ); StopPlayerUsingSlotMachine ( playerid ); RemoveEquippedOre ( playerid ); - RemovePlayerFromEvent ( playerid, true ); ClearPlayerWantedLevel ( playerid ); ResetPlayerWeapons ( playerid ); UntiePlayer ( playerid ); @@ -276,6 +275,10 @@ stock JailPlayer( playerid, seconds, admin = 0 ) SetPlayerPosToPrison ( playerid ); Player_CheckPokerGame ( playerid, "Jailed" ); + #if defined __cloudy_event_system + RemovePlayerFromEvent ( playerid, true ); + #endif + // External Functions SetPlayerSpecialAction ( playerid, SPECIAL_ACTION_NONE ); ClearAnimations ( playerid ); From 8535d120a4804dc726a307584882226ee0463ec2 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 19:28:54 +1000 Subject: [PATCH 08/66] disable discord by default as per issues by other server owners --- gamemodes/irresistible/cnr/discord/discord_relay.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/discord/discord_relay.pwn b/gamemodes/irresistible/cnr/discord/discord_relay.pwn index 30ec20f..655550d 100644 --- a/gamemodes/irresistible/cnr/discord/discord_relay.pwn +++ b/gamemodes/irresistible/cnr/discord/discord_relay.pwn @@ -6,7 +6,7 @@ */ /* ** Enable or disable discord ** */ -// #define DISCORD_DISABLED // !!!! DISABLED BY DEFAULT !!!! +#define DISCORD_DISABLED // !!!! DISABLED BY DEFAULT !!!! /* ** Includes ** */ #include < YSI\y_hooks > From a8db14438327763af6ba8471670f82c4e203d323 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 19:45:38 +1000 Subject: [PATCH 09/66] fix migrations --- .../config/migrations/cnr/20190405_cnr_chat_ban_creation.sql | 2 +- .../config/migrations/cnr/20190530_cnr_realestate_ask.sql | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation.sql b/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation.sql index 697b008..f69ef5d 100644 --- a/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation.sql +++ b/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation.sql @@ -1,7 +1,7 @@ -- CREATE A MIGRATION ENTRY INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190405_cnr_chat_ban_creation'); ---BEGIN +-- BEGIN -- CREATE TABLE CREATE TABLE IF NOT EXISTS `CHAT_BANS` ( diff --git a/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql b/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql index a37c1b8..0e145e5 100644 --- a/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql +++ b/gamemodes/irresistible/config/migrations/cnr/20190530_cnr_realestate_ask.sql @@ -4,4 +4,5 @@ INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190530_cnr_realestate_ask') -- BEGIN -- -- ALTER COLUMN TO BE INT INSTEAD OF FLOAT -ALTER TABLE `house_listings` CHANGE COLUMN `ASK` `ASK` INT NULL DEFAULT NULL AFTER `USER_ID`; \ No newline at end of file +ALTER TABLE `HOUSE_LISTINGS` CHANGE COLUMN `ASK` `ASK` INT NULL DEFAULT NULL AFTER `USER_ID`; +TRUNCATE TABLE `HOUSE_LISTINGS`; \ No newline at end of file From 6f924f077ab466b6dd60fd2adae06f06de164c86 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 19:50:32 +1000 Subject: [PATCH 10/66] reduce fee to 50k for /estate --- gamemodes/irresistible/cnr/features/houses/realestate.pwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/houses/realestate.pwn b/gamemodes/irresistible/cnr/features/houses/realestate.pwn index a69c340..78e6f85 100644 --- a/gamemodes/irresistible/cnr/features/houses/realestate.pwn +++ b/gamemodes/irresistible/cnr/features/houses/realestate.pwn @@ -18,7 +18,7 @@ /* ** Constants ** */ static const - HOUSE_LISTING_FEE = 75000; + HOUSE_LISTING_FEE = 50000; /* ** Variables ** */ static stock @@ -124,8 +124,8 @@ CMD:estate( playerid, params[ ] ) else if ( ! Iter_Contains( houses, houseid ) ) return SendError( playerid, "You are not inside of any home." ); else if ( g_houseData[ houseid ] [ E_COST ] > 2500 ) return SendError( playerid, "This home is not a V.I.P home." ); else if ( ! IsPlayerHomeOwner( playerid, houseid ) ) return SendError( playerid, "You are not the owner of this home." ); - else if ( cash < 10000 ) return SendError( playerid, "Please specify an ask price greater than $100.000." ); - else if ( cash > 100000000 ) return SendError( playerid, "Please specify an ask price less than $100.000.000." ); + else if ( cash < 10000 ) return SendError( playerid, "Please specify an ask price greater than $100,000." ); + else if ( cash > 100000000 ) return SendError( playerid, "Please specify an ask price less than $100,000,000." ); else if ( GetPlayerCash( playerid ) < HOUSE_LISTING_FEE && GetPlayerVIPLevel( playerid ) < VIP_PLATINUM ) return SendError( playerid, "You need at least %s to create a house listing.", cash_format( HOUSE_LISTING_FEE ) ); else { @@ -314,7 +314,7 @@ thread HouseListing_OnCreateListing( playerid, houseid, ask_price ) // insert into database and notify mysql_single_query( sprintf( "INSERT INTO `HOUSE_LISTINGS` (`HOUSE_ID`, `USER_ID`, `ASK`) VALUES (%d, %d, %d)", houseid, GetPlayerAccountID( playerid ), ask_price ) ); - return SendServerMessage( playerid, "You have listed your home. You can retract your listing using "COL_GREY"/estate list cancel"COL_WHITE"." ); + return SendServerMessage( playerid, "You have listed your home for "COL_GOLD"%s"COL_WHITE". Retract the listing by "COL_GREY"/estate list cancel"COL_WHITE".", cash_format( ask_price ) ); } else { From 3486700dbddeee168e62cd4e0c9d4b38cf4b1bec Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 19:53:49 +1000 Subject: [PATCH 11/66] if funding goal <= 0.0 - hide the % left --- .../cnr/features/vip/redeem_code.pwn | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn index 4ee283b..2a0f458 100644 --- a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn @@ -208,13 +208,20 @@ thread OnGrabLatestDonor( hidden ) new Float: last_donation = cache_get_field_content_float( 0, "LAST_AMOUNT", dbHandle ); new Float: total_donations = cache_get_field_content_float( 0, "TOTAL_DONATIONS", dbHandle ); - new Float: funding_goal_percent = total_donations / GetServerVariableFloat( "donation_goal_amount" ) * 100.0; - // Prevents total revenue for the month being disclosed mathematically - if ( funding_goal_percent >= 100.0 ) { - TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f, ~g~Month Is Fully %0.2f%% Funded!", szName, last_donation, 100.0 ) ); + new Float: funding_goal = GetServerVariableFloat( "donation_goal_amount" ); + + // make this optional + if ( funding_goal <= 0.0 ) { + // Prevents total revenue for the month being disclosed mathematically + if ( funding_goal_percent >= 100.0 ) { + TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f, ~g~Month Is Fully %0.2f%% Funded!", szName, last_donation, 100.0 ) ); + } else { + new Float: funding_goal_percent = total_donations / funding_goal * 100.0; + TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f, ~r~Month Is Only %0.2f%% Funded!", szName, last_donation, funding_goal_percent ) ); + } } else { - TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f, ~r~Month Is Only %0.2f%% Funded!", szName, last_donation, funding_goal_percent ) ); + TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f", szName, last_donation ) ); } // Play song! From a174f06e4152560eece4191cf79ed9b6ebd3f77b Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 20:03:27 +1000 Subject: [PATCH 12/66] -- update changelog.txt --- scriptfiles/changelogs/cnr/v11.60.190.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scriptfiles/changelogs/cnr/v11.60.190.txt b/scriptfiles/changelogs/cnr/v11.60.190.txt index 6506fee..d1e250b 100644 --- a/scriptfiles/changelogs/cnr/v11.60.190.txt +++ b/scriptfiles/changelogs/cnr/v11.60.190.txt @@ -1,5 +1,7 @@ (+) Cloudy's advanced event system has been added. (+) Night's discord implementation has been added. +(/) "/estate" now works on a cash basis. Homes are traded for in-game money. +(/) Fee for real estate reduced to $50,000 per home. (/) Players will lose only 5% of their stock if it drops 80% in a day. (/) Full reversion of the turf war system to how it was pre-hardpoint. (/) You need Bronze V.I.P to send Irresistible Coins. \ No newline at end of file From bd69f6012022dddd938cd6dbb9200c5d084c2066 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 20:11:39 +1000 Subject: [PATCH 13/66] fix compile issue --- gamemodes/irresistible/cnr/features/vip/redeem_code.pwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn index 2a0f458..fc1fba5 100644 --- a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn @@ -213,11 +213,12 @@ thread OnGrabLatestDonor( hidden ) // make this optional if ( funding_goal <= 0.0 ) { + new Float: funding_goal_percent = total_donations / funding_goal * 100.0; + // Prevents total revenue for the month being disclosed mathematically if ( funding_goal_percent >= 100.0 ) { TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f, ~g~Month Is Fully %0.2f%% Funded!", szName, last_donation, 100.0 ) ); } else { - new Float: funding_goal_percent = total_donations / funding_goal * 100.0; TextDrawSetString( g_TopDonorTD, sprintf( "Latest Donor %s - $%0.2f, ~r~Month Is Only %0.2f%% Funded!", szName, last_donation, funding_goal_percent ) ); } } else { From 54543b10396d2c41a7f7137f8346b4d7b72aea3c Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 20:12:13 +1000 Subject: [PATCH 14/66] 10% bonus pay to cop + rhino vulnerable to damage --- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 6 ++++-- gamemodes/sf-cnr.pwn | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 66879ba..794754a 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -9,6 +9,8 @@ #include < YSI\y_hooks > /* ** Variables ** */ +static const COP_ARREST_PAY_PER_WANTED = 330; +static const COP_DETAIN_PAY_PER_WANTED = 385; /* ** Forwards ** */ forward OnPlayerArrested( playerid, victimid, totalarrests, totalpeople ); @@ -54,7 +56,7 @@ hook OnPlayerEnterDynamicCP( playerid, checkpointid ) totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER ); iDetained++; - iCashEarned += ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( 350 ); + iCashEarned += ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( COP_DETAIN_PAY_PER_WANTED ); KillTimer( p_CuffAbuseTimer[ victimid ] ); SetPlayerSpecialAction( victimid, SPECIAL_ACTION_NONE ); RemovePlayerAttachedObject( victimid, 2 ); @@ -176,7 +178,7 @@ CMD:arrest( playerid, params[ ] ) if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "You cannot arrest a person that is inside a vehicle." ); if ( IsPlayerAdminOnDuty( victimid ) ) return SendError( playerid, "You cannot use this command on admins that are on duty." ); if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." ); - new totalCash = ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( 300 ); + new totalCash = ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( COP_ARREST_PAY_PER_WANTED ); new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER ); GivePlayerScore( playerid, 2 ); GivePlayerExperience( playerid, E_POLICE ); diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index e2cef8e..80bf34e 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1058,9 +1058,9 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( IsPlayerTazed( playerid ) || IsPlayerCuffed( playerid ) || IsPlayerKidnapped( playerid ) || IsPlayerTied( playerid ) || IsPlayerLoadingObjects( playerid ) || IsPlayerAdminOnDuty( playerid ) || IsPlayerSpawnProtected( playerid ) ) return 0; - // Rhino damage invulnerable - if ( p_Class[ playerid ] == CLASS_POLICE && IsPlayerInAnyVehicle( playerid ) && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 432 ) - return 0; + // // Rhino damage invulnerable + // if ( p_Class[ playerid ] == CLASS_POLICE && IsPlayerInAnyVehicle( playerid ) && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 432 ) + // return 0; // Anti RDM and gang member damage if ( ! IsPlayerInEvent( playerid ) && ! IsPlayerInPaintBall( playerid ) && ! IsPlayerBoxing( playerid ) && ! IsPlayerDueling( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) @@ -1297,7 +1297,7 @@ public OnPlayerDeath( playerid, killerid, reason ) if ( p_WantedLevel[ playerid ] > 5 ) { static const killedWords[ ] [ ] = { { "murked" }, { "killed" }, { "ended" }, { "slain" }, { "massacred" }, { "destroyed" }, { "screwed" } }; - new cashEarned = ( p_WantedLevel[ playerid ] < MAX_WANTED_LVL ? p_WantedLevel[ playerid ] : MAX_WANTED_LVL ) * ( reason == 38 || reason == 51 ? 160 : 270 ); + new cashEarned = ( p_WantedLevel[ playerid ] < MAX_WANTED_LVL ? p_WantedLevel[ playerid ] : MAX_WANTED_LVL ) * ( reason == 38 || reason == 51 ? 150 : 300 ); GivePlayerCash( killerid, cashEarned ); GivePlayerScore( killerid, 2 ); GivePlayerExperience( killerid, E_POLICE, 0.5 ); From c772fb762b61c820febcdb89c0373c3528231284 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 20:12:22 +1000 Subject: [PATCH 15/66] - update changelog --- scriptfiles/changelogs/cnr/v11.60.190.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scriptfiles/changelogs/cnr/v11.60.190.txt b/scriptfiles/changelogs/cnr/v11.60.190.txt index d1e250b..6167101 100644 --- a/scriptfiles/changelogs/cnr/v11.60.190.txt +++ b/scriptfiles/changelogs/cnr/v11.60.190.txt @@ -4,4 +4,6 @@ (/) Fee for real estate reduced to $50,000 per home. (/) Players will lose only 5% of their stock if it drops 80% in a day. (/) Full reversion of the turf war system to how it was pre-hardpoint. -(/) You need Bronze V.I.P to send Irresistible Coins. \ No newline at end of file +(/) You need Bronze V.I.P to send Irresistible Coins. +(/) Army is now vulnerable to damage in rhinos. +(/) Police are now paid 10% extra. \ No newline at end of file From a15157a835956990f4b4038f86dd60a96ce5c37f Mon Sep 17 00:00:00 2001 From: Dusan Date: Fri, 31 May 2019 12:26:26 +0200 Subject: [PATCH 16/66] Fixed C4 bug --- gamemodes/irresistible/cnr/features/c4.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/c4.pwn b/gamemodes/irresistible/cnr/features/c4.pwn index 84ce6a3..481c788 100644 --- a/gamemodes/irresistible/cnr/features/c4.pwn +++ b/gamemodes/irresistible/cnr/features/c4.pwn @@ -366,6 +366,6 @@ stock SetPlayerC4Amount( playerid, amount ) { stock GivePlayerC4( playerid, amount ) { - mysql_single_query( sprintf( "UPDATE `USERS` SET `C4` = %d WHERE `ID` = %d", p_C4Amount[ playerid ], GetPlayerAccountID( playerid ) ) ); + mysql_single_query( sprintf( "UPDATE `USERS` SET `C4` = %d WHERE `ID` = %d", GetPlayerC4Amount( playerid ) + amount, GetPlayerAccountID( playerid ) ) ); SetPlayerC4Amount( playerid, GetPlayerC4Amount( playerid ) + amount ); } \ No newline at end of file From 3e51f450e227a37c017253e666d2a8fa1288593f Mon Sep 17 00:00:00 2001 From: Dusan Date: Fri, 31 May 2019 12:50:28 +0200 Subject: [PATCH 17/66] Typos --- gamemodes/irresistible/cnr/commands/admin/_admin.pwn | 1 + .../irresistible/cnr/commands/admin/admin_five.pwn | 4 ++-- .../irresistible/cnr/commands/admin/admin_six.pwn | 6 +++--- .../irresistible/cnr/commands/admin/admin_three.pwn | 10 +++++----- gamemodes/irresistible/cnr/features/gates.pwn | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index a4eede9..04f54ac 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -145,6 +145,7 @@ static stock { 5, "/achangename", "Change a players name" }, { 5, "/unbanip", "Unbanning a IP address" }, { 5, "/unban", "Unban a player from the server" }, + { 5, "/unforceac", "Unforce a player from using CAC" }, { 5, "/doublexp", "Enable/disable double XP" }, { 5, "/toggleviewpm", "Toggle to view private messages" }, { 5, "/respawnallv", "Respawning all server vehicles" }, diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn index b9582df..3af945c 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn @@ -755,7 +755,7 @@ CMD:unforceac( playerid, params[ ] ) Query[ 70 ]; if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "s[24]", player ) ) SendUsage( playerid, "/unban [NAME]" ); + else if ( sscanf( params, "s[24]", player ) ) SendUsage( playerid, "/unforceac [PLAYER_NAME]" ); else { new pID = GetPlayerIDFromName( player ); @@ -780,7 +780,7 @@ thread OnPlayerUnforceAC( playerid, player[ ], pID, bool:offline ) Query[ 70 ], rows = cache_get_row_count( ); if ( !rows ) return SendError( playerid, "The database does not contain the username you are attempting to remove from forced ac." ); - + if ( offline ) { diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn index bc36451..3dd333f 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn @@ -72,7 +72,7 @@ CMD:createentrance( playerid, params[ ] ) ; if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "ufffdddds[32]", ownerid, toX, toY, toZ, interior, world, customInterior, vipOnly, label ) ) return SendUsage( playerid, "/createhouse [OWNER] [TO_X] [TO_Y] [TO_Z] [INTERIOR] [WORLD] [CUSTOM_INTERIOR] [VIP_ONLY] [LABEL]" ); + else if ( sscanf( params, "ufffdddds[32]", ownerid, toX, toY, toZ, interior, world, customInterior, vipOnly, label ) ) return SendUsage( playerid, "/createentrance [OWNER] [TO_X] [TO_Y] [TO_Z] [INTERIOR] [WORLD] [CUSTOM_INTERIOR] [VIP_ONLY] [LABEL]" ); else if ( !IsPlayerConnected( ownerid ) || IsPlayerNPC( ownerid ) ) return SendError( playerid, "Invalid Player ID." ); else { @@ -83,7 +83,7 @@ CMD:createentrance( playerid, params[ ] ) entranceid = CreateEntrance( label, X, Y, Z, toX, toY, toZ, interior, world, customInterior > 0, vipOnly > 0 ); if ( entranceid == -1 ) - return SendClientMessage( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" Unable to create a entrance due to a unexpected error." ); + return SendClientMessage( playerid, -1, ""COL_PINK"[ENTRANCE]"COL_WHITE" Unable to create a entrance due to a unexpected error." ); SaveToAdminLog( playerid, entranceid, "created entrance" ); g_entranceData[ entranceid ] [ E_SAVED ] = true; @@ -91,7 +91,7 @@ CMD:createentrance( playerid, params[ ] ) format( szBigString, 256, "INSERT INTO `ENTRANCES` (`OWNER`, `LABEL`, `X`, `Y`, `Z`, `EX`, `EY`, `EZ`, `INTERIOR`, `WORLD`, `CUSTOM`, `VIP_ONLY`) VALUES ('%s','%s',%f,%f,%f,%f,%f,%f,%d,%d,%d,%d)", mysql_escape( ReturnPlayerName( ownerid ) ), mysql_escape( label ), X, Y, Z, toX, toY, toZ, interior, world, customInterior, vipOnly ); mysql_single_query( szBigString ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a entrance using id %d.", entranceid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ENTRANCE]"COL_WHITE" You have created a entrance using id %d.", entranceid ); } } return 1; diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn index a00336f..5b1bf9a 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn @@ -507,7 +507,7 @@ CMD:ban( playerid, params [ ] ) CMD:banlog( playerid, params[ ] ) { - new + new iName[ MAX_PLAYER_NAME ]; if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); @@ -522,14 +522,14 @@ CMD:banlog( playerid, params[ ] ) thread OnPlayerBanLog( playerid, const Name[ ] ) { - new + new rows = cache_get_row_count( ); if ( ! rows ) { return SendError( playerid, "This player isn't banned." ); } - static + static ban_ip[ 16 ], ban_reason[ 80 ], ban_by[ 24 ], @@ -643,7 +643,7 @@ CMD:chatban( playerid, params[ ] ) CMD:unchatban( playerid, params[ ] ) { - + new pID; if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); @@ -655,7 +655,7 @@ CMD:unchatban( playerid, params[ ] ) { p_ChatBanned{ pID } = false; mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) ); - SendClientMessageFormatted( pID, -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( playerid ) ); 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/gates.pwn b/gamemodes/irresistible/cnr/features/gates.pwn index 835e097..ad8127b 100644 --- a/gamemodes/irresistible/cnr/features/gates.pwn +++ b/gamemodes/irresistible/cnr/features/gates.pwn @@ -322,7 +322,7 @@ hook OnPlayerEditDynObject( playerid, objectid, response, Float: x, Float: y, Fl g_gateData[ gID ] [ E_RX ] = float( floatround( rx ) ); g_gateData[ gID ] [ E_RY ] = float( floatround( ry ) ); g_gateData[ gID ] [ E_RZ ] = float( floatround( rz ) ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GATE]"COL_WHITE" Gate Open Position: "COL_GREY" %f, %f, %f, %f, %f, %f", g_gateData[ gID ] [ E_X ], g_gateData[ gID ] [ E_Y ], g_gateData[ gID ] [ E_Z ], g_gateData[ gID ] [ E_RX ], g_gateData[ gID ] [ E_RY ], g_gateData[ gID ] [ E_RZ ] ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GATE]"COL_WHITE" Gate Close Position: "COL_GREY" %f, %f, %f, %f, %f, %f", g_gateData[ gID ] [ E_X ], g_gateData[ gID ] [ E_Y ], g_gateData[ gID ] [ E_Z ], g_gateData[ gID ] [ E_RX ], g_gateData[ gID ] [ E_RY ], g_gateData[ gID ] [ E_RZ ] ); } case 10: { From 6c94cda69da1317acf7bec854555c641b43b644c Mon Sep 17 00:00:00 2001 From: Dusan Date: Fri, 31 May 2019 13:20:02 +0200 Subject: [PATCH 18/66] Chatban global message --- gamemodes/irresistible/cnr/commands/admin/admin_three.pwn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn index 5b1bf9a..02e5eb3 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn @@ -632,8 +632,7 @@ 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( 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 ); + SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has chat banned %s(%d) "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason ); AddAdminLogLineFormatted( "%s(%d) has chat banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); SaveToAdminLog( playerid, p_AccountID[ pID ], "chat ban" ); } @@ -655,8 +654,7 @@ CMD:unchatban( playerid, params[ ] ) { p_ChatBanned{ pID } = false; mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) ); - SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( playerid ) ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat unbanned %s.", ReturnPlayerName( pID ) ); + SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has been chat un-banned by %s", ReturnPlayerName( pID ), pID, ReturnPlayerName( playerid ) ); AddAdminLogLineFormatted( "%s(%d) has chat unbanned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); SaveToAdminLog( playerid, p_AccountID[ pID ], "chat unban" ); } From a97e30dfcc2b64f9978aa849d9a201052276132f Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 31 May 2019 21:40:04 +1000 Subject: [PATCH 19/66] fix funding goal bug --- gamemodes/irresistible/cnr/features/vip/redeem_code.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn index fc1fba5..8b72e43 100644 --- a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn @@ -212,7 +212,7 @@ thread OnGrabLatestDonor( hidden ) new Float: funding_goal = GetServerVariableFloat( "donation_goal_amount" ); // make this optional - if ( funding_goal <= 0.0 ) { + if ( funding_goal > 0.0 ) { new Float: funding_goal_percent = total_donations / funding_goal * 100.0; // Prevents total revenue for the month being disclosed mathematically From 0c7fbc9af399d01bec908d025b6abbdacacf1eeb Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Fri, 31 May 2019 17:03:29 +0300 Subject: [PATCH 20/66] Eases to understand the damage callback --- gamemodes/sf-cnr.pwn | 54 +++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 80bf34e..dd6f341 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -996,7 +996,7 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b { if ( !IsPlayerStreamedIn( issuerid, playerid ) || IsPlayerAFK( issuerid ) ) return 0; - + // Boxing immunity if ( IsPlayerBoxing( playerid ) && ! IsPlayerBoxing( issuerid ) ) return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage a boxing player!" ), 0; @@ -1040,10 +1040,35 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b /*if ( p_Class[ issuerid ] == CLASS_POLICE && p_Class[ playerid ] != CLASS_POLICE && !p_WantedLevel[ playerid ] && GetPlayerState( playerid ) != PLAYER_STATE_WASTED ) { ShowPlayerHelpDialog( issuerid, 2000, "You should not hurt innocent civilians, you're a ~b~cop~w~~h~!" ); }*/ - if ( p_Class[ issuerid ] == CLASS_POLICE && p_Class[ playerid ] != CLASS_POLICE && !p_WantedLevel[ playerid ] && GetPlayerState( playerid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( issuerid ) ) + + #if defined __cloudy_event_system + if( IsPlayerInEvent( issuerid ) && IsPlayerInEvent( playerid ) ) + { + if( g_eventData[ EV_FIGHT_TYPE] == 3 ) return 0; + + if( p_Class[ issuerid ] == p_Class[ playerid ] ) + { + if ( p_Class[ issuerid ] == CLASS_CIVILIAN && g_eventData[ EV_FIGHT_TYPE ] == 0 ) // Cops Vs Civilians + return 0; + + if ( p_Class[ issuerid ] == CLASS_POLICE && g_eventData[ EV_FIGHT_TYPE ] < 2 ) // ( Cops Vs Civilians ) Or ( Civilians Vs Civilians Vs Cops ) + return 0; + } + } + #endif + + #if defined __cloudy_event_system + if ( p_Class[ issuerid ] == CLASS_POLICE && p_Class[ playerid ] != CLASS_POLICE && !p_WantedLevel[ playerid ] && GetPlayerState( playerid ) != PLAYER_STATE_WASTED && ! ( IsPlayerInEvent( issuerid ) && IsPlayerInEvent( playerid ) && g_eventData[ EV_FIGHT_TYPE ] < 3 ) ) + #else + if ( p_Class[ issuerid ] == CLASS_POLICE && p_Class[ playerid ] != CLASS_POLICE && !p_WantedLevel[ playerid ] && GetPlayerState( playerid ) != PLAYER_STATE_WASTED ) + #endif return ShowPlayerHelpDialog( issuerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; - if ( p_Class[ playerid ] == p_Class[ issuerid ] && p_Class[ playerid ] != CLASS_CIVILIAN ) + #if defined __cloudy_event_system + if ( p_Class[ playerid ] == p_Class[ issuerid ] && p_Class[ playerid ] != CLASS_CIVILIAN && ! ( IsPlayerInEvent( issuerid ) && IsPlayerInEvent( playerid ) && g_eventData[ EV_FIGHT_TYPE ] == 2 ) ) + #else + if ( p_Class[ playerid ] == p_Class[ issuerid ] && p_Class[ playerid ] != CLASS_CIVILIAN ) + #endif return 0; if ( p_BulletInvulnerbility[ playerid ] > g_iTime ) @@ -1058,16 +1083,15 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( IsPlayerTazed( playerid ) || IsPlayerCuffed( playerid ) || IsPlayerKidnapped( playerid ) || IsPlayerTied( playerid ) || IsPlayerLoadingObjects( playerid ) || IsPlayerAdminOnDuty( playerid ) || IsPlayerSpawnProtected( playerid ) ) return 0; - // // Rhino damage invulnerable - // if ( p_Class[ playerid ] == CLASS_POLICE && IsPlayerInAnyVehicle( playerid ) && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 432 ) - // return 0; - // Anti RDM and gang member damage - if ( ! IsPlayerInEvent( playerid ) && ! IsPlayerInPaintBall( playerid ) && ! IsPlayerBoxing( playerid ) && ! IsPlayerDueling( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) + if ( ! IsPlayerInPaintBall( playerid ) && ! IsPlayerBoxing( playerid ) && ! IsPlayerDueling( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) { - if ( IsPlayerInPlayerGang( issuerid, playerid ) ) { - return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage your homies!" ), 0; - } + #if defined __cloudy_event_system + if ( IsPlayerInPlayerGang( issuerid, playerid ) && ! ( IsPlayerInEvent( playerid ) && IsPlayerInEvent( issuerid ) && g_eventData[ EV_FIGHT_TYPE] <= 2 ) ) + #else + if ( IsPlayerInPlayerGang( issuerid, playerid ) ) + #endif + return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage your homies!" ), 0; // Anti Random Deathmatch if ( IsRandomDeathmatch( issuerid, playerid ) ) { @@ -1092,14 +1116,12 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b // Headshots #if defined __cloudy_event_system - if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 && ( ! IsPlayerInEvent( playerid ) || ( IsPlayerInEvent( playerid ) && EventSettingAllow( EVENT_SETTING_HEADSHOT ) ) ) ) + if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 && ( ! IsPlayerInEvent( playerid ) || ( IsPlayerInEvent( playerid ) && EventSettingAllow( 3 ) ) ) ) #else if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 ) #endif - { amount *= 1.5; - } - + // Paintball Headshot if ( issuerid != INVALID_PLAYER_ID && p_inPaintBall{ playerid } == true ) { @@ -7147,4 +7169,4 @@ 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 909838cdbd997d3f103473af7dc5c9b33d8ccb6b Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 00:21:48 +1000 Subject: [PATCH 21/66] add brackets for consistency --- gamemodes/sf-cnr.pwn | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index dd6f341..1bfc5c4 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -996,7 +996,7 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b { if ( !IsPlayerStreamedIn( issuerid, playerid ) || IsPlayerAFK( issuerid ) ) return 0; - + // Boxing immunity if ( IsPlayerBoxing( playerid ) && ! IsPlayerBoxing( issuerid ) ) return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage a boxing player!" ), 0; @@ -1050,7 +1050,7 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b { if ( p_Class[ issuerid ] == CLASS_CIVILIAN && g_eventData[ EV_FIGHT_TYPE ] == 0 ) // Cops Vs Civilians return 0; - + if ( p_Class[ issuerid ] == CLASS_POLICE && g_eventData[ EV_FIGHT_TYPE ] < 2 ) // ( Cops Vs Civilians ) Or ( Civilians Vs Civilians Vs Cops ) return 0; } @@ -1062,14 +1062,18 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b #else if ( p_Class[ issuerid ] == CLASS_POLICE && p_Class[ playerid ] != CLASS_POLICE && !p_WantedLevel[ playerid ] && GetPlayerState( playerid ) != PLAYER_STATE_WASTED ) #endif + { return ShowPlayerHelpDialog( issuerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; + } #if defined __cloudy_event_system if ( p_Class[ playerid ] == p_Class[ issuerid ] && p_Class[ playerid ] != CLASS_CIVILIAN && ! ( IsPlayerInEvent( issuerid ) && IsPlayerInEvent( playerid ) && g_eventData[ EV_FIGHT_TYPE ] == 2 ) ) #else if ( p_Class[ playerid ] == p_Class[ issuerid ] && p_Class[ playerid ] != CLASS_CIVILIAN ) #endif + { return 0; + } if ( p_BulletInvulnerbility[ playerid ] > g_iTime ) return ShowPlayerHelpDialog( issuerid, 2000, "This player is immune from damage!" ), 0; @@ -1091,7 +1095,9 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b #else if ( IsPlayerInPlayerGang( issuerid, playerid ) ) #endif + { return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage your homies!" ), 0; + } // Anti Random Deathmatch if ( IsRandomDeathmatch( issuerid, playerid ) ) { @@ -1121,7 +1127,7 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 ) #endif amount *= 1.5; - + // Paintball Headshot if ( issuerid != INVALID_PLAYER_ID && p_inPaintBall{ playerid } == true ) { From 6b54ff2e1340b76662417482f325b7cdfe7d18c8 Mon Sep 17 00:00:00 2001 From: Stev Date: Fri, 31 May 2019 17:24:06 +0100 Subject: [PATCH 22/66] adding new location for duel --- gamemodes/irresistible/cnr/features/duel.pwn | 36 +++++++------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/duel.pwn b/gamemodes/irresistible/cnr/features/duel.pwn index eacced8..fd0036f 100644 --- a/gamemodes/irresistible/cnr/features/duel.pwn +++ b/gamemodes/irresistible/cnr/features/duel.pwn @@ -1,8 +1,8 @@ /* * Irresistible Gaming (c) 2018 - * Developed by Steven + * Developed by Stev * Module: cnr/features/duel.pwn - * Purpose: player duling system + * Purpose: player dueling system */ /* ** Includes ** */ @@ -11,15 +11,6 @@ /* ** Definitions ** */ #define COL_DUEL "{B74AFF}" -// #define DIALOG_DUEL 7360 -// #define DIALOG_DUEL_PLAYER 7361 -// #define DIALOG_DUEL_LOCATION 7362 -// #define DIALOG_DUEL_WEAPON 7363 -// #define DIALOG_DUEL_WAGER 7364 -// #define DIALOG_DUEL_WEAPON_TWO 7365 -// #define DIALOG_DUEL_HEALTH 7366 -// #define DIALOG_DUEL_ARMOUR 7367 - /* ** Variables ** */ enum E_DUEL_DATA { @@ -30,7 +21,7 @@ enum E_DUEL_DATA enum E_DUEL_LOCATION_DATA { - E_NAME [ 19 ], Float: E_POS_ONE[ 3 ], Float: E_POS_TWO[ 3 ] + E_NAME [ 22 ], Float: E_POS_ONE[ 3 ], Float: E_POS_TWO[ 3 ] }; new @@ -39,19 +30,18 @@ new g_duelData [ MAX_PLAYERS ][ E_DUEL_DATA ], g_duelLocationData [ ][ E_DUEL_LOCATION_DATA ] = { - { "Santa Maria Beach", { 369.75770, -1831.576, 7.67190 }, { 369.65890, -1871.215, 7.67190 }}, - { "Greenglass College", { 1078.0353, 1084.4989, 10.8359 }, { 1095.4019, 1064.7239, 10.8359 }}, - { "Baseball Arena", { 1393.0995, 2177.4585, 9.75780 }, { 1377.7881, 2195.4214, 9.75780 }}, - //{"The Visage", { 1960.4512, 1907.6881, 130.937 }, { 1969.4047, 1923.2622, 130.937 }}, - { "Mount Chilliad", { -2318.471, -1632.880, 483.703 }, { -2329.174, -1604.657, 483.760 }}, - { "The Farm", { -1044.856, -996.8120, 129.218 }, { -1125.599, -996.7523, 129.218 }}, - { "Tennis Courts", { 755.93790, -1280.710, 13.5565 }, { 755.93960, -1238.688, 13.5516 }}, - { "Underwater World", { 520.59600, -2125.663, -28.257 }, { 517.96600, -2093.610, -28.257 }}, - { "Grove Street", { 2476.4580, -1668.631, 13.3249 }, { 2501.1560, -1667.655, 13.3559 }}, - { "Ocean Docks", { 2683.5440, -2485.137, 13.5425 }, { 2683.8470, -2433.726, 13.5553 }} + { "Santa Maria Beach", { 369.75770, -1831.576, 7.67190 }, { 369.65890, -1871.215, 7.67190 } }, + { "Greenglass College", { 1078.0353, 1084.4989, 10.8359 }, { 1095.4019, 1064.7239, 10.8359 } }, + { "Baseball Arena", { 1393.0995, 2177.4585, 9.75780 }, { 1377.7881, 2195.4214, 9.75780 } }, + { "Mount Chilliad", { -2318.471, -1632.880, 483.703 }, { -2329.174, -1604.657, 483.760 } }, + { "The Farm", { -1044.856, -996.8120, 129.218 }, { -1125.599, -996.7523, 129.218 } }, + { "Tennis Courts", { 755.93790, -1280.710, 13.5565 }, { 755.93960, -1238.688, 13.5516 } }, + { "Underwater World", { 520.59600, -2125.663, -28.257 }, { 517.96600, -2093.610, -28.257 } }, + { "Grove Street", { 2476.4580, -1668.631, 13.3249 }, { 2501.1560, -1667.655, 13.3559 } }, + { "Ocean Docks", { 2683.5440, -2485.137, 13.5425 }, { 2683.8470, -2433.726, 13.5553 } }, + { "Gacia Baseball Ground", { -2305.7549, 92.3505, 35.3516 }, { -2322.0908, 108.5021, 35.3984 } } }, - bool: p_playerDueling [ MAX_PLAYERS char ], p_duelInvitation [ MAX_PLAYERS ][ MAX_PLAYERS ], From faf53995b7913720b3f050aa6fcb18453e39f5db Mon Sep 17 00:00:00 2001 From: Stev Date: Fri, 31 May 2019 17:41:51 +0100 Subject: [PATCH 23/66] adding CAC only option in duel player --- gamemodes/irresistible/cnr/features/duel.pwn | 22 +++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/duel.pwn b/gamemodes/irresistible/cnr/features/duel.pwn index fd0036f..a61c527 100644 --- a/gamemodes/irresistible/cnr/features/duel.pwn +++ b/gamemodes/irresistible/cnr/features/duel.pwn @@ -17,6 +17,7 @@ enum E_DUEL_DATA E_PLAYER, E_WEAPON[ 2 ], E_BET, Float: E_ARMOUR, Float: E_HEALTH, E_COUNTDOWN, E_TIMER, E_LOCATION_ID, E_ROUNDS, + bool: E_CAC }; enum E_DUEL_LOCATION_DATA @@ -168,6 +169,13 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] ) case 6: ShowPlayerDialog(playerid, DIALOG_DUEL_WAGER, DIALOG_STYLE_INPUT, ""COL_WHITE"Duel Settings - Set A Wager", ""COL_WHITE"Please enter the wager for this duel:", "Select", "Back"); case 7: + { + g_duelData[ playerid ][ E_CAC ] = !g_duelData[ playerid ][ E_CAC ]; + + SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]{FFFFFF} You have %s "COL_GREY"CAC Only"COL_WHITE".", g_duelData[ playerid ][ E_CAC ] ? ( "enabled" ) : ( "disabled" ) ); + } + + case 8: { new pID = g_duelData [ playerid ][ E_PLAYER ]; @@ -178,8 +186,15 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] ) return ShowPlayerDuelMenu( playerid ); } + if ( g_duelData[ playerid ][ E_CAC ] && ( ! IsPlayerUsingSampAC( pID ) && ! IsPlayerUsingSampAC( playerid ) ) ) + { + SendError( playerid, "You and your opponent must be using CAC to duel!" ); + return ShowPlayerDuelMenu( playerid ); + } + p_duelInvitation[ playerid ][ pID ] = gettime( ) + 60; - ShowPlayerHelpDialog( pID, 10000, "%s wants to duel!~n~~n~~y~Location: ~w~%s~n~~y~Weapon: ~w~%s and %s~n~~y~Wager: ~w~%s", ReturnPlayerName( playerid ), g_duelLocationData [ g_duelData[ playerid ][ E_LOCATION_ID ] ][ E_NAME ], ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 0 ] ), ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 1 ] ), cash_format(g_duelData[ playerid ][ E_BET ])); + ShowPlayerHelpDialog( pID, 10000, "%s wants to duel!~n~~n~~y~Location: ~w~%s~n~~y~Weapon: ~w~%s and %s~n~~y~Wager: ~w~%s~n~~y~CAC: ~w~%s", ReturnPlayerName( playerid ), g_duelLocationData [ g_duelData[ playerid ][ E_LOCATION_ID ] ][ E_NAME ], ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 0 ] ), ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 1 ] ), cash_format(g_duelData[ playerid ][ E_BET ] ), g_duelData[ playerid ][ E_CAC ] ? ( "~g~Yes" ) : ( "~r~No" ) ); + SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You have sent a duel invitation to %s for "COL_GOLD"%s"COL_WHITE".", ReturnPlayerName( pID ), cash_format( g_duelData[ playerid ][ E_BET ] ) ); SendClientMessageFormatted( pID, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You are invited to duel %s for "COL_GOLD"%s"COL_WHITE", use \"/duel accept %d\".", ReturnPlayerName( playerid ), cash_format( g_duelData[ playerid ][ E_BET ] ), playerid ); } @@ -485,14 +500,15 @@ stock ShowPlayerDuelMenu( playerid ) return SendError( playerid, "You cannot duel whilst having a wanted level."); format( szBigString, sizeof(szBigString), - "Player\t"COL_GREY"%s\nHealth\t"COL_GREY"%.2f%%\nArmour\t"COL_GREY"%.2f%%\nPrimary Weapon\t"COL_GREY"%s\nSecondary Weapon\t"COL_GREY"%s\nLocation\t"COL_GREY"%s\nWager\t"COL_GREY"%s\n"COL_GOLD"Send Invite\t"COL_GOLD">>>", + "Player\t"COL_GREY"%s\nHealth\t"COL_GREY"%.2f%%\nArmour\t"COL_GREY"%.2f%%\nPrimary Weapon\t"COL_GREY"%s\nSecondary Weapon\t"COL_GREY"%s\nLocation\t"COL_GREY"%s\nWager\t"COL_GREY"%s\nCAC Only\t"COL_GREY"%s\n"COL_GOLD"Send Invite\t"COL_GOLD">>>", ( ! IsPlayerConnected( g_duelData[ playerid ][ E_PLAYER ] ) ? ( ""COL_RED"No-one" ) : ( ReturnPlayerName( g_duelData[ playerid ][ E_PLAYER ] ) ) ), g_duelData[ playerid ][ E_HEALTH ], g_duelData[ playerid ][ E_ARMOUR ], ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 0 ] ), ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 1 ] ), g_duelLocationData[ g_duelData[ playerid ][ E_LOCATION_ID ] ][ E_NAME ], - cash_format( g_duelData[ playerid ][ E_BET ] ) + cash_format( g_duelData[ playerid ][ E_BET ] ), + ( g_duelData[ playerid ][ E_CAC ] ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" ) ) ); ShowPlayerDialog( playerid, DIALOG_DUEL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Duel Settings", szBigString, "Select", "Cancel" ); From af4f9ae4c70405dd27f0f22ed8da61fafe3ff35e Mon Sep 17 00:00:00 2001 From: Stev Date: Fri, 31 May 2019 19:08:05 +0100 Subject: [PATCH 24/66] returning dialog menu when setting cac --- gamemodes/irresistible/cnr/features/duel.pwn | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemodes/irresistible/cnr/features/duel.pwn b/gamemodes/irresistible/cnr/features/duel.pwn index a61c527..d43f58c 100644 --- a/gamemodes/irresistible/cnr/features/duel.pwn +++ b/gamemodes/irresistible/cnr/features/duel.pwn @@ -173,6 +173,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] ) g_duelData[ playerid ][ E_CAC ] = !g_duelData[ playerid ][ E_CAC ]; SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]{FFFFFF} You have %s "COL_GREY"CAC Only"COL_WHITE".", g_duelData[ playerid ][ E_CAC ] ? ( "enabled" ) : ( "disabled" ) ); + ShowPlayerDuelMenu( playerid ); } case 8: From 640dd4191d0949109f6804abaa17cfe9d8c60ff6 Mon Sep 17 00:00:00 2001 From: Nemesis211 <51242547+Nemesis211@users.noreply.github.com> Date: Sat, 1 Jun 2019 01:21:50 +0500 Subject: [PATCH 25/66] Adds givearmour for level 5 --- .../cnr/commands/admin/admin_five.pwn | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn index 3af945c..ca4a353 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn @@ -6,6 +6,24 @@ */ /* ** Commands ** */ +CMD:givearmour( playerid, params[ ] ) +{ + new pID; + if ( p_AdminLevel[ playerid] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT); + else if (sscanf (params, "u", pID ) ) SendUsage(playerid, "/givearmour [PLAYER_ID]"); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( IsPlayerJailed( pID ) ) return SendError( playerid, "This player is jailed, you cannot do this." ); + else if ( IsPlayerAdminOnDuty( pID ) ) return SendError( playerid, "This player is an admin on duty, you cannot do this." ); + else + { + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) gave you armour.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have given armour to %s(%d).", ReturnPlayerName( pID ), pID ); + AddAdminLogLineFormatted( "%s(%d) has given armour to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + SetPlayerArmour( pID, 100.0 ); + } + return 1; +} + CMD:armorall( playerid, params[ ] ) { if ( p_AdminLevel[ playerid ] < 5 ) @@ -806,4 +824,4 @@ thread OnPlayerUnforceAC( playerid, player[ ], pID, bool:offline ) } return 1; -} \ No newline at end of file +} From 8055e5312d25e5fa96887d28bab1f8254adc2976 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 12:27:35 +1000 Subject: [PATCH 26/66] change user inactive deletion to 1yr --- gamemodes/sf-cnr.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 1bfc5c4..d46a51f 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -105,7 +105,7 @@ public OnGameModeInit() strcat( szLargeString, "LEFT JOIN `TOYS` as a9 ON a9.`USER_ID` = a1.`ID` " ); strcat( szLargeString, "LEFT JOIN `GARAGES` as a10 ON a10.`OWNER` = a1.`ID` " ); strcat( szLargeString, "LEFT JOIN `BUSINESSES` as a11 ON a11.`OWNER_ID` = a1.`ID` " ); - strcat( szLargeString, "WHERE UNIX_TIMESTAMP()-a1.`LASTLOGGED` > 15552000" ); + strcat( szLargeString, "WHERE UNIX_TIMESTAMP()-a1.`LASTLOGGED` > 11510640000" ); mysql_function_query( dbHandle, szLargeString, true, "onRemoveInactiveRows", "d", 0 ); // Reset VIPs From c9ebbe74e8a617d8a48e49adf8bcc8e4eeb228ff Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 18:20:48 +1000 Subject: [PATCH 27/66] restore oldschool class selection --- gamemodes/irresistible/cnr/classes.pwn | 34 ++++------------ .../cnr/static/server_objects.pwn | 39 ------------------- 2 files changed, 7 insertions(+), 66 deletions(-) diff --git a/gamemodes/irresistible/cnr/classes.pwn b/gamemodes/irresistible/cnr/classes.pwn index 1ae1da6..0bd0b27 100644 --- a/gamemodes/irresistible/cnr/classes.pwn +++ b/gamemodes/irresistible/cnr/classes.pwn @@ -252,38 +252,19 @@ hook OnPlayerSpawn( playerid ) hook OnPlayerRequestClass( playerid, classid ) { - // SetPlayerPos( playerid, -1971.1536, 129.4870, 27.6875 ); - // SetPlayerFacingAngle( playerid, 90.0 ); - SetPlayerPos( playerid, 229.613998, 87.164001, 1605.039978 ); - SetPlayerFacingAngle( playerid, -90.000000 ); + SetPlayerPos( playerid, -1971.1536, 129.4870, 27.6875 ); SetPlayerInterior( playerid, 0 ); - SetPlayerVirtualWorld( playerid, 0 ); - //SetPlayerCameraPos( playerid, -1974.1431, 133.3700, 29.7107 ); - //SetPlayerCameraLookAt( playerid, -1970.6431, 129.3700, 28.2107 ); + SetPlayerFacingAngle( playerid, 90.0 ); if ( p_ClassSelection{ playerid } == false ) - { - static const Float: START_POS[ 3 ] = { 243.5, 87.23, 1605.9 }; - static const Float: FINAL_POS[ 3 ] = { 231.9, 87.23, 1605.9 }; - - InterpolateCameraPos( playerid, START_POS[ 0 ], START_POS[ 1 ], START_POS[ 2 ], FINAL_POS[ 0 ], FINAL_POS[ 1 ], FINAL_POS[ 2 ], 17500, CAMERA_MOVE ); - InterpolateCameraLookAt( playerid, FINAL_POS[ 0 ], FINAL_POS[ 1 ], FINAL_POS[ 2 ], FINAL_POS[ 0 ] - 0.4, FINAL_POS[ 1 ], FINAL_POS[ 2 ] - 0.05, 15000, CAMERA_MOVE ); - - // InterpolateCameraPos( playerid, -1976.4252, 119.9899, 30.0, -1974.0302, 133.0427, 27.6940, 10000, CAMERA_MOVE ); - // InterpolateCameraLookAt( playerid, -1974.0302,133.0427,27.6940, -1971.1536,129.4870,27.6875, 10000, CAMERA_MOVE ); - + { + InterpolateCameraPos( playerid, -1976.4252, 119.9899, 30.0, -1974.0302, 133.0427, 27.6940, 10000, CAMERA_MOVE ); + InterpolateCameraLookAt( playerid, -1974.0302,133.0427,27.6940, -1971.1536,129.4870,27.6875, 10000, CAMERA_MOVE ); p_ClassSelection{ playerid } = true; } - RemovePlayerAttachedObject( playerid, 1 ); - SetPlayerAttachedObject( playerid, 1, 19560, 6, 0.084999, 0.060998, -0.164999, 3.8, 81.6001, -19.3, .materialcolor1 = 0xFF000000 ); - Streamer_Update( playerid, STREAMER_TYPE_OBJECT ); - - // ApplyAnimation( playerid, "MISC", "SEAT_TALK_02", 2.0, 1, 0, 0, 0, 0 ); - if ( GetPlayerSpecialAction( playerid ) != SPECIAL_ACTION_CARRY ) { - TogglePlayerControllable( playerid, 0 ); - SetPlayerSpecialAction( playerid, SPECIAL_ACTION_CARRY ); - } + //ApplyAnimation( playerid, "FOOD", "FF_Sit_Look", 4.0, 1, 0, 0, 0, 0 ); + ApplyAnimation( playerid, "MISC", "SEAT_TALK_02", 2.0, 1, 0, 0, 0, 0 ); if ( CLASS_CIVILIAN_RANGE[ 0 ] <= classid <= CLASS_CIVILIAN_RANGE[ 1 ] ) { @@ -420,7 +401,6 @@ stock IsPlayerClassApproved( playerid ) { TextDrawHideForPlayer( playerid, g_classTextdrawName[ i ] ); } TextDrawHideForPlayer( playerid, g_classBoxTD ); - RemovePlayerAttachedObject( playerid, 1 ); return 1; } diff --git a/gamemodes/irresistible/cnr/static/server_objects.pwn b/gamemodes/irresistible/cnr/static/server_objects.pwn index 2740e40..9313de4 100644 --- a/gamemodes/irresistible/cnr/static/server_objects.pwn +++ b/gamemodes/irresistible/cnr/static/server_objects.pwn @@ -11,45 +11,6 @@ /* ** Functions ** */ hook OnScriptInit( ) { - // Classes - CreateDynamicObject( 14846, 242.121002, 77.313003, 1605.078002, 0.000000, 0.000000, 0.000000, .priority = 9999, .streamdistance = -1.0 ); - CreateDynamicObject( 2605, 237.936004, 85.197998, 1604.431030, 0.000000, 0.000000, 80.000000, .priority = 9999, .streamdistance = -1.0 ); - CreateDynamicObject( 2356, 238.682006, 84.823997, 1604.057983, 0.000000, 0.000000, 61.299999, .priority = 9999, .streamdistance = -1.0 ); - CreateDynamicObject( 19623, 236.035995, 86.892997, 1605.670043, 0.000000, 0.000000, -90.000000, .priority = 9999, .streamdistance = -1.0 ); - CreateDynamicObject( 19611, 236.072998, 86.892997, 1604.037963, 0.000000, 0.000000, 0.000000, .priority = 9999, .streamdistance = -1.0 ); - SetDynamicObjectMaterial( CreateDynamicObject( 2960, 229.427993, 85.385002, 1606.333984, 0.000000, 90.000000, 0.000000, .priority = 9999, .streamdistance = -1.0 ), 0, 18217, "mtbfencecs_t", "Metal1_128", -16 ); - SetDynamicObjectMaterial( CreateDynamicObject( 19328, 229.037002, 87.126998, 1605.214965, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, 8395, "pyramid", "white", -16 ); - SetDynamicObjectMaterial( CreateDynamicObject( 19328, 229.035003, 87.125000, 1605.713012, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, 8395, "pyramid", "white", -16 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1606.453979, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, ". _________ .", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1606.104003, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, ". _________ .", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.754028, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, ". _________ .", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.404052, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, ". _________ .", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.053955, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, ". _________ .", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1606.223999, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1606.333984, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.884033, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.994018, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.524047, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.634033, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterial( CreateDynamicObject( 2960, 229.427993, 88.864997, 1606.333984, 0.000000, 90.000000, 0.000000, .priority = 9999, .streamdistance = -1.0 ), 0, 18217, "mtbfencecs_t", "Metal1_128", -16 ); - SetDynamicObjectMaterial( CreateDynamicObject( 2834, 230.143997, 86.521003, 1604.057983, 0.000000, 0.000000, 8.199999, .priority = 9999, .streamdistance = -1.0 ), 0, 6287, "pierc_law2", "bluemetal", -16 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.284057, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.065002, 87.444999, 1605.163940, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "_____", 140, "aRIAL", 30, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterial( CreateDynamicObject( 19377, 228.938995, 87.805999, 1605.038940, 0.000000, 0.000000, 0.000000, .priority = 9999, .streamdistance = -1.0 ), 0, 19377, "none", "none", 1 ); - CreateDynamicObject( 927, 229.072006, 89.900001, 1605.298950, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ); - CreateDynamicObject( 927, 229.072006, 84.360000, 1605.698974, 0.000000, 180.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ); - CreateDynamicObject( 927, 229.072006, 82.709999, 1606.699951, 0.000000, -90.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.054992, 87.705001, 1606.413940, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "7'", 140, "arial", 40, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.054992, 87.705001, 1606.063964, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "6'", 140, "arial", 40, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.054992, 87.705001, 1605.713989, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "5'", 140, "arial", 40, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.054992, 87.705001, 1605.364013, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "4'", 140, "arial", 40, 1, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( CreateDynamicObject( 19328, 229.054992, 87.705001, 1605.014038, 0.000000, 0.000000, 90.000000, .priority = 9999, .streamdistance = -1.0 ), 0, "3'", 140, "arial", 40, 1, -16777216, 0, 1 ); - tmpVariable = CreateDynamicObject( 18066, 229.000000, 86.862998, 1006.598999, -8.199999, 0.000000, -90.000000, .priority = 9999, .streamdistance = -1.0 ); - SetDynamicObjectMaterialText( tmpVariable, 0, "SF-CNR", 130, "IMPACT", 70, 0, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( tmpVariable, 1, "SF-CNR", 130, "IMPACT", 70, 0, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( tmpVariable, 2, "SF-CNR", 130, "IMPACT", 70, 0, -16777216, 0, 1 ); - SetDynamicObjectMaterialText( tmpVariable, 3, "SF-CNR", 130, "IMPACT", 70, 0, -16777216, 0, 1 ); - // Misc CreateDynamicObject(1498, 308.68, 312.10, 1002.30, 0.00, 0.00, 0.00); // Michelle's interior door CreateDynamicObject(19312, 191.16823, 1870.02869, 21.45658, 0.00, 0.00, 0.00); // Area 51 From 777fa44b9b20abb038ffbf6f0f2fb44acb6c7a4f Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 18:24:16 +1000 Subject: [PATCH 28/66] remove annoying show feature on register --- gamemodes/sf-cnr.pwn | 2 -- 1 file changed, 2 deletions(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index d46a51f..693b46c 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -4796,8 +4796,6 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) // ShowPlayerDialog( playerid, DIALOG_SPAWN_CITY, DIALOG_STYLE_LIST, "{FFFFFF}Select Spawning City", "San Fierro\nLas Venturas\nLos Santos\nRandom City", "Select", "" ); SendServerMessage( playerid, "Your job has been set to %s. you can change it at the City Hall for "COL_GOLD"$5,000"COL_WHITE".", GetJobName( p_Job{ playerid } ) ); - - DisplayFeatures( playerid ); } else { From 49660232df30e7efb15bca4fb9ed65c6309d6ed8 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 18:27:57 +1000 Subject: [PATCH 29/66] update default motd to nothing --- gamemodes/irresistible/cnr/textdraws.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/textdraws.pwn b/gamemodes/irresistible/cnr/textdraws.pwn index 4b9f49f..caa653a 100644 --- a/gamemodes/irresistible/cnr/textdraws.pwn +++ b/gamemodes/irresistible/cnr/textdraws.pwn @@ -135,7 +135,7 @@ hook OnScriptInit( ) TextDrawColor(g_MotdTD, -1); TextDrawSetOutline(g_MotdTD, 1); TextDrawSetProportional(g_MotdTD, 1); - TextDrawSetString( g_MotdTD, "~w~Want more ~g~money~w~, ~r~houses~w~, and ~b~vehicles~w~? Consider donating! ~y~/vip" ); + TextDrawSetString( g_MotdTD, "_" ); g_ObjectLoadTD = TextDrawCreate(320.000000, 148.000000, "Loading Objects...~n~Please Wait..."); TextDrawAlignment(g_ObjectLoadTD, 2); From c519ae54fa511d3f390f7519c2bdf1bcfcb74dad Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 18:28:56 +1000 Subject: [PATCH 30/66] clean up help.pwn --- gamemodes/irresistible/cnr/commands/cmd_help.pwn | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/cmd_help.pwn b/gamemodes/irresistible/cnr/commands/cmd_help.pwn index 985f183..490df41 100644 --- a/gamemodes/irresistible/cnr/commands/cmd_help.pwn +++ b/gamemodes/irresistible/cnr/commands/cmd_help.pwn @@ -22,11 +22,6 @@ CMD:help( playerid, params[ ] ) { } CMD:features( playerid, params[ ] ) { - return DisplayFeatures( playerid ); -} - -stock DisplayFeatures( playerid ) -{ SetPVarInt( playerid, "help_category", 1 ); mysql_function_query( dbHandle, "SELECT `SUBJECT`,`ID`,`CATEGORY` FROM `HELP` WHERE `CATEGORY`=1 ORDER BY `SUBJECT` ASC", true, "OnFetchCategoryResponse", "dd", playerid, 1 ); return 1; From c6eaca88e8d9fcb77be873790da19ad206f71a44 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 1 Jun 2019 19:52:32 +1000 Subject: [PATCH 31/66] make donation goal between 0 and 10k --- gamemodes/irresistible/cnr/features/vip/redeem_code.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn index 8b72e43..7c9ec9f 100644 --- a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn @@ -307,7 +307,7 @@ CMD:updatedonategoal( playerid, params[ ] ) if ( ! IsPlayerAdmin( playerid ) && ! IsPlayerLeadMaintainer( playerid ) ) return 0; else if ( sscanf( params, "f", donation_goal ) ) return SendUsage( playerid, "/updatedonationreq [DONATION_GOAL_AMOUNT]" ); - else if ( ! ( 1.0 <= donation_goal < 10000.0 ) ) return SendError( playerid, "Donation goal amount must be between $1 and $10,000." ); + else if ( ! ( 0.0 <= donation_goal < 10000.0 ) ) return SendError( playerid, "Donation goal amount must be between $0 and $10,000." ); else { new From ff4254fd75e3a3b0ec10f10b70ba290101030f42 Mon Sep 17 00:00:00 2001 From: Dusan Date: Sat, 1 Jun 2019 14:41:37 +0200 Subject: [PATCH 32/66] Level 5-6 acmds based on note --- .../cnr/commands/admin/admin_five.pwn | 254 ++++++++++++++---- .../cnr/commands/admin/admin_six.pwn | 67 ++++- 2 files changed, 263 insertions(+), 58 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn index b9582df..ae9724d 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn @@ -111,28 +111,68 @@ CMD:c( playerid, params[ ] ) CMD:creategarage( playerid, params[ ] ) { new - cost, iTmp, iVehicle, - Float: X, Float: Y, Float: Z, Float: Angle - ; + pID, cost; if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "d", cost ) ) return SendUsage( playerid, "/creategarage [COST]" ); + else if ( sscanf( params, "dU(-1)", cost, pID ) ) return SendUsage( playerid, "/creategarage [COST] [PLAYER_ID (optional)]" ); + else if ( ! IsPlayerServerMaintainer( playerid ) && ! IsPlayerConnected( pID ) && cost < 50000 ) return SendError( playerid, "You must specify a player for garages under $50,000." ); else if ( cost < 100 ) return SendError( playerid, "The price must be located above 100 dollars." ); - else if ( !( iVehicle = GetPlayerVehicleID( playerid ) ) ) return SendError( playerid, "You are not in any vehicle." ); else { - AddAdminLogLineFormatted( "%s(%d) has created a garage", ReturnPlayerName( playerid ), playerid ); + mysql_format( + dbHandle, szBigString, sizeof( szBigString ), + "SELECT * FROM `NOTES` WHERE (`NOTE` LIKE '{FFDC2E}V.I.P Garage%%' ) AND USER_ID=%d AND `DELETED` IS NULL LIMIT 0,1", + IsPlayerConnected( pID ) ? GetPlayerAccountID( pID ) : 0 + ); + mysql_tquery( dbHandle, szBigString, "OnAdminCreateGarage", "ddd", playerid, pID, cost ); + } + return 1; +} - if ( GetVehiclePos( iVehicle, X, Y, Z ) && GetVehicleZAngle( iVehicle, Angle ) ) +thread OnAdminCreateGarage( playerid, targetid, cost ) +{ + new + num_rows = cache_get_row_count( ); + + // if there is a note or the player is a maintainer + if ( IsPlayerServerMaintainer( playerid ) || num_rows || cost >= 50000 ) + { + new + noteid = -1; // incase the lead maintainer makes it anyway + + // remove the note if there is one + if ( num_rows ) { - if ( ( iTmp = CreateGarage( 0, cost, 0, X, Y, Z, Angle ) ) != -1 ) - { - SaveToAdminLog( playerid, iTmp, "created garage" ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" You have created a %s garage taking up garage id %d.", cash_format( cost ), iTmp ); - } - else - SendClientMessage( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" Unable to create a garage due to a unexpected error." ); + // get the first note + noteid = cache_get_field_content_int( 0, "ID", dbHandle ); + + // remove the note + SaveToAdminLog( playerid, noteid, "consumed player's note" ); + mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", GetPlayerAccountID( playerid ), noteid ) ); } + + static + Float: X, Float: Y, Float: Z, Float: Angle, iVehicle, iTmp; + + // proceed by creating the garage + if ( !( iVehicle = GetPlayerVehicleID( playerid ) ) ) return SendError( playerid, "You are not in any vehicle." ); + if ( GetVehiclePos( iVehicle, X, Y, Z ) && GetVehicleZAngle( iVehicle, Angle ) && ( iTmp = CreateGarage( 0, cost, 0, X, Y, Z, Angle ) != -1 ) ) { + if ( IsPlayerConnected( targetid ) ) { + SaveToAdminLogFormatted( playerid, iTmp, "created garage (garage id %d) for %s (acc id %d, note id %d)", iTmp, ReturnPlayerName( targetid ), p_AccountID[ targetid ], noteid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" You have created a garage in the name of %s(%d).", ReturnPlayerName( targetid ), targetid ); + AddAdminLogLineFormatted( "%s(%d) has created a garage for %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( targetid ), targetid ); + } else { + SaveToAdminLogFormatted( playerid, iTmp, "created garage (garage id %d)", iTmp ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" You have created a garage." ); + AddAdminLogLineFormatted( "%s(%d) has created a house", ReturnPlayerName( playerid ), playerid ); + } + } else { + SendClientMessage( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" Unable to create a garage due to a unexpected error." ); + } + } + else + { + SendError( playerid, "This user does not have a V.I.P Garage note." ); } return 1; } @@ -597,9 +637,7 @@ CMD:destroybribe( playerid, params[ ] ) CMD:createcar( playerid, params[ ] ) { new - vName[ 24 ], pID, - Float: X, Float: Y, Float: Z, Float: Angle - ; + vName[ 24 ], pID, iModel; if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); else if ( sscanf( params, "us[24]", pID, vName ) ) return SendUsage( playerid, "/createcar [PLAYER_ID] [VEHICLE_NAME]" ); @@ -607,27 +645,64 @@ CMD:createcar( playerid, params[ ] ) else if ( p_OwnedVehicles[ pID ] >= GetPlayerVehicleSlots( pID ) ) return SendError( playerid, "This player has too many vehicles." ); else { - new - iModel, iTmp; - if ( ( iModel = GetVehicleModelFromName( vName ) ) != -1 ) { - - AddAdminLogLineFormatted( "%s(%d) has created a vehicle for %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); - GetPlayerPos( playerid, X, Y, Z ); - GetPlayerFacingAngle( playerid, Angle ); - - if ( ( iTmp = CreateBuyableVehicle( pID, iModel, 0, 0, X, Y, Z, Angle, 1337 ) ) != -1 ) { - SaveToAdminLogFormatted( playerid, iTmp, "created car (model id %d) for %s (acc id %d)", iModel, ReturnPlayerName( pID ), p_AccountID[ pID ] ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" You have created a vehicle in the name of %s(%d).", ReturnPlayerName( pID ), pID ); - PutPlayerInVehicle( playerid, g_vehicleData[ pID ] [ iTmp ] [ E_VEHICLE_ID ], 0 ); - } - else SendClientMessage( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" Unable to create a vehicle due to a unexpected error." ); + mysql_format( + dbHandle, szBigString, sizeof( szBigString ), + "SELECT * FROM `NOTES` WHERE (`NOTE` LIKE '{FFDC2E}V.I.P Vehicle%%' ) AND USER_ID=%d AND `DELETED` IS NULL LIMIT 0,1", + GetPlayerAccountID( pID ) + ); + mysql_tquery( dbHandle, szBigString, "OnAdminCreateVehicle", "ddd", playerid, pID, iModel ); } else SendError( playerid, "Invalid Vehicle Model." ); } return 1; } +thread OnAdminCreateVehicle( playerid, targetid, modelid ) +{ + new + num_rows = cache_get_row_count( ); + + // if there is a note or the player is a maintainer + if ( IsPlayerServerMaintainer( playerid ) || num_rows ) + { + new + noteid = -1; // incase the lead maintainer makes it anyway + + // remove the note if there is one + if ( num_rows ) + { + // get the first note + noteid = cache_get_field_content_int( 0, "ID", dbHandle ); + + // remove the note + SaveToAdminLog( playerid, noteid, "consumed player's note" ); + mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", GetPlayerAccountID( playerid ), noteid ) ); + } + + static + Float: X, Float: Y, Float: Z, Float: Angle, iTmp; + + // proceed by creating the vehicle + GetPlayerPos( playerid, X, Y, Z ); + GetPlayerFacingAngle( playerid, Angle ); + + if ( ( iTmp = CreateBuyableVehicle( targetid, modelid, 0, 0, X, Y, Z, Angle, 1337 ) ) != -1 ) { + SaveToAdminLogFormatted( playerid, iTmp, "created car (model id %d) for %s (acc id %d, note id %d)", modelid, ReturnPlayerName( targetid ), p_AccountID[ targetid ], noteid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" You have created a vehicle in the name of %s(%d).", ReturnPlayerName( targetid ), targetid ); + AddAdminLogLineFormatted( "%s(%d) has created a vehicle for %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( targetid ), targetid ); + PutPlayerInVehicle( playerid, g_vehicleData[ targetid ] [ iTmp ] [ E_VEHICLE_ID ], 0 ); + } else { + SendClientMessage( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" Unable to create a vehicle due to a unexpected error." ); + } + } + else + { + SendError( playerid, "This user does not have a V.I.P Vehicle note." ); + } + return 1; +} + CMD:destroycar( playerid, params[ ] ) { new @@ -680,28 +755,117 @@ CMD:stripcarmods( playerid, params[ ] ) return 1; } +CMD:replacecar( playerid, params[ ] ) +{ + new + vName[ 24 ], iModel; + + if ( sscanf( params, "s[24]", vName ) ) return SendUsage(playerid, "/replacecar [VEHICLE_NAME]"); + + if ( p_AdminLevel[ playerid ] < 5 ) + return SendError( playerid, ADMIN_COMMAND_REJECT ); + + if ( !IsPlayerInAnyVehicle( playerid ) ) + return SendError( playerid, "You are not in any vehicle." ); + + if ( g_buyableVehicle{ GetPlayerVehicleID( playerid ) } == false ) + return SendError( playerid, "This vehicle isn't a buyable vehicle." ); + if ( ( iModel = GetVehicleModelFromName( vName ) ) != -1 ) { + + new + oldmodel, ownerid, slotid, vehicleid = GetPlayerVehicleID( playerid ), + v = getVehicleSlotFromID( vehicleid, ownerid, slotid ), + Float: X, Float: Y, Float: Z, Float: Angle + ; + + if ( v == -1 ) return SendError( playerid, "This vehicle doesn't look like it can be replaced. (0xAA)" ); + if ( g_vehicleData[ ownerid ] [ slotid ] [ E_CREATED ] == false ) return SendError( playerid, "This vehicle doesn't look like it can be replaced. (0xAF)" ); + + GetVehiclePos( vehicleid, X, Y, Z ); + GetVehicleZAngle( vehicleid, Angle ); + + oldmodel = GetVehicleModel( vehicleid ); + + g_vehicleData[ ownerid ] [ slotid ] [ E_MODEL ] = iModel; + + PutPlayerInVehicle( playerid, RespawnBuyableVehicle( vehicleid, playerid ), 0 ); + SaveVehicleData( ownerid, slotid ); + + SendClientMessage( playerid, -1, ""COL_GREY"[VEHICLE]"COL_WHITE" You have replaced model of this vehicle via administration." ); + SaveToAdminLogFormatted( playerid, slotid, "replaced car on %s (acc id %d, model id %d)", ReturnPlayerName( ownerid ), p_AccountID[ ownerid ], g_vehicleData[ ownerid ] [ slotid ] [ E_MODEL ] ); + AddAdminLogLineFormatted( "%s(%d) changed %s(%d)'s vehicle from %s to %s", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( ownerid ), ownerid, GetVehicleName( oldmodel ), GetVehicleName( iModel ) ); + } + else + { + SendError( playerid, "Invalid Vehicle Model." ); + } + return 1; +} + CMD:createhouse( playerid, params[ ] ) { new - cost, iTmp, - Float: X, Float: Y, Float: Z - ; + pID, cost; if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "d", cost ) ) return SendUsage( playerid, "/createhouse [COST]" ); + else if ( sscanf( params, "dU(-1)", cost, pID ) ) return SendUsage( playerid, "/createhouse [COST] [PLAYER_ID (optional)]" ); + else if ( ! IsPlayerServerMaintainer( playerid ) && ! IsPlayerConnected( pID ) && cost < 50000 ) return SendError( playerid, "You must specify a player for homes under $50,000." ); else if ( cost < 100 ) return SendError( playerid, "The price must be located above 100 dollars." ); else { - AddAdminLogLineFormatted( "%s(%d) has created a house", ReturnPlayerName( playerid ), playerid ); - if ( GetPlayerPos( playerid, X, Y, Z ) ) + mysql_format( + dbHandle, szBigString, sizeof( szBigString ), + "SELECT * FROM `NOTES` WHERE (`NOTE` LIKE '{FFDC2E}V.I.P House%%' ) AND USER_ID=%d AND `DELETED` IS NULL LIMIT 0,1", + IsPlayerConnected( pID ) ? GetPlayerAccountID( pID ) : 0 + ); + mysql_tquery( dbHandle, szBigString, "OnAdminCreateHouse", "ddd", playerid, pID, cost ); + } + return 1; +} + +thread OnAdminCreateHouse( playerid, targetid, cost ) +{ + new + num_rows = cache_get_row_count( ); + + // if there is a note or the player is a maintainer + if ( IsPlayerServerMaintainer( playerid ) || num_rows || cost >= 50000 ) + { + new + noteid = -1; // incase the lead maintainer makes it anyway + + // remove the note if there is one + if ( num_rows ) { - if ( ( iTmp = CreateHouse( "Home", cost, X, Y, Z ) ) != -1 ) - { - SaveToAdminLogFormatted( playerid, iTmp, "created house for %s", cash_format( cost ) ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a %s house taking up house id %d.", cash_format( cost ), iTmp ); - } - else SendClientMessage( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" Unable to create a house due to a unexpected error." ); + // get the first note + noteid = cache_get_field_content_int( 0, "ID", dbHandle ); + + // remove the note + SaveToAdminLog( playerid, noteid, "consumed player's note" ); + mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", GetPlayerAccountID( playerid ), noteid ) ); } + + static + Float: X, Float: Y, Float: Z, iTmp; + + // proceed by creating the house + if ( GetPlayerPos( playerid, X, Y, Z ) && ( iTmp = CreateHouse( "Home", cost, X, Y, Z ) ) != -1 ) { + if ( IsPlayerConnected( targetid ) ) { + SaveToAdminLogFormatted( playerid, iTmp, "created house (house id %d) for %s (acc id %d, note id %d)", iTmp, ReturnPlayerName( targetid ), p_AccountID[ targetid ], noteid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a house in the name of %s(%d).", ReturnPlayerName( targetid ), targetid ); + AddAdminLogLineFormatted( "%s(%d) has created a house for %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( targetid ), targetid ); + } else { + SaveToAdminLogFormatted( playerid, iTmp, "created house (house id %d)", iTmp ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a house." ); + AddAdminLogLineFormatted( "%s(%d) has created a house", ReturnPlayerName( playerid ), playerid ); + } + } else { + SendClientMessage( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" Unable to create a house due to a unexpected error." ); + } + } + else + { + SendError( playerid, "This user does not have a V.I.P House note." ); } return 1; } @@ -755,7 +919,7 @@ CMD:unforceac( playerid, params[ ] ) Query[ 70 ]; if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "s[24]", player ) ) SendUsage( playerid, "/unban [NAME]" ); + else if ( sscanf( params, "s[24]", player ) ) SendUsage( playerid, "/unforceac [PLAYER_NAME]" ); else { new pID = GetPlayerIDFromName( player ); @@ -780,7 +944,7 @@ thread OnPlayerUnforceAC( playerid, player[ ], pID, bool:offline ) Query[ 70 ], rows = cache_get_row_count( ); if ( !rows ) return SendError( playerid, "The database does not contain the username you are attempting to remove from forced ac." ); - + if ( offline ) { diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn index bc36451..aebd20d 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn @@ -9,28 +9,69 @@ CMD:createbusiness( playerid, params[ ] ) { new - Float: X, Float: Y, Float: Z, cost, type - ; + pID, cost, type; if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "dd", cost, type ) ) return SendUsage( playerid, "/createbusiness [COST] [TYPE]" ); + else if ( sscanf( params, "ddU(-1)", cost, type, pID ) ) return SendUsage( playerid, "/createhouse [COST] [TYPE] [PLAYER_ID (optional)]" ); + else if ( ! IsPlayerServerMaintainer( playerid ) && ! IsPlayerConnected( pID ) && cost < 50000 ) return SendError( playerid, "You must specify a player for business under $50,000." ); else if ( cost < 100 ) return SendError( playerid, "The price must be located above 100 dollars." ); else if ( ! ( 0 <= type <= 3 ) ) return SendError( playerid, "Invalid business type (Weed=0, Meth=1, Coke=2, Weapons=3)." ); else { - GetPlayerPos( playerid, X, Y, Z ); - AddAdminLogLineFormatted( "%s(%d) has created a business", ReturnPlayerName( playerid ), playerid ); + mysql_format( + dbHandle, szBigString, sizeof( szBigString ), + "SELECT * FROM `NOTES` WHERE (`NOTE` LIKE '{FFDC2E}%%Business%%') AND USER_ID=%d AND `DELETED` IS NULL LIMIT 0,1", + IsPlayerConnected( pID ) ? GetPlayerAccountID( pID ) : 0 + ); + mysql_tquery( dbHandle, szBigString, "OnAdminCreateBusiness", "dddd", playerid, pID, cost, type ); + } + return 1; +} +thread OnAdminCreateBusiness( playerid, targetid, cost, type ) +{ + new + num_rows = cache_get_row_count( ); + + // if there is a note or the player is a maintainer + if ( IsPlayerServerMaintainer( playerid ) || num_rows || cost >= 50000 ) + { new - iTmp = CreateBusiness( 0, "Business", cost, type, X, Y, Z ); + noteid = -1; // incase the lead maintainer makes it anyway - if ( iTmp != ITER_NONE ) { - SaveToAdminLog( playerid, iTmp, "created business" ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" You have created a %s business taking up business id %d.", cash_format( cost ), iTmp ); - } else { + // remove the note if there is one + if ( num_rows ) + { + // get the first note + noteid = cache_get_field_content_int( 0, "ID", dbHandle ); + + // remove the note + SaveToAdminLog( playerid, noteid, "consumed player's note" ); + mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", GetPlayerAccountID( playerid ), noteid ) ); + } + + static + Float: X, Float: Y, Float: Z, iTmp; + + // proceed by creating the business + if ( GetPlayerPos( playerid, X, Y, Z ) && ( iTmp = CreateBusiness( 0, "Business", cost, type, X, Y, Z ) != ITER_NONE ) ) { + if ( IsPlayerConnected( targetid ) ) { + SaveToAdminLogFormatted( playerid, iTmp, "created business (business id %d) for %s (acc id %d, note id %d)", iTmp, ReturnPlayerName( targetid ), p_AccountID[ targetid ], noteid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" You have created a business in the name of %s(%d).", ReturnPlayerName( targetid ), targetid ); + AddAdminLogLineFormatted( "%s(%d) has created a business for %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( targetid ), targetid ); + } else { + SaveToAdminLogFormatted( playerid, iTmp, "created business (business id %d)", iTmp ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" You have created a business." ); + AddAdminLogLineFormatted( "%s(%d) has created a business", ReturnPlayerName( playerid ), playerid ); + } + } else { SendClientMessage( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" Unable to create a business due to a unexpected error." ); } } + else + { + SendError( playerid, "This user does not have a V.I.P Business note." ); + } return 1; } @@ -72,7 +113,7 @@ CMD:createentrance( playerid, params[ ] ) ; if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "ufffdddds[32]", ownerid, toX, toY, toZ, interior, world, customInterior, vipOnly, label ) ) return SendUsage( playerid, "/createhouse [OWNER] [TO_X] [TO_Y] [TO_Z] [INTERIOR] [WORLD] [CUSTOM_INTERIOR] [VIP_ONLY] [LABEL]" ); + else if ( sscanf( params, "ufffdddds[32]", ownerid, toX, toY, toZ, interior, world, customInterior, vipOnly, label ) ) return SendUsage( playerid, "/createentrance [OWNER] [TO_X] [TO_Y] [TO_Z] [INTERIOR] [WORLD] [CUSTOM_INTERIOR] [VIP_ONLY] [LABEL]" ); else if ( !IsPlayerConnected( ownerid ) || IsPlayerNPC( ownerid ) ) return SendError( playerid, "Invalid Player ID." ); else { @@ -83,7 +124,7 @@ CMD:createentrance( playerid, params[ ] ) entranceid = CreateEntrance( label, X, Y, Z, toX, toY, toZ, interior, world, customInterior > 0, vipOnly > 0 ); if ( entranceid == -1 ) - return SendClientMessage( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" Unable to create a entrance due to a unexpected error." ); + return SendClientMessage( playerid, -1, ""COL_PINK"[ENTRANCE]"COL_WHITE" Unable to create a entrance due to a unexpected error." ); SaveToAdminLog( playerid, entranceid, "created entrance" ); g_entranceData[ entranceid ] [ E_SAVED ] = true; @@ -91,7 +132,7 @@ CMD:createentrance( playerid, params[ ] ) format( szBigString, 256, "INSERT INTO `ENTRANCES` (`OWNER`, `LABEL`, `X`, `Y`, `Z`, `EX`, `EY`, `EZ`, `INTERIOR`, `WORLD`, `CUSTOM`, `VIP_ONLY`) VALUES ('%s','%s',%f,%f,%f,%f,%f,%f,%d,%d,%d,%d)", mysql_escape( ReturnPlayerName( ownerid ) ), mysql_escape( label ), X, Y, Z, toX, toY, toZ, interior, world, customInterior, vipOnly ); mysql_single_query( szBigString ); - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a entrance using id %d.", entranceid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ENTRANCE]"COL_WHITE" You have created a entrance using id %d.", entranceid ); } } return 1; From ccfaca5b483c0f304dedf6f2b48c994611c946cc Mon Sep 17 00:00:00 2001 From: Stev Date: Sat, 1 Jun 2019 14:58:56 +0100 Subject: [PATCH 33/66] starting roleplay level array --- gamemodes/irresistible/cnr/features/player/experience.pwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/player/experience.pwn b/gamemodes/irresistible/cnr/features/player/experience.pwn index 14bdb05..ca8a0ce 100644 --- a/gamemodes/irresistible/cnr/features/player/experience.pwn +++ b/gamemodes/irresistible/cnr/features/player/experience.pwn @@ -19,6 +19,7 @@ enum E_LEVELS { E_POLICE, E_ROBBERY, E_DEATHMATCH, + E_ROLEPLAY /*E_FIREMAN, E_PARAMEDIC, @@ -52,7 +53,9 @@ static const // Level Name Bar Color Level 100 Req. XP Dilation Sell Value { "Police", 0x3E7EFFFF, 7500.0, 20.0, 10.0 }, // 7.5k arrests { "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30K robberies - { "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 } // 75K kills + { "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 }, // 75K kills + { "Roleplay", 0x33FF50FF, 14000.0, 7.0, 7.0 } // 14K minijob + /* { "Fireman", 10000.0, 9.0 }, // 10k fires { "Hitman", 1500.0, 4.5 }, // 1.5k contracts From 8d1486ae4db514ca84251ddd171f85acdec36c92 Mon Sep 17 00:00:00 2001 From: Stev Date: Sat, 1 Jun 2019 15:09:15 +0100 Subject: [PATCH 34/66] giving experince for minijobs --- gamemodes/irresistible/cnr/features/minijobs/lumberjack.pwn | 1 + gamemodes/irresistible/cnr/features/minijobs/mining.pwn | 1 + gamemodes/irresistible/cnr/features/minijobs/pilot.pwn | 1 + gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn | 1 + gamemodes/irresistible/cnr/features/minijobs/trucking.pwn | 1 + 5 files changed, 5 insertions(+) diff --git a/gamemodes/irresistible/cnr/features/minijobs/lumberjack.pwn b/gamemodes/irresistible/cnr/features/minijobs/lumberjack.pwn index fb7ed85..7805aa7 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/lumberjack.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/lumberjack.pwn @@ -171,6 +171,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) //SendServerMessage( playerid, "You've made "COL_GOLD"%s"COL_WHITE" from exporting. Go and pick another box up!" ); GivePlayerCash( playerid, cash ); GivePlayerScore( playerid, 5 ); + GivePlayerExperience( playerid, E_ROLEPLAY ); DestroyDynamicMapIcon( p_LumberjackMapIcon[ playerid ] ); p_LumberjackMapIcon[ playerid ] = CreateDynamicMapIconEx( -2330.8535, -113.9084, 34.00, 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer ); diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index bf4fa91..eb9ed66 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -209,6 +209,7 @@ hook OnPlayerEnterDynamicCP( playerid, checkpointid ) new earned_money = floatround( float( g_orePrices[ g_miningData[ ore ] [ E_ORE ] ] ) * 0.5 ); + GivePlayerExperience( playerid, E_ROLEPLAY ); GivePlayerCash( playerid, earned_money ); StockMarket_UpdateEarnings( E_STOCK_MINING_COMPANY, earned_money, 0.5 ); SendServerMessage( playerid, "You have crushed a "COL_GREY"%s"COL_WHITE" Ore and earned "COL_GOLD"%s"COL_WHITE".", getOreName( g_miningData[ ore ] [ E_ORE ] ), cash_format( earned_money ) ); diff --git a/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn b/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn index 872a1a8..1cb242f 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn @@ -185,6 +185,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) GivePlayerScore( playerid, 1 + floatround( p_PilotDistance[ playerid ] / 1000.0 ) ); StockMarket_UpdateEarnings( E_STOCK_AVIATION, cash_earned, stock_dividend_allocation ); GivePlayerCash( playerid, cash_earned ); + GivePlayerExperience( playerid, E_ROLEPLAY ); ShowPlayerHelpDialog( playerid, 5000, "You have earned ~y~%s ~w~for exporting %s!", cash_format( cash_earned ), g_CargoName[ p_PilotCargo[ playerid ] ] ); StopPlayerPilotWork( playerid ); diff --git a/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn b/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn index 877e499..be6cbb4 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn @@ -134,6 +134,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) GivePlayerScore( playerid, 1 + floatround( p_TrainDistance[ playerid ] / 1000.0 ) ); GivePlayerCash( playerid, iCashEarned ); + GivePlayerExperience( playerid, E_ROLEPLAY ); ach_HandleTrainMissions( playerid ); diff --git a/gamemodes/irresistible/cnr/features/minijobs/trucking.pwn b/gamemodes/irresistible/cnr/features/minijobs/trucking.pwn index ae8874d..56cbae5 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/trucking.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/trucking.pwn @@ -181,6 +181,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) GivePlayerScore( playerid, 1 + floatround( p_TruckingDistance[ playerid ] / 1000.0 ) ); StockMarket_UpdateEarnings( E_STOCK_TRUCKING_COMPANY, iCashEarned, .factor = 1.0 ); GivePlayerCash( playerid, iCashEarned ); + GivePlayerExperience( playerid, E_ROLEPLAY ); p_TruckingDistance [ playerid ] = 0.0; p_hasTruckingJob { playerid } = false; From a27e3fbc67d5d6936bad329c59a7b2615505643b Mon Sep 17 00:00:00 2001 From: Stev Date: Sat, 1 Jun 2019 15:12:25 +0100 Subject: [PATCH 35/66] changing level array --- gamemodes/irresistible/cnr/features/player/experience.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/player/experience.pwn b/gamemodes/irresistible/cnr/features/player/experience.pwn index ca8a0ce..2a6994a 100644 --- a/gamemodes/irresistible/cnr/features/player/experience.pwn +++ b/gamemodes/irresistible/cnr/features/player/experience.pwn @@ -54,7 +54,7 @@ static const { "Police", 0x3E7EFFFF, 7500.0, 20.0, 10.0 }, // 7.5k arrests { "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30K robberies { "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 }, // 75K kills - { "Roleplay", 0x33FF50FF, 14000.0, 7.0, 7.0 } // 14K minijob + { "Roleplay", 0x33FF50FF, 75000.0, 10.0, 12.0 } // 14K minijob /* { "Fireman", 10000.0, 9.0 }, // 10k fires From 82b53ca356a37b541893ee18a6341b9b9e7e51c7 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sat, 1 Jun 2019 19:08:09 +0300 Subject: [PATCH 36/66] Auto respawn people in event after death People now won't bother /join'ing every time they're killed in the event, they'll spawn in the event till they leave using /leave --- gamemodes/sf-cnr.pwn | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 693b46c..3de72d3 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -727,7 +727,19 @@ public OnPlayerSpawn( playerid ) SpawnToPaintball( playerid, p_PaintBallArena{ playerid } ); return 1; } - + + #if defined __cloudy_event_system + else if ( IsPlayerInEvent( playerid ) ) + { + if( ! EventSettingAllow( 0 ) && g_eventData[ EV_STARTED ] ) + { + SetPlayerInEvent( playerid ); // respawns player in event. + return 1; + } + else RemovePlayerFromEvent( playerid, true ); // changes the InEvent variable to false. + } + #endif + if ( p_Class[ playerid ] == CLASS_CIVILIAN ) { if ( !p_JobSet{ playerid } ) From 040c4684b01da75abe0f1da59408eeb71e93021e Mon Sep 17 00:00:00 2001 From: Stev Date: Sat, 1 Jun 2019 17:26:09 +0100 Subject: [PATCH 37/66] success rate depending on roleplay level --- .../cnr/features/minijobs/mining.pwn | 22 ++++++++----------- .../cnr/features/player/experience.pwn | 6 ++--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index eb9ed66..ada9bd3 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -44,6 +44,7 @@ static stock g_orePrices [ ] = { 675, 900, 600, 2750, 3000, 3500, 4000, 2200, 2300, 1200 }, g_oreMiningTime [ ] = { 2000, 2800, 1600, 6800, 7200, 7600, 8000, 6400, 6560, 4000 }, g_oreQuanities [ ] = { 8, 8, 8, 8, 5, 3, 3, 5, 5, 6 }, + g_oreProbability [ ] = { 85, 80, 90, 45, 35, 30, 25, 52, 30, 75 }, // Iterator Iterator: miningrock < MAX_ROCKS > @@ -155,22 +156,17 @@ hook OnProgressCompleted( playerid, progressid, params ) if ( progressid == PROGRESS_MINING ) { new m = p_MiningOre{ playerid }; - new iRandom = random( 101 ); + new iRandom = random( 100 ); p_isMining{ playerid } = false; g_miningData[ m ] [ E_MINING ] = INVALID_PLAYER_ID; - if ( ( g_miningData[ m ] [ E_ORE ] == ORE_IRON && iRandom > 80 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_BAUXITE && iRandom > 85 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_GOLD && iRandom > 45 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_COAL && iRandom > 90 || - ( g_miningData[ m ] [ E_ORE ] == ORE_DIAMOND && iRandom > 30 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_RUBY && iRandom > 35 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_SAPHHIRE && iRandom > 30 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_EMERALD && iRandom > 52 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_PLATINUM && iRandom > 25 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_AMETHYST && iRandom > 75 ) ) - ) + new Float: random_chance = fRandomEx( 0.0, 101.0 ); + + random_chance += GetPlayerLevel( playerid, E_ROLEPLAY ) * 0.2; + + // potential for a 20% success rate + if ( random_chance < 20.0 ) { SetPlayerMineOre( playerid, m ); return SendError( playerid, "You did not find any ore. Mining again." ); @@ -384,7 +380,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) GivePlayerCash( playerid, cashEarned ); StockMarket_UpdateEarnings( E_STOCK_MINING_COMPANY, cashEarned, 0.5 ); GivePlayerScore( playerid, floatround( oresExported / 2 ) ); // 16 score is a bit too much for ore... so half that = 8 - //GivePlayerExperience( playerid, E_MINING, float( oresExported ) * 0.2 ); + GivePlayerExperience( playerid, E_ROLEPLAY, float( oresExported ) * 0.2 ); SendServerMessage( playerid, "You have exported %d rock ore(s) to an industry, earning you "COL_GOLD"%s"COL_WHITE".", oresExported, cash_format( cashEarned ) ); } return Y_HOOKS_BREAK_RETURN_1; diff --git a/gamemodes/irresistible/cnr/features/player/experience.pwn b/gamemodes/irresistible/cnr/features/player/experience.pwn index 2a6994a..d1aa8a1 100644 --- a/gamemodes/irresistible/cnr/features/player/experience.pwn +++ b/gamemodes/irresistible/cnr/features/player/experience.pwn @@ -52,9 +52,9 @@ static const { // Level Name Bar Color Level 100 Req. XP Dilation Sell Value { "Police", 0x3E7EFFFF, 7500.0, 20.0, 10.0 }, // 7.5k arrests - { "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30K robberies - { "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 }, // 75K kills - { "Roleplay", 0x33FF50FF, 75000.0, 10.0, 12.0 } // 14K minijob + { "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30k robberies + { "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 }, // 75k kills + { "Roleplay", 0x33FF50FF, 75000.0, 10.0, 12.0 } // 75k minijob /* { "Fireman", 10000.0, 9.0 }, // 10k fires From ee58f1d9d2bef5c86d12918abe00ba8a6893dd1b Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sat, 1 Jun 2019 21:55:58 +0300 Subject: [PATCH 38/66] Adds fishing boats --- gamemodes/irresistible/cnr/static/server_vehicles.pwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gamemodes/irresistible/cnr/static/server_vehicles.pwn b/gamemodes/irresistible/cnr/static/server_vehicles.pwn index 4a313ee..a47e081 100644 --- a/gamemodes/irresistible/cnr/static/server_vehicles.pwn +++ b/gamemodes/irresistible/cnr/static/server_vehicles.pwn @@ -418,6 +418,14 @@ static stock InitializeServerVehicles( ) SetVehicleVirtualWorld( tmpVariable, 31 ), LinkVehicleToInterior( tmpVariable, 9 ), SetVehicleParamsEx( tmpVariable, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF ); tmpVariable = AddStaticVehicle( 451, -1879.5490, -630.3375, 1002.1699, 318.5035, 1, 1 ); // white SetVehicleVirtualWorld( tmpVariable, 31 ), LinkVehicleToInterior( tmpVariable, 9 ), SetVehicleParamsEx( tmpVariable, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF ); + + // SF Fishing Boats + AddStaticVehicle( 453, -2994.639892, 492.919006, 0.108999, 359.498992, -1, -1 ); + AddStaticVehicle( 453, -2982.639892, 492.919006, -0.921999, 359.437011, -1, -1 ); + AddStaticVehicle( 453, -2953.639892, 492.919006, -0.823000, 359.410003, -1, -1 ); + AddStaticVehicle( 453, -2941.639892, 492.919006, -0.828999, 359.394989, -1, -1 ); + AddStaticVehicle( 453, -2959.639892, 492.919006, -0.564000, 359.359985, -1, -1 ); + AddStaticVehicle( 453, -2970.639892, 492.919006, -0.374000, 359.475006, -1, -1 ); // // // LAS VENTURAS // From 1460db6af77dd21fc38ccf4505da0f724dd94761 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 01:01:26 +0300 Subject: [PATCH 39/66] Adds variable Adds the p_TogglePBChat variable to player.pwn --- gamemodes/irresistible/cnr/player.pwn | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 0ac02ff..ea5a19b 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -38,6 +38,7 @@ new bool: p_Kidnapped [ MAX_PLAYERS char ], bool: p_ToggledViewPM [ MAX_PLAYERS char ], bool: p_ToggleCopChat [ MAX_PLAYERS char ], + bool: p_TogglePBChat [ MAX_PLAYERS char ], bool: p_pausedToLoad [ MAX_PLAYERS char ], bool: p_CantUseReport [ MAX_PLAYERS char ], p_pausedToLoadTimer [ MAX_PLAYERS ], From 80637fd0cb7244b3a27e6e10320d5fab75f1b934 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 01:09:57 +0300 Subject: [PATCH 40/66] Adds /viewpbchat to /acmds Adds the new /viewpbchat command to level 5 admin commands list. --- gamemodes/irresistible/cnr/commands/admin/_admin.pwn | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index a4eede9..5d519e8 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -163,6 +163,7 @@ static stock { 5, "/seteventhost", "Setting event host to player" }, { 5, "/weather", "Settings world weather" }, { 5, "/viewpolicechat", "Viewing the police radio/chat" }, + { 5, "/viewpbchat", "Viewing all paintball lobbies chats" }, /* ** Level 6 Commands ** */ { 6, "/reloadeditor", "Reloads object editer script" }, From 097cece22460d81a1b79fe0152642ec9358014c6 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 01:11:00 +0300 Subject: [PATCH 41/66] viewpbchat command The command /viewpbchat, enables level 5 admins or higher to view pb lobby chats. --- .../irresistible/cnr/commands/admin/admin_five.pwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn index a423ef9..2013ba5 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn @@ -32,6 +32,18 @@ CMD:viewpolicechat( playerid, params[ ] ) return 1; } +CMD:viewpbchat( playerid, params[ ] ) +{ + if ( p_AdminLevel[ playerid ] < 5 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + p_TogglePBChat{ playerid } = !p_TogglePBChat{ playerid }; + + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s viewing paint-ball chat.", p_TogglePBChat{ playerid } == true ? ("toggled") : ("un-toggled") ); + if ( !IsPlayerUnderCover( playerid ) ) { + AddAdminLogLineFormatted( "%s(%d) has %s viewing paintball chat", ReturnPlayerName( playerid ), playerid, p_TogglePBChat{ playerid } == true ? ("toggled") : ("un-toggled") ); + } + return 1; +} + CMD:check( playerid, params[ ] ) { new From 3b36340f3e8a49ed8f937ccea9d53035a7785edc Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 01:11:26 +0300 Subject: [PATCH 42/66] Update for /viewpbchat Sends a message to all admins who are viewing pb chats. --- gamemodes/irresistible/cnr/features/paintball.pwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamemodes/irresistible/cnr/features/paintball.pwn b/gamemodes/irresistible/cnr/features/paintball.pwn index 54b10a4..a35c8d7 100644 --- a/gamemodes/irresistible/cnr/features/paintball.pwn +++ b/gamemodes/irresistible/cnr/features/paintball.pwn @@ -417,6 +417,10 @@ CMD:p( playerid, params[ ] ) else { SendClientMessageToPaintball( id, -1, ""COL_GREY" %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, msg ); + + foreach ( new i : Player ) if ( ( p_AdminLevel[ i ] >= 5 || IsPlayerUnderCover( i ) ) && p_TogglePBChat{ i } == true ) { + SendClientMessageFormatted( i, -1, ""COL_GREY" %s(%d):"COL_WHITE" %s", id, ReturnPlayerName( playerid ), playerid, msg ); + } } return 1; } From cbfc056bafeb9c76b312724d5b155dd31b157df6 Mon Sep 17 00:00:00 2001 From: Dusan Date: Sun, 2 Jun 2019 00:31:48 +0200 Subject: [PATCH 43/66] VIP Reformated - /vipcmds modified to match ones in /cmds - /vipcmds moved to msgbox instead of tablist - /vip now displays all available packages, once you click on one it will show you details about it, if you click on "Buy" it will redirect to IC Market - --- gamemodes/irresistible/cnr/dialog_ids.pwn | 5 +- .../cnr/features/vip/coin_market.pwn | 299 ++++++++++++------ gamemodes/sf-cnr.pwn | 12 +- 3 files changed, 216 insertions(+), 100 deletions(-) diff --git a/gamemodes/irresistible/cnr/dialog_ids.pwn b/gamemodes/irresistible/cnr/dialog_ids.pwn index 0b04cb6..5a26af0 100644 --- a/gamemodes/irresistible/cnr/dialog_ids.pwn +++ b/gamemodes/irresistible/cnr/dialog_ids.pwn @@ -210,8 +210,9 @@ #define DIALOG_COMPONENTS_SELL 1200 #define DIALOG_HOUSE_SELL 1201 #define DIALOG_BUSINESS_SELL_CONFIRM 1202 -#define DIALOG_NEXT_PAGE_VIP 1204 -#define DIALOG_XPMARKET_SELL 1205 +#define DIALOG_VIP_MAIN 1204 +#define DIALOG_XPMARKET_SELL 1205 +#define DIALOG_BUY_VIP_MAIN 1206 /* ** Hooks ** */ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) diff --git a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn index ad508f3..2bec13b 100644 --- a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn +++ b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn @@ -84,7 +84,9 @@ static stock }, p_CoinMarketPage [ MAX_PLAYERS char ], - p_CoinMarketSelectedItem [ MAX_PLAYERS char ] + p_CoinMarketSelectedItem [ MAX_PLAYERS char ], + + p_SelectedPackage [ MAX_PLAYERS char ] ; /* ** Global Variables ** */ @@ -116,6 +118,7 @@ hook OnPlayerUpdateEx( playerid ) hook OnPlayerDisconnect( playerid, reason ) { + p_SelectedPackage{ playerid } = -1; p_ExtraAssetSlots{ playerid } = 0; p_IrresistibleCoins[ playerid ] = 0.0; return 1; @@ -356,52 +359,204 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) } 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" ); } - else if ( dialogid == DIALOG_NEXT_PAGE_VIP && response ) + else if ( dialogid == DIALOG_VIP_MAIN && response ) { static - vip_description[ 1350 ]; + vip_description[ 1420 ]; - if ( vip_description[ 0 ] == '\0' ) + switch ( listitem ) { - vip_description = " \t"COL_PLATINUM"Platinum VIP\t"COL_DIAMOND"Diamond VIP\n"; - strcat( vip_description, ""COL_GREEN"Price (USD)\t"COL_GREEN"$50.00 USD\t"COL_GREEN"$100.00 USD\n" ); - strcat( vip_description, "Money Provided\t$12,500,000\t$25,000,000\n" ); - strcat( vip_description, "House Provided\tY\tY\n" ); - strcat( vip_description, "Vehicle Provided\tY\tY\n" ); - strcat( vip_description, "Garage Provided\tY\tY\n" ); - strcat( vip_description, "Gate Provided\tN\tY\n" ); - strcat( vip_description, "Weed Business Provided\tN\tY\n" ); - strcat( vip_description, "House Customization\tMedium\tLarge\n" ); - strcat( vip_description, "Total house slots\t10\tunlimited\n" ); - strcat( vip_description, "Total garage slots\t10\tunlimited\n" ); - strcat( vip_description, "Total business slots\t10\tunlimited\n" ); - strcat( vip_description, "Total vehicle slots\t10\t20\n" ); - strcat( vip_description, "Weapons on spawn\t2\t2\n" ); - strcat( vip_description, "Armour on spawn\t100%\t100%\n" ); - strcat( vip_description, "Coin generation increase\t10%\t25%\n" ); - strcat( vip_description, "Ability to transfer coins P2P\tY\tY\n" ); - strcat( vip_description, "Ability to sell coins on the coin market (/ic sell)\tY\tY\n" ); - strcat( vip_description, "Ability to use two jobs (/vipjob)\tY\tY\n" ); - strcat( vip_description, "Premium home listing fees waived\tY\tY\n" ); - strcat( vip_description, "Tax reduction\t0%\t50%\n" ); - strcat( vip_description, "Inactive asset protection\t14 days\t31 days\n" ); - strcat( vip_description, "Total Vehicle component editing slots\t8\t10\n" ); - strcat( vip_description, "Furniture slots available\t45\t50\n" ); - strcat( vip_description, "V.I.P Lounge Weapon Redeeming Cooldown\t1 min\tno limit\n" ); - strcat( vip_description, "V.I.P Tag On Forum\tY\tY\n" ); - strcat( vip_description, "Access to V.I.P chat\tY\tY\n" ); - strcat( vip_description, "Access to V.I.P lounge\tY\tY\n" ); - strcat( vip_description, "Can spawn with a specific skin\tY\tY\n" ); - strcat( vip_description, "Access to V.I.P toys\tY\tY\n" ); - strcat( vip_description, "Access to custom gang colors (/gangcolor)\tY\tY\n" ); - strcat( vip_description, "Access to extra house weapon storage slots\tY\tY\n" ); - strcat( vip_description, "Can play custom radio URLs (/radio)\tY\tY\n" ); - strcat( vip_description, "Ability to adjust your label's color (/labelcolor)\tY\tY\n" ); - strcat( vip_description, "Can show a message to people you kill (/deathmsg)\tY\tY\n" ); - strcat( vip_description, "Can adjust the sound of your hitmarker (/hitmarker)\tY\tY\n" ); + case 0: format( vip_description, sizeof( vip_description ), "\t{C0C0C0}Feature\t{C0C0C0}Reward\n"\ + "Money Provided\t{6EF83C}$25,000,000\n"\ + "House Provided\t{6EF83C}Yes\n"\ + "Vehicle Provided\t{6EF83C}Yes\n"\ + "Garage Provided\t{6EF83C}Yes\n"\ + "Gate Provided\t{6EF83C}Yes\n"\ + "Weed Business Provided\t{6EF83C}Yes\n"\ + "House Customization\t{6EF83C}Large\n"\ + "Total house slots\t{6EF83C}No limit\n"\ + "Total garage slots\t{6EF83C}No limit\n"\ + "Total business slots\t{6EF83C}No limit\n"\ + "Total vehicle slots\t{6EF83C}20\n"\ + "Weapons on spawn\t{6EF83C}3\n"\ + "Armour on spawn\t{6EF83C}Yes\n"\ + "Coin generation increase\t{6EF83C}25%%\n"\ + "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ + "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ + "Ability to use two jobs (/vipjob)\t{6EF83C}Yes\n"\ + "Premium home listing fees waived\t{6EF83C}Yes\n"\ + "Tax reduction\t{6EF83C}50%%\n"\ + "Inactive asset protection\t{6EF83C}30 days\n"\ + "Total Vehicle component editing slots\t{6EF83C}10\n"\ + "Furniture slots available\t{6EF83C}50\n"\ + "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}No limit\n"\ + "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ + "Access to V.I.P chat\t{6EF83C}Yes\n"\ + "Access to V.I.P lounge\t{6EF83C}Yes\n"\ + "Can spawn with a specific skin\t{6EF83C}Yes\n"\ + "Access to V.I.P toys\t{6EF83C}Yes\n"\ + "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ + "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ + "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ + "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ + "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ + "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}Yes" ); + + case 1: format( vip_description, sizeof( vip_description ), "\t{C0C0C0}Feature\t{C0C0C0}Reward\n"\ + "Money Provided\t{6EF83C}$12,500,000\n"\ + "House Provided\t{6EF83C}Yes\n"\ + "Vehicle Provided\t{6EF83C}Yes\n"\ + "Garage Provided\t{F81414}No\n"\ + "Gate Provided\t{F81414}No\n"\ + "Weed Business Provided\t{F81414}No\n"\ + "House Customization\t{6EF83C}Medium\n"\ + "Total house slots\t{6EF83C}10\n"\ + "Total garage slots\t{6EF83C}10\n"\ + "Total business slots\t{6EF83C}10\n"\ + "Total vehicle slots\t{6EF83C}10\n"\ + "Weapons on spawn\t{6EF83C}3\n"\ + "Armour on spawn\t{6EF83C}Yes\n"\ + "Coin generation increase\t{6EF83C}10%%\n"\ + "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ + "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ + "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ + "Premium home listing fees waived\t{6EF83C}Yes\n"\ + "Tax reduction\t{F81414}0%%\n"\ + "Inactive asset protection\t{6EF83C}14 days\n"\ + "Total Vehicle component editing slots\t{6EF83C}8\n"\ + "Furniture slots available\t{6EF83C}45\n"\ + "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}1 minutes\n"\ + "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ + "Access to V.I.P chat\t{6EF83C}Yes\n"\ + "Access to V.I.P lounge\t{6EF83C}Yes\n"\ + "Can spawn with a specific skin\t{6EF83C}Yes\n"\ + "Access to V.I.P toys\t{6EF83C}Yes\n"\ + "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ + "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ + "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ + "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ + "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ + "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}Yes" ); + + case 2: format( vip_description, sizeof( vip_description ), "\t{C0C0C0}Feature\t{C0C0C0}Reward\n"\ + "Money Provided\t{6EF83C}$5,000,000\n"\ + "House Provided\t{6EF83C}Yes\n"\ + "Vehicle Provided\t{6EF83C}Yes\n"\ + "Garage Provided\t{F81414}No\n"\ + "Gate Provided\t{F81414}No\n"\ + "Weed Business Provided\t{F81414}No\n"\ + "House Customization\t{6EF83C}Small\n"\ + "Total house slots\t{6EF83C}8\n"\ + "Total garage slots\t{6EF83C}8\n"\ + "Total business slots\t{6EF83C}8\n"\ + "Total vehicle slots\t{6EF83C}6\n"\ + "Weapons on spawn\t{6EF83C}2\n"\ + "Armour on spawn\t{6EF83C}Yes\n"\ + "Coin generation increase\t{F81414}0%%\n"\ + "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ + "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ + "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ + "Premium home listing fees waived\t{F81414}No\n"\ + "Tax reduction\t{F81414}0%%\n"\ + "Inactive asset protection\t{6EF83C}14 days\n"\ + "Total Vehicle component editing slots\t{6EF83C}6\n"\ + "Furniture slots available\t{6EF83C}40\n"\ + "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}5 minutes\n"\ + "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ + "Access to V.I.P chat\t{6EF83C}Yes\n"\ + "Access to V.I.P lounge\t{6EF83C}Yes\n"\ + "Can spawn with a specific skin\t{6EF83C}Yes\n"\ + "Access to V.I.P toys\t{6EF83C}Yes\n"\ + "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ + "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ + "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ + "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ + "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ + "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}Yes" ); + + case 3: format( vip_description, sizeof( vip_description ), "\t{C0C0C0}Feature\t{C0C0C0}Reward\n"\ + "Money Provided\t{6EF83C}$2,500,000\n"\ + "House Provided\t{F81414}No\n"\ + "Vehicle Provided\t{F81414}No\n"\ + "Garage Provided\t{F81414}No\n"\ + "Gate Provided\t{F81414}No\n"\ + "Weed Business Provided\t{F81414}No\n"\ + "House Customization\t{F81414}No\n"\ + "Total house slots\t{6EF83C}6\n"\ + "Total garage slots\t{6EF83C}6\n"\ + "Total business slots\t{6EF83C}6\n"\ + "Total vehicle slots\t{6EF83C}4\n"\ + "Weapons on spawn\t{6EF83C}1\n"\ + "Armour on spawn\t{F81414}No\n"\ + "Coin generation increase\t{F81414}0%%\n"\ + "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ + "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ + "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ + "Premium home listing fees waived\t{F81414}No\n"\ + "Tax reduction\t{F81414}0%%\n"\ + "Inactive asset protection\t{6EF83C}14 days\n"\ + "Total Vehicle component editing slots\t{6EF83C}4\n"\ + "Furniture slots available\t{6EF83C}35\n"\ + "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}5 minutes\n"\ + "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ + "Access to V.I.P chat\t{6EF83C}Yes\n"\ + "Access to V.I.P lounge\t{6EF83C}Yes\n"\ + "Can spawn with a specific skin\t{6EF83C}Yes\n"\ + "Access to V.I.P toys\t{6EF83C}Yes\n"\ + "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ + "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ + "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ + "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ + "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ + "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}Yes" ); + + case 4: format( vip_description, sizeof( vip_description ), "\t{C0C0C0}Feature\t{C0C0C0}Reward\n"\ + "Money Provided\t{6EF83C}$500,000\n"\ + "House Provided\t{F81414}No\n"\ + "Vehicle Provided\t{F81414}No\n"\ + "Garage Provided\t{F81414}No\n"\ + "Gate Provided\t{F81414}No\n"\ + "Weed Business Provided\t{F81414}No\n"\ + "House Customization\t{F81414}No\n"\ + "Total house slots\t{6EF83C}5\n"\ + "Total garage slots\t{6EF83C}5\n"\ + "Total business slots\t{6EF83C}5\n"\ + "Total vehicle slots\t{6EF83C}3\n"\ + "Weapons on spawn\t{6EF83C}1\n"\ + "Armour on spawn\t{F81414}No\n"\ + "Coin generation increase\t{F81414}0%%\n"\ + "Ability to transfer coins P2P\t{F81414}No\n"\ + "Ability to sell coins on the coin market (/ic sell)\t{F81414}No\n"\ + "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ + "Premium home listing fees waived\t{F81414}No\n"\ + "Tax reduction\t{F81414}0%%\n"\ + "Inactive asset protection\t{6EF83C}14 days\n"\ + "Total Vehicle component editing slots\t{6EF83C}3\n"\ + "Furniture slots available\t{6EF83C}30\n"\ + "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}5 minutes\n"\ + "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ + "Access to V.I.P chat\t{6EF83C}Yes\n"\ + "Access to V.I.P lounge\t{6EF83C}Yes\n"\ + "Can spawn with a specific skin\t{6EF83C}Yes\n"\ + "Access to V.I.P toys\t{6EF83C}Yes\n"\ + "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ + "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ + "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ + "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ + "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ + "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}Yes" ); } - return ShowPlayerDialog( playerid, DIALOG_BUY_VIP, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Donate for V.I.P", vip_description, "Buy VIP", "Close" ); + + ShowPlayerDialog( playerid, DIALOG_BUY_VIP_MAIN, DIALOG_STYLE_TABLIST_HEADERS, sprintf( "{FFDC2E}%s", g_irresistibleVipItems[ listitem ][ E_NAME ] ), vip_description, "Buy", "Back" ); + 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 ); + } + else if ( dialogid == DIALOG_BUY_VIP && response ) { return ShowPlayerCoinMarketDialog( playerid ); @@ -521,49 +676,8 @@ CMD:irresistiblecoins( playerid, params[ ] ) CMD:donate( playerid, params[ ] ) return cmd_vip( playerid, params ); CMD:vip( playerid, params[ ] ) { - static - vip_description[ 1420 ]; - - if ( vip_description[ 0 ] == '\0' ) - { - vip_description = " \t"COL_WHITE"Regular VIP\t"COL_BRONZE"Bronze VIP\t"COL_GOLD"Gold VIP\n"; - strcat( vip_description, ""COL_GREEN"Price (USD)\t"COL_GREEN"$5.00 USD\t"COL_GREEN"$15.00 USD\t"COL_GREEN"$25.00 USD\n" ); - strcat( vip_description, "Money Provided\t$500,000\t$2,500,000\t$5,000,000\n" ); - strcat( vip_description, "House Provided\tN\tY\tY\n" ); - strcat( vip_description, "Vehicle Provided\tN\tN\tY\n" ); - strcat( vip_description, "Garage Provided\tN\tN\tN\n" ); - strcat( vip_description, "Gate Provided\tN\tN\tN\n" ); - strcat( vip_description, "Weed Business Provided\tN\tN\tN\n" ); - strcat( vip_description, "House Customization\tN\tN\tSmall\n" ); - strcat( vip_description, "Total house slots\t5\t6\t8\n" ); - strcat( vip_description, "Total garage slots\t5\t6\t8\n" ); - strcat( vip_description, "Total business slots\t5\t6\t8\n" ); - strcat( vip_description, "Total vehicle slots\t3\t4\t6\n" ); - strcat( vip_description, "Weapons on spawn\t1\t1\t2\n" ); - strcat( vip_description, "Armour on spawn\t0%\t0%\t100%\n" ); - strcat( vip_description, "Coin generation increase\t0%\t0%\t0%\n" ); - strcat( vip_description, "Ability to transfer coins P2P\tN\tY\tY\n" ); - strcat( vip_description, "Ability to sell coins on the coin market (/ic sell)\tN\tY\tY\n" ); - strcat( vip_description, "Ability to use two jobs (/vipjob)\tN\tN\tN\n" ); - strcat( vip_description, "Premium home listing fees waived\tN\tN\tN\n" ); - strcat( vip_description, "Tax reduction\t0%\t0%\t0%\n" ); - strcat( vip_description, "Inactive asset protection\t14 days\t14 days\t14 days\n" ); - strcat( vip_description, "Total Vehicle component editing slots\t3\t4\t6\n" ); - strcat( vip_description, "Furniture slots available\t30\t35\t40\n" ); - strcat( vip_description, "V.I.P Lounge Weapon Redeeming Cooldown\t5 min\t5 min\t5 min\n" ); - strcat( vip_description, "V.I.P Tag On Forum\tY\tY\tY\n" ); - strcat( vip_description, "Access to V.I.P chat\tY\tY\tY\n" ); - strcat( vip_description, "Access to V.I.P lounge\tY\tY\tY\n" ); - strcat( vip_description, "Can spawn with a specific skin\tY\tY\tY\n" ); - strcat( vip_description, "Access to V.I.P toys\tY\tY\tY\n" ); - strcat( vip_description, "Access to custom gang colors (/gangcolor)\tY\tY\tY\n" ); - strcat( vip_description, "Access to extra house weapon storage slots\tY\tY\tY\n" ); - strcat( vip_description, "Can play custom radio URLs (/radio)\tY\tY\tY\n" ); - strcat( vip_description, "Ability to adjust your label's color (/labelcolor)\tY\tY\tY\n" ); - strcat( vip_description, "Can show a message to people you kill (/deathmsg)\tY\tY\tY\n" ); - strcat( vip_description, "Can adjust the sound of your hitmarker (/hitmarker)\tY\tY\tY\n" ); - } - ShowPlayerDialog( playerid, DIALOG_NEXT_PAGE_VIP, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Donate for V.I.P", vip_description, "See More", "Close" ); + p_SelectedPackage{ playerid } = -1; + ShowPlayerDialog( playerid, DIALOG_VIP_MAIN, DIALOG_STYLE_LIST, "{FFDC2E}VIP Packages", "{4EE2EC}Diamond VIP ($100.00 USD)\n{E0E0E0}Platinum VIP ($50.00 USD)\n{FFDC2E}Gold VIP ($25.00 USD)\n{CD7F32}Bronze VIP ($15.00 USD)\n{C0C0C0}Regular VIP ($5.00 USD)", "Select", "Close" ); return 1; } @@ -572,16 +686,15 @@ 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 ); - strcat( szLargeString, ""COL_GREY"/vipspawnwep\tConfigure your spawning weapons\n"\ - ""COL_GREY"/vipskin\tConfigure your spawning skin\n"\ - ""COL_GREY"/vipgun\tRedeem weapons or an armour vest from the gun locker\n"\ - ""COL_GREY"/vsay\tGlobal V.I.P Chat\n" ); - strcat( szLargeString, ""COL_GREY"/vipjob\tSet your secondary VIP job\n"\ - ""COL_GREY"/vippackage\tCustomize your VIP package name\n"\ - ""COL_GREY"/mynotes\tAccess your VIP notes and material\n"\ - ""COL_GREY"/mycustomizations\tAccess your house customization taxes" ); + strcat( szLargeString, ""COL_GREY"/vipspawnwep{FFFFFF} - Configure your spawning weapons\n"\ + ""COL_GREY"/vipskin{FFFFFF} - Configure your spawning skin\n"\ + ""COL_GREY"/viplist{FFFFFF} - A list of all online V.I.P. players.\n"\ + ""COL_GREY"/vipgun{FFFFFF} - Redeem weapons or an armour vest from the gun locker\n"\ + ""COL_GREY"/vsay{FFFFFF} - Global V.I.P Chat\n"\ + ""COL_GREY"/vipjob{FFFFFF} - Choose your V.I.P. job that allows you to have two jobs at once.\n"\ + ""COL_GREY"/mynotes{FFFFFF} - Access your VIP notes and material" ); - ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, "{FFFFFF}V.I.P Commands", szLargeString, "Okay", "" ); + ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, "{FFDC2E}V.I.P Commands", szLargeString, "Okay", "" ); return 1; } diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 693b46c..3517fa9 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5284,11 +5284,13 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { 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" ); 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" ); + strcat( szCMDS, ""COL_GREY"/vipspawnwep{FFFFFF} - Configure your spawning weapons\n"\ + ""COL_GREY"/vipskin{FFFFFF} - Configure your spawning skin\n"\ + ""COL_GREY"/viplist{FFFFFF} - A list of all online V.I.P. players.\n"\ + ""COL_GREY"/vipgun{FFFFFF} - Redeem weapons or an armour vest from the gun locker\n"\ + ""COL_GREY"/vsay{FFFFFF} - Global V.I.P Chat\n"\ + ""COL_GREY"/vipjob{FFFFFF} - Choose your V.I.P. job that allows you to have two jobs at once.\n"\ + ""COL_GREY"/mynotes{FFFFFF} - Access your VIP notes and material" ); ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, ""COL_GOLD"V.I.P. Commands", szCMDS, "Okay", "Back" ); } } From 37daa87f516f5b9119973759bba169b2f197c21f Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 11:44:32 +1000 Subject: [PATCH 44/66] add __cloudy_fishing_system def --- gamemodes/irresistible/cnr/static/server_vehicles.pwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/static/server_vehicles.pwn b/gamemodes/irresistible/cnr/static/server_vehicles.pwn index a47e081..7dc8902 100644 --- a/gamemodes/irresistible/cnr/static/server_vehicles.pwn +++ b/gamemodes/irresistible/cnr/static/server_vehicles.pwn @@ -418,7 +418,8 @@ static stock InitializeServerVehicles( ) SetVehicleVirtualWorld( tmpVariable, 31 ), LinkVehicleToInterior( tmpVariable, 9 ), SetVehicleParamsEx( tmpVariable, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF ); tmpVariable = AddStaticVehicle( 451, -1879.5490, -630.3375, 1002.1699, 318.5035, 1, 1 ); // white SetVehicleVirtualWorld( tmpVariable, 31 ), LinkVehicleToInterior( tmpVariable, 9 ), SetVehicleParamsEx( tmpVariable, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF ); - + + #if defined __cloudy_fishing_system // SF Fishing Boats AddStaticVehicle( 453, -2994.639892, 492.919006, 0.108999, 359.498992, -1, -1 ); AddStaticVehicle( 453, -2982.639892, 492.919006, -0.921999, 359.437011, -1, -1 ); @@ -426,6 +427,7 @@ static stock InitializeServerVehicles( ) AddStaticVehicle( 453, -2941.639892, 492.919006, -0.828999, 359.394989, -1, -1 ); AddStaticVehicle( 453, -2959.639892, 492.919006, -0.564000, 359.359985, -1, -1 ); AddStaticVehicle( 453, -2970.639892, 492.919006, -0.374000, 359.475006, -1, -1 ); + #endif // // // LAS VENTURAS // From 1d7e9e9f73e8bfd7e565d4c1b30e0cbd364aefde Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 12:01:03 +1000 Subject: [PATCH 45/66] remove debug msg for stock --- gamemodes/irresistible/cnr/features/stocks/stocks.pwn | 1 - 1 file changed, 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/stocks/stocks.pwn b/gamemodes/irresistible/cnr/features/stocks/stocks.pwn index 846d503..8dda332 100644 --- a/gamemodes/irresistible/cnr/features/stocks/stocks.pwn +++ b/gamemodes/irresistible/cnr/features/stocks/stocks.pwn @@ -416,7 +416,6 @@ thread StockMarket_InsertReport( stockid, Float: default_start_pool, Float: defa stockid, stockid ); mysql_tquery( dbHandle, szLargeString, "StockMarket_PanicSell", "d", stockid ); - print(szLargeString); } // full bankruptcy if a stock is $1 (UNTESTED!) From d7c0d7c2f4436ea5bbc57a179b35f6d5c3d16778 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 12:01:17 +1000 Subject: [PATCH 46/66] update hex color embeds with their defs --- .../cnr/features/vip/coin_market.pwn | 380 +++++++++--------- 1 file changed, 190 insertions(+), 190 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn index 2bec13b..6dd27eb 100644 --- a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn +++ b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn @@ -157,7 +157,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) p_CoinMarketPage{ playerid } = ICM_PAGE_DEFAULT; p_CoinMarketSelectedItem{ playerid } = listitem; - return ShowPlayerDialog( playerid, DIALOG_YOU_SURE_VIP, DIALOG_STYLE_MSGBOX, ""COL_GOLD"Irresistible Coin -{FFFFFF} Confirmation", sprintf( ""COL_WHITE"Are you sure that you want to spend %s IC?", number_format( iCoinRequirement, .decimals = 2 ) ), "Yes", "No" ); + 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" ); } } else if ( dialogid == DIALOG_IC_MARKET_2 || dialogid == DIALOG_IC_MARKET_3 ) @@ -178,7 +178,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) p_CoinMarketPage{ playerid } = ( dialogid == DIALOG_IC_MARKET_3 ) ? ICM_PAGE_CASHCARD : ICM_PAGE_ASSETS; p_CoinMarketSelectedItem{ playerid } = listitem; - return ShowPlayerDialog( playerid, DIALOG_YOU_SURE_VIP, DIALOG_STYLE_MSGBOX, ""COL_GOLD"Irresistible Coin -{FFFFFF} Confirmation", sprintf( ""COL_WHITE"Are you sure that you want to spend %s IC?", number_format( iCoinRequirement, .decimals = 2 ) ), "Yes", "No" ); + 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" ); } else if ( dialogid == DIALOG_YOU_SURE_VIP ) { @@ -366,188 +366,188 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) switch ( listitem ) { - case 0: format( vip_description, sizeof( vip_description ), "\t{C0C0C0}Feature\t{C0C0C0}Reward\n"\ - "Money Provided\t{6EF83C}$25,000,000\n"\ - "House Provided\t{6EF83C}Yes\n"\ - "Vehicle Provided\t{6EF83C}Yes\n"\ - "Garage Provided\t{6EF83C}Yes\n"\ - "Gate Provided\t{6EF83C}Yes\n"\ - "Weed Business Provided\t{6EF83C}Yes\n"\ - "House Customization\t{6EF83C}Large\n"\ - "Total house slots\t{6EF83C}No limit\n"\ - "Total garage slots\t{6EF83C}No limit\n"\ - "Total business slots\t{6EF83C}No limit\n"\ - "Total vehicle slots\t{6EF83C}20\n"\ - "Weapons on spawn\t{6EF83C}3\n"\ - "Armour on spawn\t{6EF83C}Yes\n"\ - "Coin generation increase\t{6EF83C}25%%\n"\ - "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ - "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ - "Ability to use two jobs (/vipjob)\t{6EF83C}Yes\n"\ - "Premium home listing fees waived\t{6EF83C}Yes\n"\ - "Tax reduction\t{6EF83C}50%%\n"\ - "Inactive asset protection\t{6EF83C}30 days\n"\ - "Total Vehicle component editing slots\t{6EF83C}10\n"\ - "Furniture slots available\t{6EF83C}50\n"\ - "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}No limit\n"\ - "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ - "Access to V.I.P chat\t{6EF83C}Yes\n"\ - "Access to V.I.P lounge\t{6EF83C}Yes\n"\ - "Can spawn with a specific skin\t{6EF83C}Yes\n"\ - "Access to V.I.P toys\t{6EF83C}Yes\n"\ - "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ - "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ - "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ - "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ - "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ - "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}Yes" ); + 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{C0C0C0}Feature\t{C0C0C0}Reward\n"\ - "Money Provided\t{6EF83C}$12,500,000\n"\ - "House Provided\t{6EF83C}Yes\n"\ - "Vehicle Provided\t{6EF83C}Yes\n"\ - "Garage Provided\t{F81414}No\n"\ - "Gate Provided\t{F81414}No\n"\ - "Weed Business Provided\t{F81414}No\n"\ - "House Customization\t{6EF83C}Medium\n"\ - "Total house slots\t{6EF83C}10\n"\ - "Total garage slots\t{6EF83C}10\n"\ - "Total business slots\t{6EF83C}10\n"\ - "Total vehicle slots\t{6EF83C}10\n"\ - "Weapons on spawn\t{6EF83C}3\n"\ - "Armour on spawn\t{6EF83C}Yes\n"\ - "Coin generation increase\t{6EF83C}10%%\n"\ - "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ - "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ - "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ - "Premium home listing fees waived\t{6EF83C}Yes\n"\ - "Tax reduction\t{F81414}0%%\n"\ - "Inactive asset protection\t{6EF83C}14 days\n"\ - "Total Vehicle component editing slots\t{6EF83C}8\n"\ - "Furniture slots available\t{6EF83C}45\n"\ - "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}1 minutes\n"\ - "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ - "Access to V.I.P chat\t{6EF83C}Yes\n"\ - "Access to V.I.P lounge\t{6EF83C}Yes\n"\ - "Can spawn with a specific skin\t{6EF83C}Yes\n"\ - "Access to V.I.P toys\t{6EF83C}Yes\n"\ - "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ - "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ - "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ - "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ - "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ - "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}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{C0C0C0}Feature\t{C0C0C0}Reward\n"\ - "Money Provided\t{6EF83C}$5,000,000\n"\ - "House Provided\t{6EF83C}Yes\n"\ - "Vehicle Provided\t{6EF83C}Yes\n"\ - "Garage Provided\t{F81414}No\n"\ - "Gate Provided\t{F81414}No\n"\ - "Weed Business Provided\t{F81414}No\n"\ - "House Customization\t{6EF83C}Small\n"\ - "Total house slots\t{6EF83C}8\n"\ - "Total garage slots\t{6EF83C}8\n"\ - "Total business slots\t{6EF83C}8\n"\ - "Total vehicle slots\t{6EF83C}6\n"\ - "Weapons on spawn\t{6EF83C}2\n"\ - "Armour on spawn\t{6EF83C}Yes\n"\ - "Coin generation increase\t{F81414}0%%\n"\ - "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ - "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ - "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ - "Premium home listing fees waived\t{F81414}No\n"\ - "Tax reduction\t{F81414}0%%\n"\ - "Inactive asset protection\t{6EF83C}14 days\n"\ - "Total Vehicle component editing slots\t{6EF83C}6\n"\ - "Furniture slots available\t{6EF83C}40\n"\ - "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}5 minutes\n"\ - "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ - "Access to V.I.P chat\t{6EF83C}Yes\n"\ - "Access to V.I.P lounge\t{6EF83C}Yes\n"\ - "Can spawn with a specific skin\t{6EF83C}Yes\n"\ - "Access to V.I.P toys\t{6EF83C}Yes\n"\ - "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ - "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ - "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ - "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ - "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ - "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}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{C0C0C0}Feature\t{C0C0C0}Reward\n"\ - "Money Provided\t{6EF83C}$2,500,000\n"\ - "House Provided\t{F81414}No\n"\ - "Vehicle Provided\t{F81414}No\n"\ - "Garage Provided\t{F81414}No\n"\ - "Gate Provided\t{F81414}No\n"\ - "Weed Business Provided\t{F81414}No\n"\ - "House Customization\t{F81414}No\n"\ - "Total house slots\t{6EF83C}6\n"\ - "Total garage slots\t{6EF83C}6\n"\ - "Total business slots\t{6EF83C}6\n"\ - "Total vehicle slots\t{6EF83C}4\n"\ - "Weapons on spawn\t{6EF83C}1\n"\ - "Armour on spawn\t{F81414}No\n"\ - "Coin generation increase\t{F81414}0%%\n"\ - "Ability to transfer coins P2P\t{6EF83C}Yes\n"\ - "Ability to sell coins on the coin market (/ic sell)\t{6EF83C}Yes\n"\ - "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ - "Premium home listing fees waived\t{F81414}No\n"\ - "Tax reduction\t{F81414}0%%\n"\ - "Inactive asset protection\t{6EF83C}14 days\n"\ - "Total Vehicle component editing slots\t{6EF83C}4\n"\ - "Furniture slots available\t{6EF83C}35\n"\ - "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}5 minutes\n"\ - "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ - "Access to V.I.P chat\t{6EF83C}Yes\n"\ - "Access to V.I.P lounge\t{6EF83C}Yes\n"\ - "Can spawn with a specific skin\t{6EF83C}Yes\n"\ - "Access to V.I.P toys\t{6EF83C}Yes\n"\ - "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ - "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ - "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ - "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ - "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ - "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}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{C0C0C0}Feature\t{C0C0C0}Reward\n"\ - "Money Provided\t{6EF83C}$500,000\n"\ - "House Provided\t{F81414}No\n"\ - "Vehicle Provided\t{F81414}No\n"\ - "Garage Provided\t{F81414}No\n"\ - "Gate Provided\t{F81414}No\n"\ - "Weed Business Provided\t{F81414}No\n"\ - "House Customization\t{F81414}No\n"\ - "Total house slots\t{6EF83C}5\n"\ - "Total garage slots\t{6EF83C}5\n"\ - "Total business slots\t{6EF83C}5\n"\ - "Total vehicle slots\t{6EF83C}3\n"\ - "Weapons on spawn\t{6EF83C}1\n"\ - "Armour on spawn\t{F81414}No\n"\ - "Coin generation increase\t{F81414}0%%\n"\ - "Ability to transfer coins P2P\t{F81414}No\n"\ - "Ability to sell coins on the coin market (/ic sell)\t{F81414}No\n"\ - "Ability to use two jobs (/vipjob)\t{F81414}No\n"\ - "Premium home listing fees waived\t{F81414}No\n"\ - "Tax reduction\t{F81414}0%%\n"\ - "Inactive asset protection\t{6EF83C}14 days\n"\ - "Total Vehicle component editing slots\t{6EF83C}3\n"\ - "Furniture slots available\t{6EF83C}30\n"\ - "V.I.P Lounge Weapon Redeeming Cooldown\t{6EF83C}5 minutes\n"\ - "V.I.P Tag On Forum\t{6EF83C}Yes\n"\ - "Access to V.I.P chat\t{6EF83C}Yes\n"\ - "Access to V.I.P lounge\t{6EF83C}Yes\n"\ - "Can spawn with a specific skin\t{6EF83C}Yes\n"\ - "Access to V.I.P toys\t{6EF83C}Yes\n"\ - "Access to custom gang colors (/gangcolor)\t{6EF83C}Yes\n"\ - "Access to extra house weapon storage slots\t{6EF83C}Yes\n"\ - "Can play custom radio URLs (/radio)\t{6EF83C}Yes\n"\ - "Ability to adjust your label's color (/labelcolor)\t{6EF83C}Yes\n"\ - "Can show a message to people you kill (/deathmsg)\t{6EF83C}Yes\n"\ - "Can adjust the sound of your hitmarker (/hitmarker)\t{6EF83C}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" ); } - ShowPlayerDialog( playerid, DIALOG_BUY_VIP_MAIN, DIALOG_STYLE_TABLIST_HEADERS, sprintf( "{FFDC2E}%s", g_irresistibleVipItems[ listitem ][ E_NAME ] ), vip_description, "Buy", "Back" ); + ShowPlayerDialog( playerid, DIALOG_BUY_VIP_MAIN, DIALOG_STYLE_TABLIST_HEADERS, sprintf( ""COL_GOLD"%s", g_irresistibleVipItems[ listitem ][ E_NAME ] ), vip_description, "Buy", "Back" ); return 1; } else if ( dialogid == DIALOG_BUY_VIP_MAIN ) @@ -677,7 +677,7 @@ CMD:donate( playerid, params[ ] ) return cmd_vip( playerid, params ); CMD:vip( playerid, params[ ] ) { p_SelectedPackage{ playerid } = -1; - ShowPlayerDialog( playerid, DIALOG_VIP_MAIN, DIALOG_STYLE_LIST, "{FFDC2E}VIP Packages", "{4EE2EC}Diamond VIP ($100.00 USD)\n{E0E0E0}Platinum VIP ($50.00 USD)\n{FFDC2E}Gold VIP ($25.00 USD)\n{CD7F32}Bronze VIP ($15.00 USD)\n{C0C0C0}Regular VIP ($5.00 USD)", "Select", "Close" ); + 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" ); return 1; } @@ -686,15 +686,15 @@ 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 ); - strcat( szLargeString, ""COL_GREY"/vipspawnwep{FFFFFF} - Configure your spawning weapons\n"\ - ""COL_GREY"/vipskin{FFFFFF} - Configure your spawning skin\n"\ - ""COL_GREY"/viplist{FFFFFF} - A list of all online V.I.P. players.\n"\ - ""COL_GREY"/vipgun{FFFFFF} - Redeem weapons or an armour vest from the gun locker\n"\ - ""COL_GREY"/vsay{FFFFFF} - Global V.I.P Chat\n"\ - ""COL_GREY"/vipjob{FFFFFF} - Choose your V.I.P. job that allows you to have two jobs at once.\n"\ - ""COL_GREY"/mynotes{FFFFFF} - Access your VIP notes and material" ); + 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, "{FFDC2E}V.I.P Commands", szLargeString, "Okay", "" ); + ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"V.I.P Commands", szLargeString, "Okay", "" ); return 1; } @@ -726,7 +726,7 @@ stock ShowPlayerCoinMarketDialog( playerid, page = ICM_PAGE_DEFAULT ) strcat( szMarket, ""COL_GREEN"Buy shark cards...\t"COL_GREEN">>>\n" ); strcat( szMarket, ""COL_PURPLE"Buy premium homes...\t"COL_PURPLE">>>\n" ); strcat( szMarket, ""COL_GREY"See other items...\t"COL_GREY">>>" ); - return ShowPlayerDialog( playerid, DIALOG_IC_MARKET, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -{FFFFFF} Market", szMarket, "Select", "" ); + return ShowPlayerDialog( playerid, DIALOG_IC_MARKET, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Market", szMarket, "Select", "" ); } else if ( page == ICM_PAGE_CASHCARD ) { @@ -737,7 +737,7 @@ stock ShowPlayerCoinMarketDialog( playerid, page = ICM_PAGE_DEFAULT ) 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 ) ); } - return ShowPlayerDialog( playerid, DIALOG_IC_MARKET_3, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -{FFFFFF} Cash Cards", szMarket, "Select", "Back" ); + return ShowPlayerDialog( playerid, DIALOG_IC_MARKET_3, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Cash Cards", szMarket, "Select", "Back" ); } else { @@ -746,7 +746,7 @@ stock ShowPlayerCoinMarketDialog( playerid, page = ICM_PAGE_DEFAULT ) 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 ) ); } - return ShowPlayerDialog( playerid, DIALOG_IC_MARKET_2, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -{FFFFFF} Asset Market", szMarket, "Select", "Back" ); + return ShowPlayerDialog( playerid, DIALOG_IC_MARKET_2, DIALOG_STYLE_TABLIST_HEADERS, ""COL_GOLD"Irresistible Coin -"COL_WHITE" Asset Market", szMarket, "Select", "Back" ); } } From 0491f4eb9f6da85c0deb5e071ddd47d09b0461ea Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 12:30:16 +1000 Subject: [PATCH 47/66] fix slot spamming win msg --- .../irresistible/cnr/features/visage/blackjack.pwn | 6 ++---- .../irresistible/cnr/features/visage/roulette.pwn | 6 ++---- .../irresistible/cnr/features/visage/slot_machines.pwn | 10 ++++------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn index d644acc..4bdf0c5 100644 --- a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn +++ b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn @@ -627,10 +627,8 @@ 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 ); - 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 ) ); + foreach ( new i : Player ) if ( ! IsPlayerSettingToggled( i, SETTING_HIDE_GAMB_MSG ) ) { + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); } } } diff --git a/gamemodes/irresistible/cnr/features/visage/roulette.pwn b/gamemodes/irresistible/cnr/features/visage/roulette.pwn index 7d8c56a..188c946 100644 --- a/gamemodes/irresistible/cnr/features/visage/roulette.pwn +++ b/gamemodes/irresistible/cnr/features/visage/roulette.pwn @@ -686,10 +686,8 @@ public OnRouletteWheelStop( rouletteid, winner ) // inform users if ( profit >= 10000 ) { - 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 ) ); + foreach ( new i : Player ) if ( ! IsPlayerSettingToggled( i, SETTING_HIDE_GAMB_MSG ) ) { + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); } } diff --git a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn index fd7c0e2..adfe253 100644 --- a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn +++ b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn @@ -287,13 +287,11 @@ 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" ) ) ); - 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" ) ) ); + // 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" ) ) ); + foreach ( new i : Player ) if ( ! IsPlayerSettingToggled( i, SETTING_HIDE_GAMB_MSG ) ) { + 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 { + } else { SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", cash_format( iNetWin ) ); } From 2a5fdb24e0b25bec679fda86541ca6fe948c1b8e Mon Sep 17 00:00:00 2001 From: Stev Date: Sun, 2 Jun 2019 07:23:04 +0100 Subject: [PATCH 48/66] remove pointless variable --- gamemodes/irresistible/cnr/features/minijobs/mining.pwn | 1 - 1 file changed, 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index ada9bd3..e79a19b 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -44,7 +44,6 @@ static stock g_orePrices [ ] = { 675, 900, 600, 2750, 3000, 3500, 4000, 2200, 2300, 1200 }, g_oreMiningTime [ ] = { 2000, 2800, 1600, 6800, 7200, 7600, 8000, 6400, 6560, 4000 }, g_oreQuanities [ ] = { 8, 8, 8, 8, 5, 3, 3, 5, 5, 6 }, - g_oreProbability [ ] = { 85, 80, 90, 45, 35, 30, 25, 52, 30, 75 }, // Iterator Iterator: miningrock < MAX_ROCKS > From 53f366c1f8f33493f7817cab92e7848bdb7a8c0c Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 16:29:45 +1000 Subject: [PATCH 49/66] revert mining chances code --- .../cnr/features/minijobs/mining.pwn | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index e79a19b..75b59ac 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -155,17 +155,22 @@ hook OnProgressCompleted( playerid, progressid, params ) if ( progressid == PROGRESS_MINING ) { new m = p_MiningOre{ playerid }; - new iRandom = random( 100 ); + new iRandom = random( 101 ); p_isMining{ playerid } = false; g_miningData[ m ] [ E_MINING ] = INVALID_PLAYER_ID; - new Float: random_chance = fRandomEx( 0.0, 101.0 ); - - random_chance += GetPlayerLevel( playerid, E_ROLEPLAY ) * 0.2; - - // potential for a 20% success rate - if ( random_chance < 20.0 ) + if ( ( g_miningData[ m ] [ E_ORE ] == ORE_IRON && iRandom > 80 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_BAUXITE && iRandom > 85 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_GOLD && iRandom > 45 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_COAL && iRandom > 90 || + ( g_miningData[ m ] [ E_ORE ] == ORE_DIAMOND && iRandom > 30 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_RUBY && iRandom > 35 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_SAPHHIRE && iRandom > 30 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_EMERALD && iRandom > 52 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_PLATINUM && iRandom > 25 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_AMETHYST && iRandom > 75 ) ) + ) { SetPlayerMineOre( playerid, m ); return SendError( playerid, "You did not find any ore. Mining again." ); From 7a7aaabeeefced48fb8dbac35d711e5e1690ff3a Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 16:35:56 +1000 Subject: [PATCH 50/66] increase success rate parallel to the player roleplay level --- .../cnr/features/minijobs/mining.pwn | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index 75b59ac..14bdee6 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -155,21 +155,24 @@ hook OnProgressCompleted( playerid, progressid, params ) if ( progressid == PROGRESS_MINING ) { new m = p_MiningOre{ playerid }; - new iRandom = random( 101 ); + new Float: iRandom = fRandomEx( 0.0, 100.0 ); + + // increase success rate parallel to the player roleplay level + iRandom *= 1.0 + ( GetPlayerLevel( playerid, E_ROLEPLAY ) / 100.0 ); p_isMining{ playerid } = false; g_miningData[ m ] [ E_MINING ] = INVALID_PLAYER_ID; - if ( ( g_miningData[ m ] [ E_ORE ] == ORE_IRON && iRandom > 80 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_BAUXITE && iRandom > 85 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_GOLD && iRandom > 45 ) || + if ( ( g_miningData[ m ] [ E_ORE ] == ORE_IRON && iRandom > 80.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_BAUXITE && iRandom > 85.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_GOLD && iRandom > 45.0 ) || ( g_miningData[ m ] [ E_ORE ] == ORE_COAL && iRandom > 90 || - ( g_miningData[ m ] [ E_ORE ] == ORE_DIAMOND && iRandom > 30 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_RUBY && iRandom > 35 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_SAPHHIRE && iRandom > 30 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_EMERALD && iRandom > 52 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_PLATINUM && iRandom > 25 ) || - ( g_miningData[ m ] [ E_ORE ] == ORE_AMETHYST && iRandom > 75 ) ) + ( g_miningData[ m ] [ E_ORE ] == ORE_DIAMOND && iRandom > 30.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_RUBY && iRandom > 35.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_SAPHHIRE && iRandom > 30.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_EMERALD && iRandom > 52.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_PLATINUM && iRandom > 25.0 ) || + ( g_miningData[ m ] [ E_ORE ] == ORE_AMETHYST && iRandom > 75.0 ) ) ) { SetPlayerMineOre( playerid, m ); @@ -209,7 +212,7 @@ hook OnPlayerEnterDynamicCP( playerid, checkpointid ) new earned_money = floatround( float( g_orePrices[ g_miningData[ ore ] [ E_ORE ] ] ) * 0.5 ); - GivePlayerExperience( playerid, E_ROLEPLAY ); + GivePlayerExperience( playerid, E_ROLEPLAY, 0.5 ); GivePlayerCash( playerid, earned_money ); StockMarket_UpdateEarnings( E_STOCK_MINING_COMPANY, earned_money, 0.5 ); SendServerMessage( playerid, "You have crushed a "COL_GREY"%s"COL_WHITE" Ore and earned "COL_GOLD"%s"COL_WHITE".", getOreName( g_miningData[ ore ] [ E_ORE ] ), cash_format( earned_money ) ); From aedabe2d6b7675a6524f93bc059704b4fe05f3f0 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 16:50:57 +1000 Subject: [PATCH 51/66] give mining xp for mining the rock --- gamemodes/irresistible/cnr/features/minijobs/mining.pwn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index 14bdee6..b4b4dc5 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -43,6 +43,7 @@ static stock g_orePrices [ ] = { 675, 900, 600, 2750, 3000, 3500, 4000, 2200, 2300, 1200 }, g_oreMiningTime [ ] = { 2000, 2800, 1600, 6800, 7200, 7600, 8000, 6400, 6560, 4000 }, + Float: g_oreMiningXp [ ] = { 0.5, 0.7, 0.4, 1.7, 1.8, 1.9, 2.0, 1.6, 1.64, 1.0 }, g_oreQuanities [ ] = { 8, 8, 8, 8, 5, 3, 3, 5, 5, 6 }, // Iterator @@ -191,7 +192,7 @@ hook OnProgressCompleted( playerid, progressid, params ) SendServerMessage( playerid, "Great you've mined an ore, now store it in a "COL_GREY"Dune"COL_WHITE"." ); } - //GivePlayerExperience( playerid, E_MINING ); + GivePlayerExperience( playerid, E_ROLEPLAY, g_oreMiningXp[ g_miningData[ m ] [ E_ORE ] ] ); SetPVarInt( playerid, "carrying_ore", m ); SetPlayerSpecialAction( playerid, SPECIAL_ACTION_CARRY ); SetPlayerAttachedObject( playerid, 4, 2936, 5, 0.000000, 0.197999, 0.133999, 113.099983, -153.799987, 57.300003, 0.631000, 0.597000, 0.659999, g_miningData[ m ] [ E_ARGB ], g_miningData[ m ] [ E_ARGB ] ); @@ -212,7 +213,7 @@ hook OnPlayerEnterDynamicCP( playerid, checkpointid ) new earned_money = floatround( float( g_orePrices[ g_miningData[ ore ] [ E_ORE ] ] ) * 0.5 ); - GivePlayerExperience( playerid, E_ROLEPLAY, 0.5 ); + GivePlayerExperience( playerid, E_ROLEPLAY, 0.2 ); GivePlayerCash( playerid, earned_money ); StockMarket_UpdateEarnings( E_STOCK_MINING_COMPANY, earned_money, 0.5 ); SendServerMessage( playerid, "You have crushed a "COL_GREY"%s"COL_WHITE" Ore and earned "COL_GOLD"%s"COL_WHITE".", getOreName( g_miningData[ ore ] [ E_ORE ] ), cash_format( earned_money ) ); From 0354ee75de97b3753171749cb0f0e5d143439ca9 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 16:58:35 +1000 Subject: [PATCH 52/66] -- update changelog --- scriptfiles/changelogs/cnr/_changelogs.cfg | 1 + scriptfiles/changelogs/cnr/v11.65.200.txt | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 scriptfiles/changelogs/cnr/v11.65.200.txt diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index 9cabed4..20b7bd5 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -1,3 +1,4 @@ +v11.65.200 v11.60.190 v11.57.188 v11.56.186 diff --git a/scriptfiles/changelogs/cnr/v11.65.200.txt b/scriptfiles/changelogs/cnr/v11.65.200.txt new file mode 100644 index 0000000..858ea50 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.65.200.txt @@ -0,0 +1,9 @@ +(+) Level 5 admins cannot create houses/cars/garages/businesses without a note being used. +(+) Adds CAC mode and new locations for the duel system (Stev). +(+) Adds /givearmour for level 5s (Nemesis). +(+) Adds roleplay level. Get benefits to minijobs by levelling it up. E.g. higher success mining. +(/) Inactive accounts will get removed now after 1 year. +(/) Oldschool class selection has been restored. +(/) "/vip" has been reformatted (Night). +(*) Fix global message spam with slot machines. +(*) Fix issue with features being shown and unavoidable on register. \ No newline at end of file From fba9840a57a62b2902279ce91730626456824a3b Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 17:10:13 +1000 Subject: [PATCH 53/66] fix typo --- gamemodes/irresistible/cnr/features/vip/coin_market.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn index 6dd27eb..31d8f3b 100644 --- a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn +++ b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn @@ -677,7 +677,7 @@ CMD:donate( playerid, params[ ] ) return cmd_vip( playerid, params ); CMD:vip( playerid, params[ ] ) { p_SelectedPackage{ playerid } = -1; - 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" ); + 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" ); return 1; } From a8d55d9c6c73784baa175340f65f46ef311815fa Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 17:10:29 +1000 Subject: [PATCH 54/66] nerf mining xp per rock --- gamemodes/irresistible/cnr/features/minijobs/mining.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index b4b4dc5..c6508a7 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -43,7 +43,7 @@ static stock g_orePrices [ ] = { 675, 900, 600, 2750, 3000, 3500, 4000, 2200, 2300, 1200 }, g_oreMiningTime [ ] = { 2000, 2800, 1600, 6800, 7200, 7600, 8000, 6400, 6560, 4000 }, - Float: g_oreMiningXp [ ] = { 0.5, 0.7, 0.4, 1.7, 1.8, 1.9, 2.0, 1.6, 1.64, 1.0 }, + Float: g_oreMiningXp [ ] = { 0.25, 0.35, 0.2, 0.85, 0.9, 0.8, 1.0, 0.8, 0.82, 0.5 }, g_oreQuanities [ ] = { 8, 8, 8, 8, 5, 3, 3, 5, 5, 6 }, // Iterator From 5de5f6bf347a9ff2d2bd62bc21a0d89029ba7ada Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 2 Jun 2019 17:11:23 +1000 Subject: [PATCH 55/66] nerf rp experience sell value a bit --- gamemodes/irresistible/cnr/features/player/experience.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/player/experience.pwn b/gamemodes/irresistible/cnr/features/player/experience.pwn index d1aa8a1..7769837 100644 --- a/gamemodes/irresistible/cnr/features/player/experience.pwn +++ b/gamemodes/irresistible/cnr/features/player/experience.pwn @@ -54,7 +54,7 @@ static const { "Police", 0x3E7EFFFF, 7500.0, 20.0, 10.0 }, // 7.5k arrests { "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30k robberies { "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 }, // 75k kills - { "Roleplay", 0x33FF50FF, 75000.0, 10.0, 12.0 } // 75k minijob + { "Roleplay", 0x33FF50FF, 75000.0, 10.0, 5.0 } // 75k minijob /* { "Fireman", 10000.0, 9.0 }, // 10k fires From 1a7b45c0d6bccb98fdb66707fe7ce15d28ffbc96 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 11:33:47 +0300 Subject: [PATCH 56/66] Adds fishing info pickup. --- gamemodes/irresistible/cnr/features/info_pickups.pwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/info_pickups.pwn b/gamemodes/irresistible/cnr/features/info_pickups.pwn index 81901f2..b182297 100644 --- a/gamemodes/irresistible/cnr/features/info_pickups.pwn +++ b/gamemodes/irresistible/cnr/features/info_pickups.pwn @@ -26,7 +26,8 @@ static stock { -2767.3765, 1257.077, 11.7703, 0xFFFF, "{FFFFFF}You can mine ores and store your ores in dunes for exportation! Grab the spade and hit the ore!" }, // Mining { 1954.71890, 1038.251, 992.859, 0xFFFF, "{FFFFFF}Test out your luck on the slot machines, maybe you might win the mega jackpot!" }, // Slots { 1955.69070, 1005.167, 992.468, 0xFFFF, "{FFFFFF}Roulette can payout up to $3.5M! Single bets return 35x your money whereas outside bets can return 2x to 3x!" }, // Roulette - { 2085.5896, 1239.4589, 414.745, 0xFFFF, "{FFFFFF}Buy materials at a convience store and cook meth! Aim and shoot each ingredient to add them as you /meth cook!" } // Meth Cook + { 2085.5896, 1239.4589, 414.745, 0xFFFF, "{FFFFFF}Buy materials at a convience store and cook meth! Aim and shoot each ingredient to add them as you /meth cook!" }, // Meth Cook + { -2980.2500, 483.4584, 4.91030, 0xFFFF, "{FFFFFF}Get a boat and sail around the sea to get a fish every few seconds of sailing." } // Fishing } ; From e975e2a34c090d113da4d6cf41ce8f83e98dc282 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 11:57:23 +0300 Subject: [PATCH 57/66] Changed fishing location --- .../irresistible/cnr/static/server_vehicles.pwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gamemodes/irresistible/cnr/static/server_vehicles.pwn b/gamemodes/irresistible/cnr/static/server_vehicles.pwn index 7dc8902..4194d2d 100644 --- a/gamemodes/irresistible/cnr/static/server_vehicles.pwn +++ b/gamemodes/irresistible/cnr/static/server_vehicles.pwn @@ -421,12 +421,12 @@ static stock InitializeServerVehicles( ) #if defined __cloudy_fishing_system // SF Fishing Boats - AddStaticVehicle( 453, -2994.639892, 492.919006, 0.108999, 359.498992, -1, -1 ); - AddStaticVehicle( 453, -2982.639892, 492.919006, -0.921999, 359.437011, -1, -1 ); - AddStaticVehicle( 453, -2953.639892, 492.919006, -0.823000, 359.410003, -1, -1 ); - AddStaticVehicle( 453, -2941.639892, 492.919006, -0.828999, 359.394989, -1, -1 ); - AddStaticVehicle( 453, -2959.639892, 492.919006, -0.564000, 359.359985, -1, -1 ); - AddStaticVehicle( 453, -2970.639892, 492.919006, -0.374000, 359.475006, -1, -1 ); + AddStaticVehicle( 453, -1474.0452, 671.4551, -0.4139, 270.0, 56, 56 ); // + AddStaticVehicle( 453, -1474.0452, 678.4317, -0.1675, 270.0, 56, 56 ); // + AddStaticVehicle( 453, -1474.0452, 684.5461, -0.4814, 270.0, 56, 56 ); // + AddStaticVehicle( 453, -1474.0452, 690.5830, -0.1199, 270.0, 56, 56 ); // + AddStaticVehicle( 453, -1474.0452, 698.4171, -0.4731, 270.0, 56, 56 ); // + AddStaticVehicle( 453, -1474.0452, 704.5991, -0.4769, 270.0, 56, 56 ); // #endif // // From 71f6d1d6504912490f1dee8531b92776021082c8 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 12:03:58 +0300 Subject: [PATCH 58/66] Update info_pickups.pwn --- gamemodes/irresistible/cnr/features/info_pickups.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/info_pickups.pwn b/gamemodes/irresistible/cnr/features/info_pickups.pwn index b182297..ffb11d4 100644 --- a/gamemodes/irresistible/cnr/features/info_pickups.pwn +++ b/gamemodes/irresistible/cnr/features/info_pickups.pwn @@ -27,7 +27,7 @@ static stock { 1954.71890, 1038.251, 992.859, 0xFFFF, "{FFFFFF}Test out your luck on the slot machines, maybe you might win the mega jackpot!" }, // Slots { 1955.69070, 1005.167, 992.468, 0xFFFF, "{FFFFFF}Roulette can payout up to $3.5M! Single bets return 35x your money whereas outside bets can return 2x to 3x!" }, // Roulette { 2085.5896, 1239.4589, 414.745, 0xFFFF, "{FFFFFF}Buy materials at a convience store and cook meth! Aim and shoot each ingredient to add them as you /meth cook!" }, // Meth Cook - { -2980.2500, 483.4584, 4.91030, 0xFFFF, "{FFFFFF}Get a boat and sail around the sea to get a fish every few seconds of sailing." } // Fishing + { -1486.1608, 701.3732, 7.17900, 0xFFFF, "{FFFFFF}Get a boat and sail around the sea to get a fish every few seconds of sailing." } // Fishing } ; From ea2cda97d3f4bd0a0ba6469a0555ecee027a1a79 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 14:44:36 +0300 Subject: [PATCH 59/66] Ignores "quit to avoid" if player is in event --- gamemodes/sf-cnr.pwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 061821b..f2158d2 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -845,8 +845,12 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: return 1; // fcnpc // Cop shoots innocent, they /q - so jail + #if defined __cloudy_event_system + if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 && ! IsPlayerInEvent( playerid ) && ! IsPlayerInEvent( hitid ) ) + #else if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 ) p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3; + #endif if ( p_Class[ playerid ] == CLASS_POLICE && p_Class[ hitid ] != CLASS_POLICE && !p_WantedLevel[ hitid ] && GetPlayerState( hitid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) return ShowPlayerHelpDialog( playerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; From ca9af55c370ee28153e4119050931344eb295e21 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 14:48:04 +0300 Subject: [PATCH 60/66] Update sf-cnr.pwn --- gamemodes/sf-cnr.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index f2158d2..30a5d82 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -849,8 +849,8 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 && ! IsPlayerInEvent( playerid ) && ! IsPlayerInEvent( hitid ) ) #else if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 ) - p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3; #endif + p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3; if ( p_Class[ playerid ] == CLASS_POLICE && p_Class[ hitid ] != CLASS_POLICE && !p_WantedLevel[ hitid ] && GetPlayerState( hitid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) return ShowPlayerHelpDialog( playerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; From 80b252e9fbc2dfa7919c2d6e40fe15f5d5fc89a4 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 14:50:15 +0300 Subject: [PATCH 61/66] Fixes player quit to avoid No longer awards nearest cop is criminal is in event --- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 794754a..309c2bb 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -437,7 +437,11 @@ stock BreakPlayerCuffs( playerid ) stock AwardNearestLEO( playerid, reason ) { - if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || IsPlayerDead( playerid ) ) + #if defined __cloudy_event_system + if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 || IsPlayerInEvent( playerid ) ) + #else + if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 ) + #endif return false; new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker. @@ -500,4 +504,4 @@ hook OnPlayerUpdateEx( playerid ) } } return 1; -} \ No newline at end of file +} From eb318f0467128e6419c4d930cdd4d11fce886597 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 15:03:19 +0300 Subject: [PATCH 62/66] Event system related Criminals who engage with cops then leave the game are no longer considered quitting to avoid. --- gamemodes/irresistible/cnr/auth/account.pwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/auth/account.pwn b/gamemodes/irresistible/cnr/auth/account.pwn index ee6c95f..513f600 100644 --- a/gamemodes/irresistible/cnr/auth/account.pwn +++ b/gamemodes/irresistible/cnr/auth/account.pwn @@ -373,7 +373,11 @@ stock SavePlayerData( playerid, bool: logout = false ) new bool: bQuitToAvoid = false; + #if defined __cloudy_event_system + if ( ( IsPlayerCuffed( playerid ) || IsPlayerTazed( playerid ) || IsPlayerTied( playerid ) || p_LeftCuffed{ playerid } || p_QuitToAvoidTimestamp[ playerid ] > g_iTime ) && ! IsPlayerInEvent( playerid ) ) + #else if ( IsPlayerCuffed( playerid ) || IsPlayerTazed( playerid ) || IsPlayerTied( playerid ) || p_LeftCuffed{ playerid } || p_QuitToAvoidTimestamp[ playerid ] > g_iTime ) + #endif bQuitToAvoid = true; format( Query, sizeof( Query ), "UPDATE `USERS` SET `SCORE`=%d,`ADMINLEVEL`=%d,`OWNEDHOUSES`=%d,`KILLS`=%d,`DEATHS`=%d,`VIP_PACKAGE`=%d,`OWNEDCARS`=%d,`LASTLOGGED`=%d,`VIP_EXPIRE`=%d,`LAST_SKIN`=%d,`BURGLARIES`=%d,`UPTIME`=%d,`ARRESTS`=%d,`CITY`=%d,`METH`=%d,`SODA`=%d,`ACID`=%d,`GAS`=%d,", @@ -415,4 +419,4 @@ stock SavePlayerData( playerid, bool: logout = false ) stock GetPlayerAccountID( playerid ) return p_AccountID[ playerid ]; -stock IsPlayerLoggedIn( playerid ) return p_PlayerLogged{ playerid }; \ No newline at end of file +stock IsPlayerLoggedIn( playerid ) return p_PlayerLogged{ playerid }; From 5a750d91e9a1b85efa857e9831a75d9780a59a64 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 15:16:44 +0300 Subject: [PATCH 63/66] Update account.pwn --- gamemodes/irresistible/cnr/auth/account.pwn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gamemodes/irresistible/cnr/auth/account.pwn b/gamemodes/irresistible/cnr/auth/account.pwn index 513f600..908b75f 100644 --- a/gamemodes/irresistible/cnr/auth/account.pwn +++ b/gamemodes/irresistible/cnr/auth/account.pwn @@ -373,12 +373,13 @@ stock SavePlayerData( playerid, bool: logout = false ) new bool: bQuitToAvoid = false; - #if defined __cloudy_event_system - if ( ( IsPlayerCuffed( playerid ) || IsPlayerTazed( playerid ) || IsPlayerTied( playerid ) || p_LeftCuffed{ playerid } || p_QuitToAvoidTimestamp[ playerid ] > g_iTime ) && ! IsPlayerInEvent( playerid ) ) - #else if ( IsPlayerCuffed( playerid ) || IsPlayerTazed( playerid ) || IsPlayerTied( playerid ) || p_LeftCuffed{ playerid } || p_QuitToAvoidTimestamp[ playerid ] > g_iTime ) - #endif bQuitToAvoid = true; + + #if defined __cloudy_event_system + if ( IsPlayerInEvent( playerid ) ) + bQuitToAvoid = false; + #endif format( Query, sizeof( Query ), "UPDATE `USERS` SET `SCORE`=%d,`ADMINLEVEL`=%d,`OWNEDHOUSES`=%d,`KILLS`=%d,`DEATHS`=%d,`VIP_PACKAGE`=%d,`OWNEDCARS`=%d,`LASTLOGGED`=%d,`VIP_EXPIRE`=%d,`LAST_SKIN`=%d,`BURGLARIES`=%d,`UPTIME`=%d,`ARRESTS`=%d,`CITY`=%d,`METH`=%d,`SODA`=%d,`ACID`=%d,`GAS`=%d,", GetPlayerScore( playerid ), p_AdminLevel[ playerid ], From 928e6fba7b6337ba9e13cd9e775e1db4d7fef8e0 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 15:20:49 +0300 Subject: [PATCH 64/66] Update arrest.pwn --- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 309c2bb..fb79a6d 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -437,13 +437,14 @@ stock BreakPlayerCuffs( playerid ) stock AwardNearestLEO( playerid, reason ) { - #if defined __cloudy_event_system - if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 || IsPlayerInEvent( playerid ) ) - #else if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 ) - #endif return false; - + + #if defined __cloudy_event_system + if ( IsPlayerInEvent( playerid ) ) + return false; + #endif + new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker. new closestLEO = GetClosestPlayerEx( playerid, CLASS_POLICE, radius ); From f0e46849bf05b2511c54134acb6280586dd45c8e Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 15:22:53 +0300 Subject: [PATCH 65/66] Update sf-cnr.pwn --- gamemodes/sf-cnr.pwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 30a5d82..3298fe4 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -850,7 +850,9 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: #else if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 ) #endif + { p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3; + } if ( p_Class[ playerid ] == CLASS_POLICE && p_Class[ hitid ] != CLASS_POLICE && !p_WantedLevel[ hitid ] && GetPlayerState( hitid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) return ShowPlayerHelpDialog( playerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; From de946d243fce037876e56d2103b192766bc7ee5c Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Sun, 2 Jun 2019 15:26:38 +0300 Subject: [PATCH 66/66] Update arrest.pwn --- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index fb79a6d..36e56f9 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -437,7 +437,7 @@ stock BreakPlayerCuffs( playerid ) stock AwardNearestLEO( playerid, reason ) { - if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 ) + if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || IsPlayerDead( playerid ) ) return false; #if defined __cloudy_event_system