Merged in changes (pull request #22)

Changes
This commit is contained in:
Steven Howard 2018-09-25 15:35:17 +00:00 committed by Lorenc Pekaj
commit ffd3f872bc
5 changed files with 81 additions and 24 deletions

View File

@ -746,7 +746,7 @@ CMD:forceac( playerid, params[ ] )
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
else if ( sscanf( params, "u", pID ) ) SendUsage( playerid, "/forceac [PLAYER_ID]" ); else if ( sscanf( params, "u", pID ) ) SendUsage( playerid, "/forceac [PLAYER_ID]" );
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
else if ( pID == playerid ) return SendError( playerid, "You cant kick yourself." ); else if ( pID == playerid ) return SendError( playerid, "You cant use this command on yourself." );
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." ); else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." );
//else if ( GetPlayerScore( pID ) < 100 ) return SendError( playerid, "This player's score is under 100, please spectate instead." ); //else if ( GetPlayerScore( pID ) < 100 ) return SendError( playerid, "This player's score is under 100, please spectate instead." );
else else

View File

@ -88,12 +88,17 @@ CMD:reports( playerid, params[ ] )
{ {
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
if ( !strlen( szReportsLog[ 7 ] ) ) szLargeString = ""COL_GREY"Date\t"COL_GREY"Reported By\t"COL_GREY"Reported\t"COL_GREY"Message\n";
szLargeString = "None at the moment.";
else
format( szLargeString, sizeof( szLargeString ), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", szReportsLog[ 0 ], szReportsLog[ 1 ], szReportsLog[ 2 ], szReportsLog[ 3 ], szReportsLog[ 4 ], szReportsLog[ 5 ], szReportsLog[ 6 ], szReportsLog[ 7 ] );
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Report Log", szLargeString, "Okay", "" ); if ( !strlen( szReportsLog[ 7 ] ) )
return SendError( playerid, "There is no reports at the moment." );
for (new i = 0; i < 8; i ++)
{
format( szLargeString, sizeof( szLargeString ), "%s%s\n", szLargeString, szReportsLog[ i ] );
}
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Report Log", szLargeString, "Okay", "" );
return 1; return 1;
} }
@ -101,12 +106,17 @@ CMD:questions( playerid, params[ ] )
{ {
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
if ( !strlen( szQuestionsLog[ 7 ] ) ) szLargeString = ""COL_GREY"Date\t"COL_GREY"Player\t"COL_GREY"Question\n";
szLargeString = "None at the moment.";
else
format( szLargeString, sizeof( szLargeString ), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", szQuestionsLog[ 0 ], szQuestionsLog[ 1 ], szQuestionsLog[ 2 ], szQuestionsLog[ 3 ], szQuestionsLog[ 4 ], szQuestionsLog[ 5 ], szQuestionsLog[ 6 ], szQuestionsLog[ 7 ] );
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Question Log", szLargeString, "Okay", "" ); if ( !strlen( szQuestionsLog[ 7 ] ) )
return SendError( playerid, "There is no questions at the moment." );
for (new i = 0; i < 8; i ++)
{
format( szLargeString, sizeof( szLargeString ), "%s%s\n", szLargeString, szQuestionsLog[ i ] );
}
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Question Log", szLargeString, "Okay", "" );
return 1; return 1;
} }
@ -678,18 +688,26 @@ CMD:goto( playerid, params[ ] )
CMD:mutelist( playerid, params[ ] ) CMD:mutelist( playerid, params[ ] )
{ {
new new
count = 0, time = g_iTime; count = 0;
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
SendClientMessage( playerid, COLOR_PINK, ".: Mute List :." );
szNormalString[ 0 ] = '\0';
foreach( new i : Player ) foreach( new i : Player )
{ {
if ( p_Muted{ i } == true && time < p_MutedTime[ i ] ) if ( p_Muted{ i } && g_iTime < p_MutedTime[ i ] )
{ {
SendClientMessageFormatted( playerid, COLOR_GREY, "%s (%s)", ReturnPlayerName( i ), secondstotime( p_MutedTime[ i ] - time ) ); format( szNormalString, sizeof( szNormalString ), "%s"COL_WHITE"%s(%d)\t"COL_GREY"%s\n",
szNormalString,
ReturnPlayerName( i ), i,
secondstotime( p_MutedTime[ i ] - g_iTime )
);
count ++; count ++;
} }
} }
if ( count == 0 ) SendClientMessage( playerid, COLOR_GREY, "There are no muted players online." ); if ( count == 0 )
return 1; return SendError( playerid, "There are no muted players online." );
else
return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Muted List", szNormalString, "Close", "" ), 1;
} }

View File

@ -160,6 +160,28 @@ CMD:passive( playerid, params[ ] )
return 1; return 1;
} }
CMD:passivelist( playerid, params[ ])
{
new
count = 0;
szBigString[ 0 ] = '\0';
foreach ( new i : Player )
{
if ( IsPlayerPassive( i ) )
{
format( szBigString, sizeof( szBigString ), "%s%s(%d)\n", szBigString, ReturnPlayerName( i ), i );
count ++;
}
}
if ( count == 0 )
return SendError( playerid, "There is currently no players in passive mode." );
else
return ShowPlayerDialog(playerid, DIALOG_NULL, DIALOG_STYLE_LIST, ""COL_WHITE"Passive List", szBigString, "Close", "" ), 1;
}
/* ** Functions ** */ /* ** Functions ** */
stock IsPlayerSettingToggled( playerid, settingid ) { stock IsPlayerSettingToggled( playerid, settingid ) {
return p_PlayerSettings[ playerid ] { settingid }; return p_PlayerSettings[ playerid ] { settingid };

View File

@ -25,6 +25,7 @@ new
Text: g_AdminLogTD = Text: INVALID_TEXT_DRAW, Text: g_AdminLogTD = Text: INVALID_TEXT_DRAW,
Text: g_ProgressBoxTD = Text: INVALID_TEXT_DRAW, Text: g_ProgressBoxTD = Text: INVALID_TEXT_DRAW,
Text: g_AdminOnDutyTD = Text: INVALID_TEXT_DRAW, Text: g_AdminOnDutyTD = Text: INVALID_TEXT_DRAW,
Text: g_PassiveModeTD = Text: INVALID_TEXT_DRAW,
Text: g_VehiclePreviewBoxTD = Text: INVALID_TEXT_DRAW, Text: g_VehiclePreviewBoxTD = Text: INVALID_TEXT_DRAW,
Text: g_VehiclePreviewTxtTD = Text: INVALID_TEXT_DRAW, Text: g_VehiclePreviewTxtTD = Text: INVALID_TEXT_DRAW,
Text: p_VehiclePreviewCloseTD = Text: INVALID_TEXT_DRAW, Text: p_VehiclePreviewCloseTD = Text: INVALID_TEXT_DRAW,
@ -423,6 +424,14 @@ hook OnScriptInit( )
TextDrawSetOutline(g_AdminOnDutyTD, 1); TextDrawSetOutline(g_AdminOnDutyTD, 1);
TextDrawSetProportional(g_AdminOnDutyTD, 1); TextDrawSetProportional(g_AdminOnDutyTD, 1);
g_PassiveModeTD = TextDrawCreate(555.000000, 66.500000, "PASSIVE MODE" );
TextDrawBackgroundColor(g_PassiveModeTD, 255);
TextDrawFont(g_PassiveModeTD, 1);
TextDrawLetterSize(g_PassiveModeTD, 0.180000, 0.899999);
TextDrawColor(g_PassiveModeTD, -65281);
TextDrawSetOutline(g_PassiveModeTD, 1);
TextDrawSetProportional(g_PassiveModeTD, 1);
/* ** Player TextDraws ** */ /* ** Player TextDraws ** */
for(new playerid; playerid != MAX_PLAYERS; playerid ++) for(new playerid; playerid != MAX_PLAYERS; playerid ++)
{ {

View File

@ -4832,6 +4832,8 @@ public OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart )
public OnPlayerDeath( playerid, killerid, reason ) public OnPlayerDeath( playerid, killerid, reason )
#endif #endif
{ {
printf( "[OnPlayerDeathEx] %d, %d, %d, %f, %d", playerid, killerid, reason, damage, bodypart );
if ( !p_PlayerLogged{ playerid } ) { if ( !p_PlayerLogged{ playerid } ) {
return SendServerMessage( playerid, "Possible Fake-kill detected - 0x0A" ), KickPlayerTimed( playerid ); return SendServerMessage( playerid, "Possible Fake-kill detected - 0x0A" ), KickPlayerTimed( playerid );
} }
@ -5073,6 +5075,8 @@ public OnPlayerDeath( playerid, killerid, reason )
} }
ClearPlayerWantedLevel( playerid ); ClearPlayerWantedLevel( playerid );
printf( "[OnPlayerDeathEx] %d, %d, %d, %f, %d", playerid, killerid, reason, damage, bodypart );
return 1; return 1;
} }
@ -8136,7 +8140,7 @@ CMD:ask( playerid, params[ ] )
for( new iPos; iPos < sizeof( szQuestionsLog ) - 1; iPos++ ) for( new iPos; iPos < sizeof( szQuestionsLog ) - 1; iPos++ )
memcpy( szQuestionsLog[ iPos ], szQuestionsLog[ iPos + 1 ], 0, sizeof( szQuestionsLog[ ] ) * 4 ); memcpy( szQuestionsLog[ iPos ], szQuestionsLog[ iPos + 1 ], 0, sizeof( szQuestionsLog[ ] ) * 4 );
format( szNormalString, sizeof( szNormalString ), "[%s] %s: %s\n", getCurrentTime( ), ReturnPlayerName( playerid ), szMessage ); format( szNormalString, sizeof( szNormalString ), "%s\t%s(%d)\t%s\n", getCurrentTime( ), ReturnPlayerName( playerid ), playerid, szMessage );
strcpy( szQuestionsLog[ 7 ], szNormalString ); strcpy( szQuestionsLog[ 7 ], szNormalString );
Beep( playerid ); Beep( playerid );
@ -9230,7 +9234,7 @@ CMD:report( playerid, params[ ] )
for( new iPos; iPos < sizeof( szReportsLog ) - 1; iPos++ ) for( new iPos; iPos < sizeof( szReportsLog ) - 1; iPos++ )
memcpy( szReportsLog[ iPos ], szReportsLog[ iPos + 1 ], 0, sizeof( szReportsLog[ ] ) * 4 ); memcpy( szReportsLog[ iPos ], szReportsLog[ iPos + 1 ], 0, sizeof( szReportsLog[ ] ) * 4 );
format( szNormalString, sizeof( szNormalString ), "[%s] %s(%d): %s\n", getCurrentTime( ), ReturnPlayerName( iPlayer ), iPlayer, szMessage ); format( szNormalString, sizeof( szNormalString ), "%s\t%s(%d)\t%s(%d)\t%s\n", getCurrentTime( ), ReturnPlayerName( playerid ), playerid, ReturnPlayerName( iPlayer ), iPlayer, szMessage );
strcpy( szReportsLog[ 7 ], szNormalString ); strcpy( szReportsLog[ 7 ], szNormalString );
Beep( playerid ); Beep( playerid );
@ -25701,6 +25705,7 @@ stock SetPlayerPassiveMode( playerid )
// place label // place label
if ( ! IsPlayerInPaintBall( playerid ) && GetPlayerClass( playerid ) != CLASS_POLICE ) { if ( ! IsPlayerInPaintBall( playerid ) && GetPlayerClass( playerid ) != CLASS_POLICE ) {
p_PassiveModeLabel[ playerid ] = CreateDynamic3DTextLabel( "Passive Mode", COLOR_GREEN, 0.0, 0.0, -0.6, 15.0, .attachedplayer = playerid ); p_PassiveModeLabel[ playerid ] = CreateDynamic3DTextLabel( "Passive Mode", COLOR_GREEN, 0.0, 0.0, -0.6, 15.0, .attachedplayer = playerid );
TextDrawShowForPlayer( playerid, g_PassiveModeTD );
} }
return 1; return 1;
} }
@ -25717,12 +25722,15 @@ stock ResetPlayerPassiveMode( playerid, bool: passive_disabled = false )
p_PassiveModeLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; p_PassiveModeLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID;
p_PassiveModeExpireTimer[ playerid ] = -1; p_PassiveModeExpireTimer[ playerid ] = -1;
p_PassiveModeDisabled{ playerid } = passive_disabled; p_PassiveModeDisabled{ playerid } = passive_disabled;
TextDrawHideForPlayer( playerid, g_PassiveModeTD );
} }
function PassiveMode_Reset( playerid, time_left ) function PassiveMode_Reset( playerid, time_left )
{ {
if ( p_WantedLevel[ playerid ] > 0 || p_Class[ playerid ] != CLASS_CIVILIAN || -- time_left <= 0 ) if ( p_WantedLevel[ playerid ] > 0 || p_Class[ playerid ] != CLASS_CIVILIAN || -- time_left <= 0 )
{ {
TextDrawHideForPlayer( playerid, g_PassiveModeTD );
ResetPlayerPassiveMode( playerid, .passive_disabled = true ); ResetPlayerPassiveMode( playerid, .passive_disabled = true );
ShowPlayerHelpDialog( playerid, 2000, "Passive mode is ~r~disabled." ); ShowPlayerHelpDialog( playerid, 2000, "Passive mode is ~r~disabled." );
} }