Guest User

MoroJr

a guest
Mar 23rd, 2009
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1.     if( strcmp( cmd, "/suspect", true ) == 0 || strcmp( cmd, "/sus", true ) == 0 )
  2.     {
  3.         new param1[256]
  4.        
  5.         printf( "suspect cmd" );
  6.         new ReturnPlayerName[MAX_PLAYER_NAME];
  7.         GetPlayerName(playerid,ReturnPlayerName,sizeof(ReturnPlayerName);
  8.         if( gTeam[ playerid ] == COPS )
  9.         {
  10.             new suspect;
  11.  
  12.             if( !strlen(param1))
  13.             {
  14.                 SendClientMessage( playerid, COLOR_RED, "Usage: /suspect [player id] [reason ( one word only, sorry )]" );
  15.                 return 1;
  16.             }
  17.  
  18.             suspect = strval(param1);
  19.  
  20.             if( suspect == playerid )
  21.             {
  22.                 SendClientMessage( playerid, COLOR_RED, "You can not suspect yourself!" );
  23.                 return 1;
  24.             }
  25.  
  26.             if( IsPlayerConnected( suspect ) == 0 )
  27.             {
  28.                 SendClientMessage( playerid, COLOR_RED, "You can not suspect non - players." );
  29.                 return 1;
  30.             }
  31.  
  32.             if( IsSuspect[ suspect ] == 1 )
  33.             {
  34.                 SendClientMessage( playerid, COLOR_RED, "This player is already a suspect." );
  35.                 return 1;
  36.             }
  37.  
  38.             new client_msg[ 256 ];
  39.             format( client_msg, sizeof( client_msg ), "Player %s suspected of: %s by Officer %s, calling all cars.", ReturnPlayerName( suspect ), param2, ReturnPlayerName( playerid ) );
  40.             SendClientMessageToAll( COLOR_ORANGE, client_msg );
  41.             SetPlayerColor( suspect, COLOR_ORANGE );
  42.  
  43.             IsSuspect[ suspect ] = 1;
  44.  
  45.             return 1;
  46.         }
  47.         else
  48.         {
  49.             SendClientMessage( playerid, COLOR_RED, "You must be a police officer to suspect people." );
  50.         }
  51.     }
Advertisement
Add Comment
Please, Sign In to add comment