From 02f105c5c4a37b9a05140b6bccf50af50e9ef4d3 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 08:30:55 +0100 Subject: [PATCH 01/13] reformatted all dialog id's and ordered them --- .../cnr/commands/admin/_admin.pwn | 4 +-- gamemodes/irresistible/cnr/dialog_ids.pwn | 32 +++++++++++++++++++ gamemodes/irresistible/cnr/experience.pwn | 2 +- .../irresistible/cnr/features/cash_cards.pwn | 2 +- gamemodes/irresistible/cnr/features/duel.pwn | 16 +++++----- .../cnr/features/gangs/facilities.pwn | 6 ++-- .../cnr/features/houses/realestate.pwn | 4 +-- gamemodes/irresistible/cnr/features/pool.pwn | 2 +- .../cnr/features/visage/apartments.pwn | 14 ++++---- .../cnr/features/visage/fireworks.pwn | 4 +-- .../cnr/features/visage/poker.pwn | 4 +-- .../irresistible/cnr/vip/player_market.pwn | 4 +-- 12 files changed, 63 insertions(+), 31 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index 3539b2d..92a959b 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -12,8 +12,8 @@ #define ADMIN_COMMAND_REJECT "You don't have an appropriate administration level to use this command." #define ADMIN_COMMAND_TIME 4 -#define DIALOG_ADMIN_CMDS 1167 -#define DIALOG_ADMIN_CMDS_BACK 1168 +// #define DIALOG_ADMIN_CMDS 1167 +// #define DIALOG_ADMIN_CMDS_BACK 1168 /* ** Variables ** */ enum E_COMMAND_DATA diff --git a/gamemodes/irresistible/cnr/dialog_ids.pwn b/gamemodes/irresistible/cnr/dialog_ids.pwn index 08028ea..6375013 100644 --- a/gamemodes/irresistible/cnr/dialog_ids.pwn +++ b/gamemodes/irresistible/cnr/dialog_ids.pwn @@ -176,6 +176,38 @@ #define DIALOG_CROWDFUND_OPTIONS 1166 #define DIALOG_CROWDFUND_INFO 1167 #define DIALOG_CROWDFUND_DONATE 1168 +#define DIALOG_ADMIN_CMDS 1169 +#define DIALOG_ADMIN_CMDS_BACK 1170 +#define DIALOG_VIEW_LEVEL 1171 +#define DIALOG_CASH_CARD 1172 +#define DIALOG_DUEL 1173 +#define DIALOG_DUEL_PLAYER 1174 +#define DIALOG_DUEL_LOCATION 1175 +#define DIALOG_DUEL_WEAPON 1176 +#define DIALOG_DUEL_WAGER 1177 +#define DIALOG_DUEL_WEAPON_TWO 1178 +#define DIALOG_DUEL_HEALTH 1179 +#define DIALOG_DUEL_ARMOUR 1180 +#define DIALOG_POOL_WAGER 1181 +#define DIALOG_GANG_JOIN 1182 +#define DIALOG_FACILITY_AMMU 1183 +#define DIALOG_FACILITY_AMMU_BUY 1184 +#define DIALOG_HOUSE_LISTINGS 1185 +#define DIALOG_HOUSE_LIST_VIEW 1186 +#define DIALOG_VISAGE_APTS 1187 +#define DIALOG_VISAGE_APT_PW 1188 +#define DIALOG_VISAGE_APT_CONFIG 1189 +#define DIALOG_VISAGE_APT_TRANSFER 1190 +#define DIALOG_VISAGE_APT_TITLE 1191 +#define DIALOG_VISAGE_APT_PASSCODE 1192 +#define DIALOG_VISAGE_SPAWN 1193 +#define DIALOG_FIREWORKS 1194 +#define DIALOG_FIREWORKS_COLOR 1195 +#define DIALOG_BUY_IN 1196 +#define DIALOG_INPUT_RAISE 1197 +#define DIALOG_IC_SELLORDERS 1198 +#define DIALOG_IC_BUY 1199 + /* ** Hooks ** */ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) diff --git a/gamemodes/irresistible/cnr/experience.pwn b/gamemodes/irresistible/cnr/experience.pwn index eeb624c..1599f52 100644 --- a/gamemodes/irresistible/cnr/experience.pwn +++ b/gamemodes/irresistible/cnr/experience.pwn @@ -9,7 +9,7 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define DIALOG_VIEW_LEVEL 5943 +//#define DIALOG_VIEW_LEVEL 5943 /* ** Macros ** */ #define IsDoubleXP() ( GetGVarInt( "doublexp" ) ) diff --git a/gamemodes/irresistible/cnr/features/cash_cards.pwn b/gamemodes/irresistible/cnr/features/cash_cards.pwn index 9fd5e08..11d1389 100644 --- a/gamemodes/irresistible/cnr/features/cash_cards.pwn +++ b/gamemodes/irresistible/cnr/features/cash_cards.pwn @@ -8,7 +8,7 @@ /* ** Includes ** */ #include < YSI\y_hooks > -#define DIALOG_CASH_CARD 28373 +// #define DIALOG_CASH_CARD 28373 /* ** Commands ** */ CMD:redeemcashcard( playerid, params[ ] ) return cmd_cashcard( playerid, params ); diff --git a/gamemodes/irresistible/cnr/features/duel.pwn b/gamemodes/irresistible/cnr/features/duel.pwn index b86a724..039385e 100644 --- a/gamemodes/irresistible/cnr/features/duel.pwn +++ b/gamemodes/irresistible/cnr/features/duel.pwn @@ -11,14 +11,14 @@ /* ** 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 +// #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 diff --git a/gamemodes/irresistible/cnr/features/gangs/facilities.pwn b/gamemodes/irresistible/cnr/features/gangs/facilities.pwn index 08a55b0..28b6c11 100644 --- a/gamemodes/irresistible/cnr/features/gangs/facilities.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/facilities.pwn @@ -19,9 +19,9 @@ #define FACILITY_AMMU_RESPECT ( 75000.0 ) #define FACILITY_BLOWUP_TIME ( 10 ) -#define DIALOG_GANG_JOIN ( 9238 ) -#define DIALOG_FACILITY_AMMU ( 9239 ) -#define DIALOG_FACILITY_AMMU_BUY ( 9299 ) +// #define DIALOG_GANG_JOIN ( 9238 ) +// #define DIALOG_FACILITY_AMMU ( 9239 ) +// #define DIALOG_FACILITY_AMMU_BUY ( 9299 ) /* ** Variables ** */ enum E_GANG_FACILITIES diff --git a/gamemodes/irresistible/cnr/features/houses/realestate.pwn b/gamemodes/irresistible/cnr/features/houses/realestate.pwn index 3cd315c..3ba5d52 100644 --- a/gamemodes/irresistible/cnr/features/houses/realestate.pwn +++ b/gamemodes/irresistible/cnr/features/houses/realestate.pwn @@ -9,8 +9,8 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define DIALOG_HOUSE_LISTINGS 5838 -#define DIALOG_HOUSE_LIST_VIEW 5839 +// #define DIALOG_HOUSE_LISTINGS 5838 +// #define DIALOG_HOUSE_LIST_VIEW 5839 /* ** Macros ** */ #define ShowPlayerHomeListing(%0,%1) \ diff --git a/gamemodes/irresistible/cnr/features/pool.pwn b/gamemodes/irresistible/cnr/features/pool.pwn index ac7c4bc..5c56e4a 100644 --- a/gamemodes/irresistible/cnr/features/pool.pwn +++ b/gamemodes/irresistible/cnr/features/pool.pwn @@ -19,7 +19,7 @@ #define MAX_POOL_TABLES 32 #define MAX_POOL_BALLS (16) // do not modify -#define DIALOG_POOL_WAGER 3284 +//#define DIALOG_POOL_WAGER 3284 /* ** Macros ** */ #define SendPoolMessage(%0,%1) \ diff --git a/gamemodes/irresistible/cnr/features/visage/apartments.pwn b/gamemodes/irresistible/cnr/features/visage/apartments.pwn index 5b0afea..0108072 100644 --- a/gamemodes/irresistible/cnr/features/visage/apartments.pwn +++ b/gamemodes/irresistible/cnr/features/visage/apartments.pwn @@ -13,13 +13,13 @@ #define MAX_PASSCODE 5 // dialogs -#define DIALOG_VISAGE_APTS 17317 -#define DIALOG_VISAGE_APT_PW 17318 -#define DIALOG_VISAGE_APT_CONFIG 17319 -#define DIALOG_VISAGE_APT_TRANSFER 17320 -#define DIALOG_VISAGE_APT_TITLE 17321 -#define DIALOG_VISAGE_APT_PASSCODE 17322 -#define DIALOG_VISAGE_SPAWN 17333 +// #define DIALOG_VISAGE_APTS 17317 +// #define DIALOG_VISAGE_APT_PW 17318 +// #define DIALOG_VISAGE_APT_CONFIG 17319 +// #define DIALOG_VISAGE_APT_TRANSFER 17320 +// #define DIALOG_VISAGE_APT_TITLE 17321 +// #define DIALOG_VISAGE_APT_PASSCODE 17322 +// #define DIALOG_VISAGE_SPAWN 17333 /* ** Constants ** */ static const Float: VISAGE_APARTMENT_ENTRANCE[ 3 ] = { 2670.9922, 1637.9547, 1508.3590 }; diff --git a/gamemodes/irresistible/cnr/features/visage/fireworks.pwn b/gamemodes/irresistible/cnr/features/visage/fireworks.pwn index 8e94bc4..84c340f 100644 --- a/gamemodes/irresistible/cnr/features/visage/fireworks.pwn +++ b/gamemodes/irresistible/cnr/features/visage/fireworks.pwn @@ -9,8 +9,8 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define DIALOG_FIREWORKS 29383 -#define DIALOG_FIREWORKS_COLOR 29385 +// #define DIALOG_FIREWORKS 29383 +// #define DIALOG_FIREWORKS_COLOR 29385 // The maximum amount of firework instances that players can place, per server. (Default: 20) #define MAX_FIREWORK 20 diff --git a/gamemodes/irresistible/cnr/features/visage/poker.pwn b/gamemodes/irresistible/cnr/features/visage/poker.pwn index 5664a8d..7c01325 100644 --- a/gamemodes/irresistible/cnr/features/visage/poker.pwn +++ b/gamemodes/irresistible/cnr/features/visage/poker.pwn @@ -110,8 +110,8 @@ stock ShowPlayerDialogEx(playerid, dialogid, style, caption[], button1[], button #define CALL 2 #define RAISE 3 #define FOLD 4 -#define DIALOG_BUY_IN 19232 -#define DIALOG_INPUT_RAISE 9231 +// #define DIALOG_BUY_IN 19232 +// #define DIALOG_INPUT_RAISE 9231 #define SendPokerMessage(%0,%1) \ diff --git a/gamemodes/irresistible/cnr/vip/player_market.pwn b/gamemodes/irresistible/cnr/vip/player_market.pwn index c32922d..129e3ec 100644 --- a/gamemodes/irresistible/cnr/vip/player_market.pwn +++ b/gamemodes/irresistible/cnr/vip/player_market.pwn @@ -9,8 +9,8 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define DIALOG_IC_SELLORDERS ( 5921 ) -#define DIALOG_IC_BUY ( 5922 ) +// #define DIALOG_IC_SELLORDERS ( 5921 ) +// #define DIALOG_IC_BUY ( 5922 ) /* ** Variables ** */ static const From 91bf3157a03b28440b5c2b0c41dc1f668e49cc88 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 08:49:53 +0100 Subject: [PATCH 02/13] adds a confirmation dialog before selling vehicle modifications --- gamemodes/irresistible/cnr/dialog_ids.pwn | 2 +- .../cnr/features/vehicles/vmodifications.pwn | 62 +++++++++++++++---- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/gamemodes/irresistible/cnr/dialog_ids.pwn b/gamemodes/irresistible/cnr/dialog_ids.pwn index 6375013..d3b8540 100644 --- a/gamemodes/irresistible/cnr/dialog_ids.pwn +++ b/gamemodes/irresistible/cnr/dialog_ids.pwn @@ -207,7 +207,7 @@ #define DIALOG_INPUT_RAISE 1197 #define DIALOG_IC_SELLORDERS 1198 #define DIALOG_IC_BUY 1199 - +#define DIALOG_COMPONENTS_SELL 1200 /* ** Hooks ** */ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) diff --git a/gamemodes/irresistible/cnr/features/vehicles/vmodifications.pwn b/gamemodes/irresistible/cnr/features/vehicles/vmodifications.pwn index 0934809..833a319 100644 --- a/gamemodes/irresistible/cnr/features/vehicles/vmodifications.pwn +++ b/gamemodes/irresistible/cnr/features/vehicles/vmodifications.pwn @@ -539,7 +539,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) EditDynamicObject( playerid, iObject ); } } - case 2: // Pimp + case 2: // sell { new pimpid; @@ -548,23 +548,61 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) if ( g_vehicleComponentsData[ pimpid ] [ E_MODEL_ID ] == g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ i ] ) break; - if ( g_vehicleComponentsData[ pimpid ] [ E_MODEL_ID ] != g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ i ] ) - return SendError( playerid, "You cannot sell this component as it no longer exists." ); - new sellPrice = floatround( g_vehicleComponentsData[ pimpid ] [ E_PRICE ] * 0.5 ); - GivePlayerCash( playerid, sellPrice ); - DestroyDynamicObject( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] ); - - g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] = -1; - g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_CREATED ] [ i ] = false; - - mysql_single_query( sprintf( "DELETE FROM `COMPONENTS` WHERE `ID`=%d", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_SQL_ID ] [ i ] ) ); - SendServerMessage( playerid, "You have sold your "COL_GREY"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_vehicleComponentsData[ pimpid ] [ E_NAME ], cash_format( sellPrice ) ); + ShowPlayerDialog( playerid, DIALOG_COMPONENTS_SELL, DIALOG_STYLE_MSGBOX, ""COL_WHITE"Sell Components", sprintf( ""COL_WHITE"Are you sure you want to sell your "COL_GREY"%s "COL_WHITE"for "COL_GOLD"%s?\n", g_vehicleComponentsData[ pimpid ] [ E_NAME ], cash_format( sellPrice ) ), "Sell", "Back" ); } } } + else if ( dialogid == DIALOG_COMPONENTS_SELL ) + { + new + ownerid = INVALID_PLAYER_ID, + i = GetPVarInt( playerid, "components_editing" ), + vehicleid = getVehicleSlotFromID( GetPlayerVehicleID( playerid ), ownerid ) + ; + + if ( vehicleid == -1 ) + return SendError( playerid, "This vehicle isn't a buyable vehicle." ); + + if ( playerid != ownerid ) + return SendError( playerid, "This vehicle does not belong to you." ); + + if ( ! response) + { + for( new y = 0, x = 0; y < MAX_PIMPS; y++ ) if ( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_CREATED ] [ y ] ) { + if ( listitem == x++ ) { + return ShowPlayerVehicleComponentMenu( playerid, ownerid, vehicleid, i ); + } + } + } + else + { + new + pimpid; + + for( ; pimpid < sizeof( g_vehicleComponentsData ); pimpid++ ) + if ( g_vehicleComponentsData[ pimpid ] [ E_MODEL_ID ] == g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ i ] ) + break; + + if ( g_vehicleComponentsData[ pimpid ] [ E_MODEL_ID ] != g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ i ] ) + return SendError( playerid, "You cannot sell this component as it no longer exists." ); + + new + sellPrice = floatround( g_vehicleComponentsData[ pimpid ] [ E_PRICE ] * 0.5 ); + + GivePlayerCash( playerid, sellPrice ); + DestroyDynamicObject( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] ); + + g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] = -1; + g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_CREATED ] [ i ] = false; + + mysql_single_query( sprintf( "DELETE FROM `COMPONENTS` WHERE `ID`=%d", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_SQL_ID ] [ i ] ) ); + SendServerMessage( playerid, "You have sold your "COL_GREY"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_vehicleComponentsData[ pimpid ] [ E_NAME ], cash_format( sellPrice ) ); + } + return 1; + } return 1; } From 7f4a463235a5d46e94523a57d805f6ea8ed988ea Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 09:32:26 +0100 Subject: [PATCH 03/13] adds a confirmation dialog before selling a house --- gamemodes/irresistible/cnr/dialog_ids.pwn | 1 + .../cnr/features/houses/house.pwn | 29 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gamemodes/irresistible/cnr/dialog_ids.pwn b/gamemodes/irresistible/cnr/dialog_ids.pwn index d3b8540..13c767f 100644 --- a/gamemodes/irresistible/cnr/dialog_ids.pwn +++ b/gamemodes/irresistible/cnr/dialog_ids.pwn @@ -208,6 +208,7 @@ #define DIALOG_IC_SELLORDERS 1198 #define DIALOG_IC_BUY 1199 #define DIALOG_COMPONENTS_SELL 1200 +#define DIALOG_HOUSE_SELL 1201 /* ** Hooks ** */ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) diff --git a/gamemodes/irresistible/cnr/features/houses/house.pwn b/gamemodes/irresistible/cnr/features/houses/house.pwn index 806e662..0a563c0 100644 --- a/gamemodes/irresistible/cnr/features/houses/house.pwn +++ b/gamemodes/irresistible/cnr/features/houses/house.pwn @@ -103,7 +103,24 @@ hook OnScriptInit( ) hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { - if ( dialogid == DIALOG_HOUSE_CONFIG && response ) + if ( dialogid == DIALOG_HOUSE_SELL && response ) + { + new + ID = GetPVarInt( playerid, "house_sell_id" ); + + format( szBigString, sizeof( szBigString ), "[SELL] [%s] %s | %s | %d\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), g_houseData[ ID ][ E_OWNER ], ID ); + AddFileLogLine( "log_houses.txt", szBigString ); + p_OwnedHouses[ playerid ] --; + SetHouseForAuction( ID ); + GivePlayerCash( playerid, ( g_houseData[ ID ] [ E_COST ] / 2 ) ); + SetPlayerPos( playerid, g_houseData[ ID ] [ E_EX ], g_houseData[ ID ] [ E_EY ], g_houseData[ ID ] [ E_EZ ] ); + SetPlayerInterior( playerid, 0 ), SetPlayerVirtualWorld( playerid, 0 ); + SendServerMessage( playerid, "You have successfully sold your house for "COL_GOLD"%s", cash_format( ( g_houseData[ ID ] [ E_COST ] / 2 ) ) ); + + DeletePVar( playerid, "house_sell_id" ); + return 1; + } + else if ( dialogid == DIALOG_HOUSE_CONFIG && response ) { if ( p_InHouse[ playerid ] == -1 ) return SendError( playerid, "You're not inside any house." ); if ( !strmatch( g_houseData[ p_InHouse[ playerid ] ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." ); @@ -461,14 +478,8 @@ CMD:h( playerid, params[ ] ) else if ( !strmatch( g_houseData[ ID ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." ); else { - format( szBigString, sizeof( szBigString ), "[SELL] [%s] %s | %s | %d\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), g_houseData[ ID ][ E_OWNER ], ID ); - AddFileLogLine( "log_houses.txt", szBigString ); - p_OwnedHouses[ playerid ] --; - SetHouseForAuction( ID ); - GivePlayerCash( playerid, ( g_houseData[ ID ] [ E_COST ] / 2 ) ); - SetPlayerPos( playerid, g_houseData[ ID ] [ E_EX ], g_houseData[ ID ] [ E_EY ], g_houseData[ ID ] [ E_EZ ] ); - SetPlayerInterior( playerid, 0 ), SetPlayerVirtualWorld( playerid, 0 ); - SendServerMessage( playerid, "You have successfully sold your house for "COL_GOLD"%s", cash_format( ( g_houseData[ ID ] [ E_COST ] / 2 ) ) ); + SetPVarInt( playerid, "house_sell_id", ID ); + ShowPlayerDialog( playerid, DIALOG_HOUSE_SELL, DIALOG_STYLE_MSGBOX, ""COL_WHITE"Sell House", sprintf( ""COL_WHITE"Are you sure you want to sell this house for "COL_GOLD"%s"COL_WHITE"?", cash_format( ( g_houseData[ ID ] [ E_COST ] / 2 ) ) ), "Sell", "Cancel" ); } return 1; } From 590da61131c40fa946d3238ec9f9c31fe8cbc415 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 09:53:55 +0100 Subject: [PATCH 04/13] addressed mmb for arresting issue pilot missions are added into achievements and saves in sql --- .../cnr/features/minijobs/pilot.pwn | 8 +++++ gamemodes/irresistible/cnr/player.pwn | 1 + gamemodes/sf-cnr.pwn | 34 ++++++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn b/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn index 8d34c23..79eb24d 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn @@ -5,6 +5,12 @@ * Purpose: pilot minijob - cargo pickup and transport to another airport. */ +/* + +sql structure: ALTER TABLE `users` ADD `PILOT` INT NULL DEFAULT NULL AFTER `TRUCKED`; + +*/ + /* ** Includes ** */ #include < YSI\y_hooks > @@ -173,6 +179,8 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) GivePlayerWantedLevel( playerid, 6 ); } + ach_HandlePilotMissions( playerid ); + GivePlayerScore( playerid, 1 + floatround( p_PilotDistance[ playerid ] / 1000.0 ) ); GivePlayerCash( playerid, cash_earned ); diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 090d8ae..9f4bd7a 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -209,6 +209,7 @@ new p_WorkCooldown [ MAX_PLAYERS ], p_AntiSpammyTS [ MAX_PLAYERS ], p_TruckedCargo [ MAX_PLAYERS ], + p_PilotMissions [ MAX_PLAYERS ], p_KidnapImmunity [ MAX_PLAYERS ], p_GangSplitProfits [ MAX_PLAYERS ], Float: p_IrresistiblePoints [ MAX_PLAYERS ], diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 3021c55..a3fd101 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -2725,6 +2725,7 @@ public OnPlayerDisconnect( playerid, reason ) p_IrresistiblePoints[ playerid ] = 0.0; p_AntiExportCarSpam[ playerid ] = 0; p_TruckedCargo[ playerid ] = 0; + p_PilotMissions[ playerid ] = 0; p_HydrogenChloride{ playerid } = 0; p_Methamphetamine{ playerid } = 0; p_IsCasinoHighRoller{ playerid } = false; @@ -11363,7 +11364,7 @@ public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) // taze mechanism else if ( PRESSED( KEY_LOOK_BEHIND ) ) { - if ( p_Class[ playerid ] == CLASS_POLICE && p_AntiSpawnKillEnabled{ playerid }) + if ( p_Class[ playerid ] == CLASS_POLICE && p_AntiSpawnKillEnabled{ playerid } ) { new closestid = GetClosestPlayer( playerid ); @@ -11644,6 +11645,7 @@ thread OnAttemptPlayerLogin( playerid, password[ ] ) p_PingImmunity{ playerid } = cache_get_field_content_int( 0, "PING_IMMUNE", dbHandle ); p_HitsComplete[ playerid ] = cache_get_field_content_int( 0, "CONTRACTS", dbHandle ); p_TruckedCargo[ playerid ] = cache_get_field_content_int( 0, "TRUCKED", dbHandle ); + p_PilotMissions[ playerid ] = cache_get_field_content_int( 0, "PILOT", dbHandle ); //p_CopTutorial{ playerid } = cache_get_field_content_int( 0, "COP_TUTORIAL", dbHandle ); p_Job{ playerid } = cache_get_field_content_int( 0, "JOB", dbHandle ); p_VIPJob{ playerid } = cache_get_field_content_int( 0, "VIP_JOB", dbHandle ); @@ -13037,8 +13039,9 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) ""COL_GREY"Total Bank Raids:{FFFFFF} %d\n"\ ""COL_GREY"Total Cars Jacked:{FFFFFF} %d\n"\ ""COL_GREY"Total Trucked Cargo:{FFFFFF} %d\n"\ - ""COL_GREY"Total Meth Yielded:{FFFFFF} %d", - szLargeString, p_JailsBlown[ pID ], p_BankBlown[ pID ], p_CarsJacked[ pID ], p_TruckedCargo[ pID ], p_MethYielded[ pID ] ); + ""COL_GREY"Total Meth Yielded:{FFFFFF} %d\n"\ + ""COL_GREY"Total Pilot Missions:{FFFFFF} %d", + szLargeString, p_JailsBlown[ pID ], p_BankBlown[ pID ], p_CarsJacked[ pID ], p_TruckedCargo[ pID ], p_MethYielded[ pID ], p_PilotMissions[ pID ] ); ShowPlayerDialog( playerid, DIALOG_STATS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Main Statistics", szLargeString, "Okay", "Back" ); } @@ -14792,13 +14795,14 @@ stock SavePlayerData( playerid, bool: logout = false ) p_ContractedAmount[ playerid ], p_WeedGrams[ playerid ], logout ? ( bQuitToAvoid ? 1 : 0 ) : 0, p_drillStrength[ playerid ] ); - format( Query, sizeof( Query ), "%s`BLEW_JAILS`=%d,`BLEW_VAULT`=%d,`VEHICLES_JACKED`=%d,`METH_YIELDED`=%d,`LAST_IP`='%s',`VIP_JOB`=%d,`TRUCKED`=%d,`COINS`=%f,`EXPLOSIVE_BULLETS`=%d,`RANK`=%f,`ONLINE`=%d,`HIT_SOUND`=%d,`EXTRA_SLOTS`=%d WHERE `ID`=%d", + format( Query, sizeof( Query ), "%s`BLEW_JAILS`=%d,`BLEW_VAULT`=%d,`VEHICLES_JACKED`=%d,`METH_YIELDED`=%d,`LAST_IP`='%s',`VIP_JOB`=%d,`TRUCKED`=%d,`COINS`=%f,`EXPLOSIVE_BULLETS`=%d,`RANK`=%f,`ONLINE`=%d,`HIT_SOUND`=%d,`EXTRA_SLOTS`=%d,`PILOT`=%d WHERE `ID`=%d", Query, p_JailsBlown[ playerid ], p_BankBlown[ playerid ], p_CarsJacked[ playerid ], p_MethYielded[ playerid ], mysql_escape( ReturnPlayerIP( playerid ) ), p_VIPJob{ playerid }, p_TruckedCargo[ playerid ], p_IrresistibleCoins[ playerid ], p_ExplosiveBullets[ playerid ], p_IrresistiblePoints[ playerid ], !logout, p_HitmarkerSound{ playerid }, p_ExtraAssetSlots{ playerid }, + p_PilotMissions[ playerid ], p_AccountID[ playerid ] ); mysql_single_query( Query ); @@ -18109,6 +18113,20 @@ stock Achievement::HandleTruckingCouriers( playerid ) } } +stock Achievement::HandlePilotMissions( playerid ) +{ + switch( ++p_PilotMissions[ playerid ]) + { + case 5: ShowAchievement( playerid, "Completed ~r~5~w~~h~~h~ pilot missions!", 3 ); + case 20: ShowAchievement( playerid, "Completed ~r~20~w~~h~~h~ pilot missions!", 6 ); + case 50: ShowAchievement( playerid, "Completed ~r~50~w~~h~~h~ pilot missions!", 9 ); + case 100: ShowAchievement( playerid, "Completed ~r~100~w~~h~~h~ pilot missions!", 12 ); + case 200: ShowAchievement( playerid, "Completed ~r~200~w~~h~~h~ pilot missions!", 15 ); + case 500: ShowAchievement( playerid, "Completed ~r~500~w~~h~~h~ pilot missions!", 18 ); + case 1000: ShowAchievement( playerid, "Completed ~r~1000~w~~h~~h~ pilot missions!", 25 ); + } +} + thread readplayernotes( playerid ) { new @@ -18338,7 +18356,7 @@ thread OnShowWeaponStats( playerid, dialogid, back_option, forid ) stock displayAchievements( playerid, dialogid = DIALOG_NULL, szSecondButton[ ] = "", forid = INVALID_PLAYER_ID ) { static - szAchievements[ 1300 ]; + szAchievements[ 1500 ]; format( szAchievements, sizeof( szAchievements ), ""COL_GREY"Played For\t\t\t%s10m\t%s1h\t%s5h\t%s10h\t%s15h\t%s20h\t%s1d\n", @@ -18414,6 +18432,12 @@ stock displayAchievements( playerid, dialogid = DIALOG_NULL, szSecondButton[ ] = Ach_Unlock( p_TruckedCargo[ playerid ], 100 ), Ach_Unlock( p_TruckedCargo[ playerid ], 200 ), Ach_Unlock( p_TruckedCargo[ playerid ], 500 ), Ach_Unlock( p_TruckedCargo[ playerid ], 1000 ) ); + format( szAchievements, sizeof( szAchievements ), + "%s"COL_GREY"Total Pilot Missions\t\t%s5\t%s20\t%s50\t%s100\t%s200\t%s500\t%s1000\n", szAchievements, + Ach_Unlock( p_PilotMissions[ playerid ], 5 ), Ach_Unlock( p_PilotMissions[ playerid ], 20 ), Ach_Unlock( p_PilotMissions[ playerid ], 50 ), + Ach_Unlock( p_PilotMissions[ playerid ], 100 ), Ach_Unlock( p_PilotMissions[ playerid ], 200 ), Ach_Unlock( p_PilotMissions[ playerid ], 500 ), + Ach_Unlock( p_PilotMissions[ playerid ], 1000 ) + ); if ( !IsPlayerConnected( forid ) ) forid = playerid; ShowPlayerDialog( forid, dialogid, DIALOG_STYLE_MSGBOX, "{FFFFFF}Achievements", szAchievements, "Okay", szSecondButton ); From 9c48bbeebcdf885d95f9c7deee9a7d6a6b89f1c3 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 10:01:05 +0100 Subject: [PATCH 05/13] adds more highscore options meth yielded, pilot missions, trucked cargo, vehicles jacked --- gamemodes/sf-cnr.pwn | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index a3fd101..c02b57d 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -5283,7 +5283,7 @@ CMD:irresistiblecoins( playerid, params[ ] ) CMD:top( playerid, params[ ] ) return cmd_highscores( playerid, params ); CMD:highscores( playerid, params[ ] ) { - ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults", "Select", "Close" ); + ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults\nVehicles Jacked\nMeth Yielded\nTotal Trucked Cargo\nTotal Pilot Missions\n", "Select", "Close" ); return 1; } @@ -11364,7 +11364,7 @@ public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) // taze mechanism else if ( PRESSED( KEY_LOOK_BEHIND ) ) { - if ( p_Class[ playerid ] == CLASS_POLICE && p_AntiSpawnKillEnabled{ playerid } ) + if ( p_Class[ playerid ] == CLASS_POLICE && !p_AntiSpawnKillEnabled{ playerid } ) { new closestid = GetClosestPlayer( playerid ); @@ -14318,10 +14318,21 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) // blown vaults case 9: mysql_function_query( dbHandle, "SELECT `NAME`, `BLEW_VAULT` as `SCORE_VAL` FROM `USERS` ORDER BY `BLEW_VAULT` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 9 ); + // vehicles jacked + case 10: mysql_function_query( dbHandle, "SELECT `NAME`, `VEHICLES_JACKED` as `SCORE_VAL` FROM `USERS` ORDER BY `VEHICLES_JACKED` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 10 ); + + // meth yielded + case 11: mysql_function_query( dbHandle, "SELECT `NAME`, `METH_YIELDED` as `SCORE_VAL` FROM `USERS` ORDER BY `METH_YIELDED` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 11 ); + + // total trucked cargo + case 12: mysql_function_query( dbHandle, "SELECT `NAME`, `TRUCKED` as `SCORE_VAL` FROM `USERS` ORDER BY `TRUCKED` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 12 ); + + // pilot missons + case 13: mysql_function_query( dbHandle, "SELECT `NAME`, `PILOT` as `SCORE_VAL` FROM `USERS` ORDER BY `PILOT` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 13 ); } } if ( dialogid == DIALOG_HIGHSCORES_BACK && ! response ) { - return ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults", "Select", "Close" ); + return ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults\nVehicles Jacked\nMeth Yielded\nTotal Trucked Cargo\nTotal Pilot Missions\n", "Select", "Close" ); } return 1; } @@ -14342,16 +14353,20 @@ thread OnHighScoreCheck( playerid, highscore_item ) switch ( highscore_item ) { - case 0: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Seasonal Rank\n", szSmallString = "Top 25 Seasonal"; - case 1: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Score\n", szSmallString = "Top 25 Score"; - case 2: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Kills\n", szSmallString = "Top 25 Kills"; - case 3: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Arrests\n", szSmallString = "Top 25 Arrests"; - case 4: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Robberies\n", szSmallString = "Top 25 Robberies"; - case 5: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Contracts\n", szSmallString = "Top 25 Hits Completed"; - case 6: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Fires\n", szSmallString = "Top 25 Fires Extinguished"; - case 7: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Burglaries\n", szSmallString = "Top 25 Burglaries"; - case 8: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Jailes\n", szSmallString = "Top 25 Blown Jails"; - case 9: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Vaults\n", szSmallString = "Top 25 Blown Vaults"; + case 0: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Seasonal Rank\n", szSmallString = "Top 25 Seasonal"; + case 1: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Score\n", szSmallString = "Top 25 Score"; + case 2: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Kills\n", szSmallString = "Top 25 Kills"; + case 3: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Arrests\n", szSmallString = "Top 25 Arrests"; + case 4: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Robberies\n", szSmallString = "Top 25 Robberies"; + case 5: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Contracts\n", szSmallString = "Top 25 Hits Completed"; + case 6: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Fires\n", szSmallString = "Top 25 Fires Extinguished"; + case 7: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Burglaries\n", szSmallString = "Top 25 Burglaries"; + case 8: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Jailes\n", szSmallString = "Top 25 Blown Jails"; + case 9: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Vaults\n", szSmallString = "Top 25 Blown Vaults"; + case 10: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Vehicles\n", szSmallString = "Top 25 Vehicles Jacked"; + case 11: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Meth\n", szSmallString = "Top 25 Meth Yielded"; + case 12: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Trucked\n", szSmallString = "Top 25 Total Trucked Cargo"; + case 13: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Missions\n", szSmallString = "Top 25 Total Pilot Missions"; } for ( new row = 0; row < rows; row ++ ) From 2d1094574c81c80b88578dc872efe5591171ec63 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 10:09:15 +0100 Subject: [PATCH 06/13] adds a confirmation dialog before selling a business --- gamemodes/irresistible/cnr/dialog_ids.pwn | 3 +- .../cnr/features/business/business.pwn | 35 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/gamemodes/irresistible/cnr/dialog_ids.pwn b/gamemodes/irresistible/cnr/dialog_ids.pwn index 13c767f..53188a2 100644 --- a/gamemodes/irresistible/cnr/dialog_ids.pwn +++ b/gamemodes/irresistible/cnr/dialog_ids.pwn @@ -209,7 +209,8 @@ #define DIALOG_IC_BUY 1199 #define DIALOG_COMPONENTS_SELL 1200 #define DIALOG_HOUSE_SELL 1201 - +#define DIALOG_BUSINESS_SELL_CONFIRM 1202 + /* ** Hooks ** */ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { diff --git a/gamemodes/irresistible/cnr/features/business/business.pwn b/gamemodes/irresistible/cnr/features/business/business.pwn index 282e307..cd7bbea 100644 --- a/gamemodes/irresistible/cnr/features/business/business.pwn +++ b/gamemodes/irresistible/cnr/features/business/business.pwn @@ -370,17 +370,9 @@ CMD:business( playerid, params[ ] ) new iCashMoney = floatround( g_businessData[ iBusiness ] [ E_COST ] / 2 ); - p_OwnedBusinesses[ playerid ] --; - g_businessData[ iBusiness ] [ E_OWNER_ID ] = 0; + SetPVarInt( playerid, "biz_sell_id", iBusiness ); - ResetBusiness( iBusiness, .hard_reset = true ); - StopBusinessExportMission( iBusiness ); - UpdateBusinessData( iBusiness ); - UpdateBusinessTitle( iBusiness ); // No point querying (add on resale) - GivePlayerCash( playerid, iCashMoney ); - - SetPlayerPosEx( playerid, g_businessData[ iBusiness ] [ E_X ], g_businessData[ iBusiness ] [ E_Y ], g_businessData[ iBusiness ] [ E_Z ], 0 ), SetPlayerVirtualWorld( playerid, 0 ); - SendServerMessage( playerid, "You have successfully sold your business for "COL_GOLD"%s"COL_WHITE".", cash_format( iCashMoney ) ); + ShowPlayerDialog( playerid, DIALOG_BUSINESS_SELL_CONFIRM, DIALOG_STYLE_MSGBOX, ""COL_WHITE"Sell Business", sprintf( ""COL_WHITE"Are you sure you want to sell this business for "COL_GOLD"%s"COL_WHITE"?", cash_format( iCashMoney ) ), "Sell", "Cancel" ); } return 1; } @@ -592,7 +584,28 @@ function Timer_DestroyObject( objectid ) hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { - if ( dialogid == DIALOG_BUSINESSES ) + if ( dialogid == DIALOG_BUSINESS_SELL_CONFIRM && response ) + { + new + iBusiness = GetPVarInt( playerid, "biz_sell_id" ), + iCashMoney = floatround( g_businessData[ iBusiness ] [ E_COST ] / 2 ); + + p_OwnedBusinesses[ playerid ] --; + g_businessData[ iBusiness ] [ E_OWNER_ID ] = 0; + + ResetBusiness( iBusiness, .hard_reset = true ); + StopBusinessExportMission( iBusiness ); + UpdateBusinessData( iBusiness ); + UpdateBusinessTitle( iBusiness ); // No point querying (add on resale) + GivePlayerCash( playerid, iCashMoney ); + + SetPlayerPosEx( playerid, g_businessData[ iBusiness ] [ E_X ], g_businessData[ iBusiness ] [ E_Y ], g_businessData[ iBusiness ] [ E_Z ], 0 ), SetPlayerVirtualWorld( playerid, 0 ); + SendServerMessage( playerid, "You have successfully sold your business for "COL_GOLD"%s"COL_WHITE".", cash_format( iCashMoney ) ); + + DeletePVar( playerid, "biz_sell_id" ); + return 1; + } + else if ( dialogid == DIALOG_BUSINESSES ) { if ( ! response ) return ShowPlayerSpawnMenu( playerid ); From 120c5b09c23259d4bed97eb0901e8d71d081766a Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 10:13:25 +0100 Subject: [PATCH 07/13] updated pilot sql schematic --- gamemodes/irresistible/cnr/features/minijobs/pilot.pwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn b/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn index 79eb24d..2a3e8a1 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/pilot.pwn @@ -7,7 +7,9 @@ /* -sql structure: ALTER TABLE `users` ADD `PILOT` INT NULL DEFAULT NULL AFTER `TRUCKED`; +sql structure: + + ALTER TABLE `users` ADD `PILOT` INT(11) NULL DEFAULT '0' AFTER `TRUCKED`; */ From a65c2cf9b5d7428e9b6c62ed061158ae664e1201 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 10:49:11 +0100 Subject: [PATCH 08/13] added train missions to database updated highscores to have train missions added achievements for train driver aswell --- .../cnr/features/minijobs/traindriver.pwn | 2 + gamemodes/irresistible/cnr/player.pwn | 1 + gamemodes/sf-cnr.pwn | 41 +++++++++++++++---- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn b/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn index 010da94..57e9218 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/traindriver.pwn @@ -134,6 +134,8 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid ) GivePlayerScore( playerid, 1 + floatround( p_TrainDistance[ playerid ] / 1000.0 ) ); GivePlayerCash( playerid, iCashEarned ); + ach_HandleTrainMissions( playerid ); + ShowPlayerHelpDialog( playerid, 5000, "You have earned ~y~%s ~w~for transporting passengers!", cash_format( iCashEarned ) ); StopPlayerTrainWork( playerid ); diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 9f4bd7a..f99c91c 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -210,6 +210,7 @@ new p_AntiSpammyTS [ MAX_PLAYERS ], p_TruckedCargo [ MAX_PLAYERS ], p_PilotMissions [ MAX_PLAYERS ], + p_TrainMissions [ MAX_PLAYERS ], p_KidnapImmunity [ MAX_PLAYERS ], p_GangSplitProfits [ MAX_PLAYERS ], Float: p_IrresistiblePoints [ MAX_PLAYERS ], diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index c02b57d..59f36ea 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -2726,6 +2726,7 @@ public OnPlayerDisconnect( playerid, reason ) p_AntiExportCarSpam[ playerid ] = 0; p_TruckedCargo[ playerid ] = 0; p_PilotMissions[ playerid ] = 0; + p_TrainMissions[ playerid ] = 0; p_HydrogenChloride{ playerid } = 0; p_Methamphetamine{ playerid } = 0; p_IsCasinoHighRoller{ playerid } = false; @@ -5283,7 +5284,7 @@ CMD:irresistiblecoins( playerid, params[ ] ) CMD:top( playerid, params[ ] ) return cmd_highscores( playerid, params ); CMD:highscores( playerid, params[ ] ) { - ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults\nVehicles Jacked\nMeth Yielded\nTotal Trucked Cargo\nTotal Pilot Missions\n", "Select", "Close" ); + ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults\nVehicles Jacked\nMeth Yielded\nTotal Trucked Cargo\nTotal Pilot Missions\nTotal Train Missions", "Select", "Close" ); return 1; } @@ -11646,6 +11647,7 @@ thread OnAttemptPlayerLogin( playerid, password[ ] ) p_HitsComplete[ playerid ] = cache_get_field_content_int( 0, "CONTRACTS", dbHandle ); p_TruckedCargo[ playerid ] = cache_get_field_content_int( 0, "TRUCKED", dbHandle ); p_PilotMissions[ playerid ] = cache_get_field_content_int( 0, "PILOT", dbHandle ); + p_TrainMissions[ playerid ] = cache_get_field_content_int( 0, "TRAIN", dbHandle ); //p_CopTutorial{ playerid } = cache_get_field_content_int( 0, "COP_TUTORIAL", dbHandle ); p_Job{ playerid } = cache_get_field_content_int( 0, "JOB", dbHandle ); p_VIPJob{ playerid } = cache_get_field_content_int( 0, "VIP_JOB", dbHandle ); @@ -13035,13 +13037,14 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) ""COL_GREY"Total Burglaries:{FFFFFF} %d\n", szLargeString, p_OwnedHouses[ pID ], GetPlayerHouseSlots( pID ), p_OwnedVehicles[ pID ], GetPlayerVehicleSlots( pID ), p_Arrests[ pID ], p_Robberies[ pID ], p_Fires[ pID ], p_HitsComplete[ pID ], p_Burglaries[ pID ] ); - format( szLargeString, 720, "%s"COL_GREY"Total Jail Raids:{FFFFFF} %d\n"\ + format( szLargeString, 750, "%s"COL_GREY"Total Jail Raids:{FFFFFF} %d\n"\ ""COL_GREY"Total Bank Raids:{FFFFFF} %d\n"\ ""COL_GREY"Total Cars Jacked:{FFFFFF} %d\n"\ ""COL_GREY"Total Trucked Cargo:{FFFFFF} %d\n"\ ""COL_GREY"Total Meth Yielded:{FFFFFF} %d\n"\ - ""COL_GREY"Total Pilot Missions:{FFFFFF} %d", - szLargeString, p_JailsBlown[ pID ], p_BankBlown[ pID ], p_CarsJacked[ pID ], p_TruckedCargo[ pID ], p_MethYielded[ pID ], p_PilotMissions[ pID ] ); + ""COL_GREY"Total Pilot Missions:{FFFFFF} %d\n"\ + ""COL_GREY"Total Train Missions:{FFFFFF} %d", + szLargeString, p_JailsBlown[ pID ], p_BankBlown[ pID ], p_CarsJacked[ pID ], p_TruckedCargo[ pID ], p_MethYielded[ pID ], p_PilotMissions[ pID ], p_TrainMissions[ playerid ] ); ShowPlayerDialog( playerid, DIALOG_STATS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Main Statistics", szLargeString, "Okay", "Back" ); } @@ -14329,10 +14332,13 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) // pilot missons case 13: mysql_function_query( dbHandle, "SELECT `NAME`, `PILOT` as `SCORE_VAL` FROM `USERS` ORDER BY `PILOT` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 13 ); + + // train missions + case 14: mysql_function_query( dbHandle, "SELECT `NAME`, `TRAIN` as `SCORE_VAL` FROM `USERS` ORDER BY `TRAIN` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 14 ); } } if ( dialogid == DIALOG_HIGHSCORES_BACK && ! response ) { - return ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults\nVehicles Jacked\nMeth Yielded\nTotal Trucked Cargo\nTotal Pilot Missions\n", "Select", "Close" ); + return ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults\nVehicles Jacked\nMeth Yielded\nTotal Trucked Cargo\nTotal Pilot Missions\nTotal Train Missions", "Select", "Close" ); } return 1; } @@ -14367,6 +14373,7 @@ thread OnHighScoreCheck( playerid, highscore_item ) case 11: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Meth\n", szSmallString = "Top 25 Meth Yielded"; case 12: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Trucked\n", szSmallString = "Top 25 Total Trucked Cargo"; case 13: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Missions\n", szSmallString = "Top 25 Total Pilot Missions"; + case 14: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Missions\n", szSmallString = "Top 25 Total Train Missions"; } for ( new row = 0; row < rows; row ++ ) @@ -14810,14 +14817,14 @@ stock SavePlayerData( playerid, bool: logout = false ) p_ContractedAmount[ playerid ], p_WeedGrams[ playerid ], logout ? ( bQuitToAvoid ? 1 : 0 ) : 0, p_drillStrength[ playerid ] ); - format( Query, sizeof( Query ), "%s`BLEW_JAILS`=%d,`BLEW_VAULT`=%d,`VEHICLES_JACKED`=%d,`METH_YIELDED`=%d,`LAST_IP`='%s',`VIP_JOB`=%d,`TRUCKED`=%d,`COINS`=%f,`EXPLOSIVE_BULLETS`=%d,`RANK`=%f,`ONLINE`=%d,`HIT_SOUND`=%d,`EXTRA_SLOTS`=%d,`PILOT`=%d WHERE `ID`=%d", + format( Query, sizeof( Query ), "%s`BLEW_JAILS`=%d,`BLEW_VAULT`=%d,`VEHICLES_JACKED`=%d,`METH_YIELDED`=%d,`LAST_IP`='%s',`VIP_JOB`=%d,`TRUCKED`=%d,`COINS`=%f,`EXPLOSIVE_BULLETS`=%d,`RANK`=%f,`ONLINE`=%d,`HIT_SOUND`=%d,`EXTRA_SLOTS`=%d,`PILOT`=%d,`TRAIN`=%d WHERE `ID`=%d", Query, p_JailsBlown[ playerid ], p_BankBlown[ playerid ], p_CarsJacked[ playerid ], p_MethYielded[ playerid ], mysql_escape( ReturnPlayerIP( playerid ) ), p_VIPJob{ playerid }, p_TruckedCargo[ playerid ], p_IrresistibleCoins[ playerid ], p_ExplosiveBullets[ playerid ], p_IrresistiblePoints[ playerid ], !logout, p_HitmarkerSound{ playerid }, p_ExtraAssetSlots{ playerid }, - p_PilotMissions[ playerid ], + p_PilotMissions[ playerid ], p_TrainMissions[ playerid ], p_AccountID[ playerid ] ); mysql_single_query( Query ); @@ -18142,6 +18149,20 @@ stock Achievement::HandlePilotMissions( playerid ) } } +stock Achievement::HandleTrainMissions( playerid ) +{ + switch( ++p_TrainMissions[ playerid ]) + { + case 5: ShowAchievement( playerid, "Completed ~r~5~w~~h~~h~ train missions!", 3 ); + case 20: ShowAchievement( playerid, "Completed ~r~20~w~~h~~h~ train missions!", 6 ); + case 50: ShowAchievement( playerid, "Completed ~r~50~w~~h~~h~ train missions!", 9 ); + case 100: ShowAchievement( playerid, "Completed ~r~100~w~~h~~h~ train missions!", 12 ); + case 200: ShowAchievement( playerid, "Completed ~r~200~w~~h~~h~ train missions!", 15 ); + case 500: ShowAchievement( playerid, "Completed ~r~500~w~~h~~h~ train missions!", 18 ); + case 1000: ShowAchievement( playerid, "Completed ~r~1000~w~~h~~h~ train missions!", 25 ); + } +} + thread readplayernotes( playerid ) { new @@ -18453,6 +18474,12 @@ stock displayAchievements( playerid, dialogid = DIALOG_NULL, szSecondButton[ ] = Ach_Unlock( p_PilotMissions[ playerid ], 100 ), Ach_Unlock( p_PilotMissions[ playerid ], 200 ), Ach_Unlock( p_PilotMissions[ playerid ], 500 ), Ach_Unlock( p_PilotMissions[ playerid ], 1000 ) ); + format( szAchievements, sizeof( szAchievements ), + "%s"COL_GREY"Total Train Missions\t\t%s5\t%s20\t%s50\t%s100\t%s200\t%s500\t%s1000\n", szAchievements, + Ach_Unlock( p_TrainMissions[ playerid ], 5 ), Ach_Unlock( p_TrainMissions[ playerid ], 20 ), Ach_Unlock( p_TrainMissions[ playerid ], 50 ), + Ach_Unlock( p_TrainMissions[ playerid ], 100 ), Ach_Unlock( p_TrainMissions[ playerid ], 200 ), Ach_Unlock( p_TrainMissions[ playerid ], 500 ), + Ach_Unlock( p_TrainMissions[ playerid ], 1000 ) + ); if ( !IsPlayerConnected( forid ) ) forid = playerid; ShowPlayerDialog( forid, dialogid, DIALOG_STYLE_MSGBOX, "{FFFFFF}Achievements", szAchievements, "Okay", szSecondButton ); From 133a5a60795663eefc84eef37b1980291bb0219c Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 13:25:39 +0100 Subject: [PATCH 09/13] adds strippers in the LV brothel (for fun) --- gamemodes/irresistible/cnr/static/actors.pwn | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/static/actors.pwn b/gamemodes/irresistible/cnr/static/actors.pwn index 2aec999..dbad0de 100644 --- a/gamemodes/irresistible/cnr/static/actors.pwn +++ b/gamemodes/irresistible/cnr/static/actors.pwn @@ -15,7 +15,7 @@ enum E_ACTOR_DATA new g_actorData[ ] [ E_ACTOR_DATA ] = { - // Class selection + // Class selection { 201, 236.283996, 86.777999, 1005.039978, 90.000000, "camera", "picstnd_take", 0 }, // SF Bank @@ -68,7 +68,21 @@ new { 221, -2656.4712, 1413.2327, 906.2734, 232.1765, "PAULNMAC", "wank_loop", 18 }, // Hobo - { 137, -1519.9003, 678.79800, 7.459900, 14.7968, "BEACH", "ParkSit_M_loop", 0 } + { 137, -1519.9003, 678.79800, 7.459900, 14.7968, "BEACH", "ParkSit_M_loop", 0 }, + + // LV Brothel + { 178, 962.3973, -57.3805, 1001.7495, 126.8999, "STRIP", "strip_F", 42 }, + { 221, 959.2863, -57.9077, 1001.1246, 281.0614, "PAULNMAC", "wank_loop", 42 }, + { 249, 964.3915, -50.4273, 1001.1172, 92.1085, "SHOP", "Smoke_RYD", 42 }, + { 213, 947.4916, -49.7769, 1001.1172, 185.6768, "BLOWJOBZ", "BJ_STAND_LOOP_P", 42 }, + { 152, 947.5248, -50.1076, 1001.1172, 2.5833, "BLOWJOBZ", "BJ_STAND_LOOP_W", 42 }, + { 242, 944.5837, -43.5228, 1001.1166, 174.0231, "BLOWJOBZ", "BJ_COUCH_LOOP_P", 42 }, + { 63, 944.5231, -43.9482, 1001.1166, 356.5298, "BLOWJOBZ", "BJ_COUCH_LOOP_W", 42 }, + { 87, 960.9799, -61.2946, 1001.5502, 0.3499, "CRACK", "crckidle2", 42 }, + { 244, 942.2812, -49.9304, 1001.1172, 178.9681, "CRACK", "crckidle3", 42 }, + { 259, 961.2700, -59.7196, 1001.1172, 333.1782, "STRIP", "PLY_CASH", 42 }, + { 64, 956.9485, -46.0040, 1001.6714, 266.4611, "STRIP", "STR_B2C", 42 }, + { 246, 967.1183, -47.9314, 1001.9516, 94.4628, "STRIP", "STR_A2B", 42 } } ; From 07b2d25182cdfea08adbc119500de8ea6394d98f Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 14:15:35 +0100 Subject: [PATCH 10/13] adds stealth mode (hides player from radar) once player is shot he shows for a short period (like CIA) --- gamemodes/irresistible/cnr/features/perks.pwn | 27 ++++++++++++++++++- gamemodes/irresistible/cnr/player.pwn | 4 ++- gamemodes/sf-cnr.pwn | 13 +++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/perks.pwn b/gamemodes/irresistible/cnr/features/perks.pwn index 590f1af..ea67532 100644 --- a/gamemodes/irresistible/cnr/features/perks.pwn +++ b/gamemodes/irresistible/cnr/features/perks.pwn @@ -15,7 +15,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { switch( listitem ) { - case 0: ShowPlayerDialog( playerid, DIALOG_PERKS_P, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Game Perks", ""COL_WHITE"Item Name\t"COL_WHITE"Total Level Req.\t"COL_WHITE"Cost ($)\nUnlimited Ammunition\t"COL_GOLD"50\t"COL_GREEN"$9,900", "Select", "Back" ); + case 0: ShowPlayerDialog( playerid, DIALOG_PERKS_P, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Game Perks", ""COL_WHITE"Item Name\t"COL_WHITE"Total Level Req.\t"COL_WHITE"Cost ($)\nUnlimited Ammunition\t"COL_GOLD"50\t"COL_GREEN"$9,900\nStealth Mode\t"COL_GOLD"100\t"COL_GREEN"$15,000", "Select", "Back" ); case 1: ShowPlayerDialog( playerid, DIALOG_PERKS_V, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Game Perks", ""COL_WHITE"Item Name\t"COL_WHITE"Total Level Req.\t"COL_WHITE"Cost ($)\nFix & Flip vehicle\t"COL_GOLD"75\t"COL_GREEN"$9,900\nRepair Vehicle\t"COL_GOLD"75\t"COL_GREEN"$7,500\nAdd NOS\t"COL_GOLD"50\t"COL_GREEN"$3,000\nFlip vehicle\t"COL_GOLD"40\t"COL_GREEN"$2,500", "Select", "Back" ); } } @@ -52,6 +52,31 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) SetPlayerArmedWeapon( playerid, 0 ); Beep( playerid ); } + + case 1: + { + if ( total_level < 10 ) { + return SendError( playerid, "Your total level must be at least 75 to use this (/level)." ); + } + + if ( GetPlayerCash( playerid ) < 11500 ) { + return SendError( playerid, "You do not have enough money for this item ($11,500)." ); + } + + if ( p_OffRadar{ playerid } ) { + return SendError( playerid, "You have already purchased this item." ); + } + + p_OffRadar{ playerid } = true; + + GivePlayerCash( playerid, -11500 ); + + SendServerMessage( playerid, "You have brought stealth mode for $15,000." ); + ShowPlayerHelpDialog( playerid, 3000, "~g~~h~Stealth mode ~w~will be deactivate once you respawn." ); + + SetPlayerColor( playerid, setAlpha( GetPlayerColor( playerid ), 0x00 ) ); + Beep( playerid ); + } } } else if ( dialogid == DIALOG_PERKS_V ) diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index f99c91c..92745da 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -205,6 +205,7 @@ new p_LastPlayerState [ MAX_PLAYERS char ], p_RespondDelay [ MAX_PLAYERS ], p_VisibleOnRadar [ MAX_PLAYERS ], + p_OffRadarVisible [ MAX_PLAYERS ], p_InGarage [ MAX_PLAYERS ] = { -1, ... }, p_WorkCooldown [ MAX_PLAYERS ], p_AntiSpammyTS [ MAX_PLAYERS ], @@ -239,7 +240,8 @@ new p_AimedAtPolice [ MAX_PLAYERS ], bool: p_PassiveModeDisabled [ MAX_PLAYERS char ], p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... }, - Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID } + Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID }, + bool: p_OffRadar [ MAX_PLAYERS char] ; /* ** Getters And Setters** */ diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 59f36ea..1f3d2c6 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -2131,6 +2131,11 @@ public ZoneTimer( ) // CIA Visible On Radar after firing a shot if ( p_VisibleOnRadar[ playerid ] != 0 && p_VisibleOnRadar[ playerid ] < g_iTime ) SetPlayerColorToTeam( playerid ), p_VisibleOnRadar[ playerid ] = 0; + + // Stealth mode after getting shot + if ( p_OffRadarVisible[ playerid ] != 0 && p_OffRadarVisible[ playerid ] < g_iTime ) + SetPlayerColor( playerid, setAlpha( GetPlayerColor( playerid ), 0x00 ) ), p_OffRadarVisible[ playerid ] = 0; + } return 1; } @@ -2847,6 +2852,8 @@ public OnPlayerSpawn( playerid ) StopSound( playerid ); CancelEdit( playerid ); + p_OffRadar{ playerid } = false; + // Approved spawn? if ( !approveClassSpawned( playerid ) ) { SendClientMessageToAdmins( -1, ""COL_PINK"[ABNORMAL SPAWN]"COL_GREY" %s(%d) - %d skin - %d ping - %s IP", ReturnPlayerName( playerid ), playerid, GetPlayerSkin( playerid ), GetPlayerPing( playerid ), ReturnPlayerIP( playerid ) ); @@ -3082,6 +3089,10 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:f if ( p_Class[ playerid ] == CLASS_POLICE && p_Class[ hitid ] != CLASS_POLICE && !p_WantedLevel[ hitid ] && GetPlayerState( hitid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( playerid ) ) return ShowPlayerHelpDialog( playerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; + // Exposing stealth mode player + if ( p_OffRadar{ playerid } ) + SetPlayerColor( playerid, setAlpha( GetPlayerColor( playerid ), 0xFF ) ), p_OffRadarVisible[ playerid ] = g_iTime + 2; + // CIA Exposure when weapon is shot if ( p_Class[ playerid ] == CLASS_POLICE && p_inFBI{ playerid } && p_inCIA{ playerid } && !p_inArmy{ playerid } ) SetPlayerColor( playerid, setAlpha( COLOR_CIA, 0xFF ) ), p_VisibleOnRadar[ playerid ] = g_iTime + 2; @@ -15208,6 +15219,8 @@ stock GivePlayerWantedLevel( playerid, wantedlevel, bool:loadingstats = false ) if ( p_WantedLevel[ playerid ] > 90 ) printf( "[wanted_level] %s - %d", ReturnPlayerName( playerid ), p_WantedLevel[ playerid ] ); if ( IsPlayerAdminOnDuty( playerid ) ) SetPlayerColor( playerid, COLOR_PINK ); + if ( p_OffRadar{ playerid } ) SetPlayerColor( playerid, setAlpha( GetPlayerColor( playerid ), 0x00 ) ); + /*if ( p_WantedLevel[ playerid ] > 2000 ) // 8hska7082bmahu { p_WantedLevel[ playerid ] = 2000; From 3483bc358b71542156e3921bb9085b57a19a31d5 Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 14:18:32 +0100 Subject: [PATCH 11/13] changed some level req values --- gamemodes/irresistible/cnr/features/perks.pwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/perks.pwn b/gamemodes/irresistible/cnr/features/perks.pwn index ea67532..bf1adb6 100644 --- a/gamemodes/irresistible/cnr/features/perks.pwn +++ b/gamemodes/irresistible/cnr/features/perks.pwn @@ -15,7 +15,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { switch( listitem ) { - case 0: ShowPlayerDialog( playerid, DIALOG_PERKS_P, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Game Perks", ""COL_WHITE"Item Name\t"COL_WHITE"Total Level Req.\t"COL_WHITE"Cost ($)\nUnlimited Ammunition\t"COL_GOLD"50\t"COL_GREEN"$9,900\nStealth Mode\t"COL_GOLD"100\t"COL_GREEN"$15,000", "Select", "Back" ); + case 0: ShowPlayerDialog( playerid, DIALOG_PERKS_P, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Game Perks", ""COL_WHITE"Item Name\t"COL_WHITE"Total Level Req.\t"COL_WHITE"Cost ($)\nUnlimited Ammunition\t"COL_GOLD"50\t"COL_GREEN"$9,900\nStealth Mode\t"COL_GOLD"75\t"COL_GREEN"$15,000", "Select", "Back" ); case 1: ShowPlayerDialog( playerid, DIALOG_PERKS_V, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Game Perks", ""COL_WHITE"Item Name\t"COL_WHITE"Total Level Req.\t"COL_WHITE"Cost ($)\nFix & Flip vehicle\t"COL_GOLD"75\t"COL_GREEN"$9,900\nRepair Vehicle\t"COL_GOLD"75\t"COL_GREEN"$7,500\nAdd NOS\t"COL_GOLD"50\t"COL_GREEN"$3,000\nFlip vehicle\t"COL_GOLD"40\t"COL_GREEN"$2,500", "Select", "Back" ); } } @@ -55,7 +55,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) case 1: { - if ( total_level < 10 ) { + if ( total_level < 75 ) { return SendError( playerid, "Your total level must be at least 75 to use this (/level)." ); } From f0377f3d5c9185ad5fb7ec806c9ebe6cab5899be Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 16:04:52 +0100 Subject: [PATCH 12/13] fixes the deadly death bug --- gamemodes/irresistible/anticheat/hitpoints.pwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gamemodes/irresistible/anticheat/hitpoints.pwn b/gamemodes/irresistible/anticheat/hitpoints.pwn index 3ccd60c..18b4683 100644 --- a/gamemodes/irresistible/anticheat/hitpoints.pwn +++ b/gamemodes/irresistible/anticheat/hitpoints.pwn @@ -571,9 +571,6 @@ hook OnPlayerDeath( playerid, killerid, reason ) new server_time = gettime( ); - // Reset spawned variable - AC_SetPlayerSpawned( playerid, false ); - // Anti-fakekill switch( server_time - p_LastDeath[ playerid ] ) { @@ -591,7 +588,7 @@ hook OnPlayerDeath( playerid, killerid, reason ) p_LastDeath[ playerid ] = server_time; // Died in Vehicle - if ( GetPlayerVehicleID( playerid ) && AC_IsPlayerSpawned( playerid ) ) + if ( AC_IsPlayerSpawned( playerid ) ) { if( ( GetTickCount( ) - p_LastTookDamage[ playerid ] ) > 2500 ) { p_LastDamageIssuer[ playerid ] = INVALID_PLAYER_ID, p_LastWeaponIssuer[ playerid ] = 51; @@ -599,6 +596,9 @@ hook OnPlayerDeath( playerid, killerid, reason ) CallRemoteFunction( "OnPlayerDeathEx", "ddfd", playerid, p_LastDamageIssuer[ playerid ], p_LastWeaponIssuer[ playerid ], 3.3, 3 ); } + + // Reset spawned variable + AC_SetPlayerSpawned( playerid, false ); } return 1; } From f4e603ec85fd217ea593a351fb59393ef083bc3c Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Tue, 9 Oct 2018 22:12:54 +0100 Subject: [PATCH 13/13] cleanup --- gamemodes/irresistible/cnr/player.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 92745da..ea5e718 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -241,7 +241,7 @@ new bool: p_PassiveModeDisabled [ MAX_PLAYERS char ], p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... }, Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID }, - bool: p_OffRadar [ MAX_PLAYERS char] + bool: p_OffRadar [ MAX_PLAYERS char ] ; /* ** Getters And Setters** */