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 01/28] 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 a3be94a4b868af21982882e2caaa50b2cbd05942 Mon Sep 17 00:00:00 2001 From: Dusan Date: Fri, 31 May 2019 10:36:46 +0200 Subject: [PATCH 02/28] 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 03/28] 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 04/28] 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 05/28] 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 06/28] 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 07/28] 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 08/28] -- 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 09/28] 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 10/28] 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 11/28] - 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 12/28] 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 13/28] 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 14/28] 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 15/28] 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 16/28] 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 17/28] 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 18/28] 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 19/28] 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 20/28] 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 21/28] 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 22/28] 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 23/28] 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 24/28] 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 25/28] 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 26/28] 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 27/28] 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 28/28] 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;