Merged master into changes

This commit is contained in:
Steven Howard 2018-10-13 17:04:54 +01:00
commit 7330028a6c
6 changed files with 49 additions and 17 deletions

View File

@ -210,7 +210,8 @@
#define DIALOG_COMPONENTS_SELL 1200
#define DIALOG_HOUSE_SELL 1201
#define DIALOG_BUSINESS_SELL_CONFIRM 1202
#define DIALOG_PASSIVE_MODE 1203
/* ** Hooks ** */
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{

View File

@ -179,7 +179,7 @@ hook OnPlayerDisconnect( playerid, reason )
hook OnPlayerMovieMode( playerid, bool: toggled )
{
if ( toggled )
if ( ! toggled )
{
TextDrawShowForPlayer( playerid, g_CurrentRankTD );
TextDrawShowForPlayer( playerid, g_currentXPTD );

View File

@ -233,7 +233,7 @@ new
p_PlayerAltBindTick [ MAX_PLAYERS ],
p_AimedAtPolice [ MAX_PLAYERS ],
bool: p_PassiveModeDisabled [ MAX_PLAYERS char ],
p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... },
//p_PassiveModeExpireTimer [ MAX_PLAYERS ] = { -1, ... },
Text3D: p_PassiveModeLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID }
;

View File

@ -68,9 +68,9 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
ShowPlayerTogglableTextdraws( playerid, .force = false );
}
else if ( settingid == SETTING_PASSIVE_MODE ) {
/*else if ( settingid == SETTING_PASSIVE_MODE ) {
ResetPlayerPassiveMode( playerid, .passive_disabled = true ); // avoid abusing
}
}*/
format( szNormalString, 68, "INSERT INTO `SETTINGS`(`USER_ID`, `SETTING_ID`) VALUES (%d, %d)", p_AccountID[ playerid ], settingid );
}
@ -80,15 +80,15 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
HidePlayerTogglableTextdraws( playerid, .force = false );
ShowPlayerTogglableTextdraws( playerid, .force = false );
}
else if ( settingid == SETTING_PASSIVE_MODE ) {
/*else if ( settingid == SETTING_PASSIVE_MODE ) {
ResetPlayerPassiveMode( playerid, .passive_disabled = true ); // avoid abusing
}
}*/
format( szNormalString, 64, "DELETE FROM `SETTINGS` WHERE USER_ID=%d AND SETTING_ID=%d", p_AccountID[ playerid ], settingid );
}
mysql_single_query( szNormalString );
SendServerMessage( playerid, "You have %s "COL_GREY"%s"COL_WHITE". Changes may take effect after spawning/relogging.", p_PlayerSettings[ playerid ] { settingid } ? ( "enabled" ) : ( "disabled" ), g_PlayerSettings[ settingid ] );
SendServerMessage( playerid, ""COL_ORANGE"%s"COL_WHITE" is now %s. Changes may take effect after spawning/relogging.", g_PlayerSettings[ settingid ], p_PlayerSettings[ playerid ] { settingid } ? ( "enabled" ) : ( "disabled" ) );
if ( ! strmatch( inputtext, "ignore" )) {
cmd_cp( playerid, "" ); // Redirect to control panel again...

View File

@ -2829,10 +2829,10 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b
// Passive mode enabled for player?
if ( IsPlayerPassive( issuerid ) ) {
if ( p_PassiveModeExpireTimer[ issuerid ] == -1 ) {
/*if ( p_PassiveModeExpireTimer[ issuerid ] == -1 ) {
p_PassiveModeExpireTimer[ issuerid ] = PassiveMode_Reset( issuerid, 4 ); // it will just set it to anything but -1 for now
}
return 0;
}*/
return ShowPlayerHelpDialog( issuerid, 2000, "~r~You cannot deathmatch with /passive enabled." ), 0;
}
// Passive mode enabled for damaged id?
@ -7676,6 +7676,7 @@ CMD:c4( playerid, params[ ] )
if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You cannot use this command since you're tied." );
if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You cannot use this command since you're kidnapped." );
if ( IsPlayerInCasino( playerid ) ) return SendError( playerid, "You cannot use this command since you're in a casino." );
if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this command as an innocent player in passive mode." );
if ( IsPlayerInPaintBall( playerid ) || IsPlayerDueling( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an arena." );
if ( p_C4Amount[ playerid ] < 1 ) return SendError( playerid, "You don't have any C4's" );
@ -10516,6 +10517,11 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
}
TogglePlayerControllable( playerid, 1 );
if ( ! p_JobSet{ playerid } ) {
ShowPlayerDialog( playerid, DIALOG_PASSIVE_MODE, DIALOG_STYLE_LIST, "{FFFFFF}What is your type of style?", "{555555}Choose Below Below:\nI Like Roleplaying\nI Like Deathmatching", "Select", "" );
}
p_JobSet{ playerid } = true;
//if ( !p_CitySet{ playerid } )
@ -10528,6 +10534,19 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
TogglePlayerControllable( playerid, 0 );
ShowPlayerDialog( playerid, DIALOG_JOB, DIALOG_STYLE_LIST, "{FFFFFF}Job Selection", "Rapist\nKidnapper\nTerrorist\nHitman\nProstitute\nWeapon Dealer\nDrug Dealer\nDirty Mechanic\nBurglar", "Select", "" );
}
}
if ( dialogid == DIALOG_PASSIVE_MODE )
{
if ( ! response || ! listitem ) {
ShowPlayerDialog( playerid, DIALOG_PASSIVE_MODE, DIALOG_STYLE_LIST, "{FFFFFF}What is your type of style?", "{555555}Choose Below Below:\nI Like Roleplaying\nI Like Deathmatching", "Select", "" );
}
if ( listitem == 1 ) {
SendServerMessage( playerid, "Since you like roleplay, passive mode has been automatically enabled for you!" );
} else if ( listitem == 2 ) {
CallLocalFunction( "OnDialogResponse", "dddds", playerid, DIALOG_CP_MENU, 1, SETTING_PASSIVE_MODE + 1, "ignore" ); // cunning way
SendServerMessage( playerid, "Since you like deathmatch, passive mode has been automatically enabled for you!" );
}
}
if ( dialogid == DIALOG_BOMB_SHOP )
{
@ -17922,8 +17941,12 @@ stock DisablePlayerSpawnProtection( playerid )
stock SetPlayerPassiveMode( playerid )
{
// disable passive mode if it is enabled
if ( IsPlayerSettingToggled( playerid, SETTING_PASSIVE_MODE ) )
{
ResetPlayerPassiveMode( playerid, .passive_disabled = true );
return 0;
}
// reset any labels etc
ResetPlayerPassiveMode( playerid );
@ -17938,21 +17961,21 @@ stock SetPlayerPassiveMode( playerid )
stock IsPlayerPassive( playerid )
{
return ! IsPlayerSettingToggled( playerid, SETTING_PASSIVE_MODE ) && ! p_WantedLevel[ playerid ] && p_Class[ playerid ] != CLASS_POLICE && ! p_PassiveModeDisabled{ playerid };
return ! p_WantedLevel[ playerid ] && p_Class[ playerid ] != CLASS_POLICE && ! p_PassiveModeDisabled{ playerid };
}
stock ResetPlayerPassiveMode( playerid, bool: passive_disabled = false )
{
DestroyDynamic3DTextLabel( p_PassiveModeLabel[ playerid ] );
KillTimer( p_PassiveModeExpireTimer[ playerid ] );
//KillTimer( p_PassiveModeExpireTimer[ playerid ] );
p_PassiveModeLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID;
p_PassiveModeExpireTimer[ playerid ] = -1;
//p_PassiveModeExpireTimer[ playerid ] = -1;
p_PassiveModeDisabled{ playerid } = passive_disabled;
TextDrawHideForPlayer( playerid, g_PassiveModeTD );
return 1;
}
function PassiveMode_Reset( playerid, time_left )
/*function PassiveMode_Reset( playerid, time_left )
{
// if you happen to die then have a shot synced ... just reset normally
if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) {
@ -17971,7 +17994,7 @@ function PassiveMode_Reset( playerid, time_left )
ShowPlayerHelpDialog( playerid, 1500, "Passive mode disabled in ~r~%d seconds.", time_left );
}
return 1;
}
}*/
stock SendClientMessageToCops( colour, format[ ], va_args<> ) // Conversion to foreach 14 stuffed the define, not sure how...
{

View File

@ -1,12 +1,20 @@
(+) Newly registered players will be asked if they prefer DM or RP - if they like RP, passive mode is on.
(+) Added confirmation dialog before selling a home / business / vehicle components.
(+) Pilot and train minijobs are now saved to the database (and in /highscores).
(+) Adds some strippers in the LV brothel (for fun).
(+) Adds Hide From Minimap perk (costs $25,000) ... hides you for 1 minute.
(/) You can now set spikes in non-air and non-sea vehicles using your AIM key.
(+) Fire tracker is now /fires ... and it shows the fires on the map as red blips.
(+) New hitmarker system ... activate using /cp - Now shows taken/given damage!
(/) Passive mode now completely disables deathmatch.
(/) You can now set spikes in non-air and non-sea vehicles using your CAPSLOCK key.
(/) Car jackers now need to wait only 1 min before exporting another vehicle (before 2 min).
(/) Players with level 100 in a specific level are able to accrue more XP in the level.
(/) Explosive rounds used on vehicles will have a more significant impact.
(/) Explosive rounds require the key N to activate.
(/) Rank is now XP based now (prior score based).
(*) Should be faster to place multiple drills using left alt.
(*) Fixes death bug with players suiciding in a vehicle.
(*) Fixed Alcatraz map escaping issues.
(*) Addressed issue with being unable to rob ChuffSec.
(*) Fixed issue with business exports being randomly canceled.
(-) Removed a counter in cluckin' bell for ease of access to the safe.