Advertisement
Guest User

Untitled

a guest
Feb 15th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.90 KB | None | 0 0
  1. function Help_OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
  2. {
  3.     switch( dialogid )
  4.     {
  5.         case d_help:
  6.         {
  7.             if( !response ) return 1;
  8.            
  9.             if( listitem == 6 )
  10.             {
  11.                 return showPlayerDialog( playerid, d_help + 1, DIALOG_STYLE_LIST, "Organizações governamentais", "Geral\nOpcional", "Selecione", "Voltar" );
  12.             }
  13.            
  14.             clean:<g_big_string>;
  15.            
  16.             for( new i; i < sizeof help_command; i++ )
  17.             {
  18.                 if( listitem == help_command[i][help_index] )
  19.                 {
  20.                     format:g_small_string( ""cBLUE"%s"cWHITE" - %s\n", help_command[i][help_text], help_command[i][help_descript] );
  21.                     strcat( g_big_string, g_small_string );
  22.                 }
  23.             }
  24.            
  25.             showPlayerDialog( playerid, d_help + 2, DIALOG_STYLE_MSGBOX, "Comandos do servidor", g_big_string, "Voltar", "" );
  26.         }
  27.        
  28.         case d_help + 1:
  29.         {
  30.             if( !response )
  31.             {
  32.                 return showPlayerDialog( playerid, d_help, DIALOG_STYLE_LIST, "Comandos do servidor", d_help_command, "Selecione", "Fechar" );
  33.             }
  34.            
  35.             switch( listitem )
  36.             {
  37.                 case 0:
  38.                 {
  39.                     clean:<g_big_string>;
  40.            
  41.                     for( new i; i < sizeof help_command; i++ )
  42.                     {
  43.                         if( help_command[i][help_index] == 6 && !help_command[i][help_member] )
  44.                         {
  45.                             format:g_small_string( ""cBLUE"%s"cWHITE" - %s\n", help_command[i][help_text], help_command[i][help_descript] );
  46.                             strcat( g_big_string, g_small_string );
  47.                         }
  48.                     }
  49.                    
  50.                     showPlayerDialog( playerid, d_help + 3, DIALOG_STYLE_MSGBOX, "Comandos do servidor", g_big_string, "Назад", "" );
  51.                 }
  52.                
  53.                 case 1:
  54.                 {
  55.                     if( !Player[playerid][uMember] )
  56.                     {
  57.                         SendClient:( playerid, C_WHITE, !""gbError"Você não é membro de uma organização governamental.." );
  58.                         return showPlayerDialog( playerid, d_help + 1, DIALOG_STYLE_LIST, "Organizações governamentais", "Geral\nOpcional", "Selecione", "Voltar" );
  59.                     }
  60.                    
  61.                     clean:<g_big_string>;
  62.                    
  63.                     new
  64.                         amount;
  65.            
  66.                     for( new i; i < sizeof help_command; i++ )
  67.                     {
  68.                         if( help_command[i][help_index] == 6 && Player[playerid][uMember] == help_command[i][help_member] )
  69.                         {
  70.                             format:g_small_string( ""cBLUE"%s"cWHITE" - %s\n", help_command[i][help_text], help_command[i][help_descript] );
  71.                             strcat( g_big_string, g_small_string );
  72.                            
  73.                             amount++;
  74.                         }
  75.                     }
  76.                    
  77.                     if( !amount )
  78.                     {
  79.                         SendClient:( playerid, C_WHITE, !""gbError"Não há equipes adicionais para sua organização.." );
  80.                         return showPlayerDialog( playerid, d_help + 1, DIALOG_STYLE_LIST, "Organizações governamentais", "Geral\nOpcional", "Selecione", "Voltar" );
  81.                     }
  82.                    
  83.                     showPlayerDialog( playerid, d_help + 3, DIALOG_STYLE_MSGBOX, "Comandos do servidor", g_big_string, "Voltar", "" );
  84.                 }
  85.             }
  86.         }
  87.        
  88.         case d_help + 2:
  89.         {
  90.             showPlayerDialog( playerid, d_help, DIALOG_STYLE_LIST, "Comandos do servidor", d_help_command, "Selecione", "Fechar" );
  91.         }
  92.        
  93.         case d_help + 3:
  94.         {
  95.             showPlayerDialog( playerid, d_help + 1, DIALOG_STYLE_LIST, "Organizações governamentais", "Geral\nEquipes de organização", "Selecione", "Voltar" );
  96.         }  
  97.        
  98.         case d_help + 5:
  99.         {
  100.             if( !response ) return 1;
  101.            
  102.             new
  103.                 text[ 1256 ];
  104.            
  105.             clean:<g_big_string>;
  106.            
  107.             strcat( g_big_string, help_spawn[ listitem ][ help_dialog ] );
  108.             strcat( g_big_string, "\n" );
  109.            
  110.             strunpack( text, help_spawn[ listitem ][help_text], 1256 );
  111.             strcat( g_big_string, text );
  112.            
  113.             showPlayerDialog( playerid, d_help + 6, DIALOG_STYLE_MSGBOX, "Ajuda", g_big_string, "Voltar", "" );
  114.         }
  115.        
  116.         case d_help + 6:
  117.         {
  118.             clean:<g_string>;
  119.        
  120.             for( new i; i < sizeof help_spawn; i++ )
  121.             {
  122.                 strcat( g_string, help_spawn[i][ help_dialog ] );
  123.             }
  124.            
  125.             showPlayerDialog( playerid, d_help + 5, DIALOG_STYLE_LIST, "Ajuda", g_string, "Selecione", "Fechar" );
  126.         }
  127.        
  128.         case d_help + 7:
  129.         {
  130.             showPlayerDialog( playerid, d_help + 8, DIALOG_STYLE_LIST, "Ajuda", d_help_info, "Selecione", "Fechar" );
  131.         }
  132.        
  133.         case d_help + 8:
  134.         {
  135.             if( !response ) return 1;
  136.            
  137.             if( listitem == 3 )
  138.             {
  139.                 SetPVarInt( playerid, "Help:Index", listitem );
  140.                 return showPlayerDialog( playerid, d_help + 10, DIALOG_STYLE_LIST, "Ajuda: trabalho", d_help_job, "Selecione", "Voltar" );
  141.             }
  142.             else if( listitem == 4 )
  143.             {
  144.                 SetPVarInt( playerid, "Help:Index", listitem );
  145.                 return showPlayerDialog( playerid, d_help + 12, DIALOG_STYLE_LIST, "Ajuda: propriedade", d_help_property, "Selecione", "Voltar" );
  146.             }
  147.            
  148.             for( new i; i < sizeof help_info; i++ )
  149.             {
  150.                 if( help_info[i][help_dialog] == listitem )
  151.                 {
  152.                     strunpack( g_big_string, help_info[i][help_text] );
  153.                     break;
  154.                 }
  155.             }
  156.            
  157.             showPlayerDialog( playerid, d_help + 9, DIALOG_STYLE_MSGBOX, " ", g_big_string, "Voltar", "" );
  158.         }
  159.        
  160.         case d_help + 9:
  161.         {
  162.             showPlayerDialog( playerid, d_help + 8, DIALOG_STYLE_LIST, "Ajuda", d_help_info, "Selecione", "Fechar" );
  163.         }
  164.        
  165.         case d_help + 10:
  166.         {
  167.             if( !response )
  168.             {
  169.                 DeletePVar( playerid, "Help:Index" );
  170.                 return showPlayerDialog( playerid, d_help + 8, DIALOG_STYLE_LIST, "Ajuda", d_help_info, "Selecione", "Fechar" );
  171.             }
  172.                
  173.             for( new i; i < sizeof help_info; i++ )
  174.             {
  175.                 if( help_info[i][help_index] == listitem && help_info[i][help_dialog] == GetPVarInt( playerid, "Help:Index" ) )
  176.                 {
  177.                     strunpack( g_big_string, help_info[i][help_text] );
  178.                     break;
  179.                 }
  180.             }
  181.            
  182.             showPlayerDialog( playerid, d_help + 11, DIALOG_STYLE_MSGBOX, " ", g_big_string, "Voltar", "" );
  183.         }
  184.        
  185.         case d_help + 11:
  186.         {
  187.             showPlayerDialog( playerid, d_help + 10, DIALOG_STYLE_LIST, "Ajuda: trabalhar", d_help_job, "Selecione", "Voltar" );
  188.         }
  189.        
  190.         case d_help + 12:
  191.         {
  192.             if( !response )
  193.             {
  194.                 DeletePVar( playerid, "Help:Index" );
  195.                 return showPlayerDialog( playerid, d_help + 8, DIALOG_STYLE_LIST, "Ajuda", d_help_info, "Selecione", "Fechar" );
  196.             }
  197.                
  198.             for( new i; i < sizeof help_info; i++ )
  199.             {
  200.                 if( help_info[i][help_index] == listitem && help_info[i][help_dialog] == GetPVarInt( playerid, "Help:Index" ) )
  201.                 {
  202.                     strunpack( g_big_string, help_info[i][help_text] );
  203.                     break;
  204.                 }
  205.             }
  206.            
  207.             showPlayerDialog( playerid, d_help + 13, DIALOG_STYLE_MSGBOX, " ", g_big_string, "Voltar", "" );
  208.         }
  209.        
  210.         case d_help + 13:
  211.         {
  212.             showPlayerDialog( playerid, d_help + 12, DIALOG_STYLE_LIST, "Ajuda: propriedade", d_help_property, "Selecione", "Voltar" );
  213.         }
  214.     }
  215.     return 1;
  216. }
  217.  
  218. function Help_OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
  219. {
  220.     if( PRESSED(KEY_CTRL_BACK) )
  221.     {
  222.         if( IsPlayerInRangeOfPoint( playerid, 1.5, 1517.8912, -1172.0548, 24.0781 ) || IsPlayerInRangeOfPoint( playerid, 1.5, 1465.6993, -1179.5114, 23.8256 ) )
  223.         {
  224.             clean:<g_string>;
  225.        
  226.             for( new i; i < sizeof help_spawn; i++ )
  227.             {
  228.                 strcat( g_string, help_spawn[i][ help_dialog ] );
  229.             }
  230.            
  231.             showPlayerDialog( playerid, d_help + 5, DIALOG_STYLE_LIST, "Ajuda", g_string, "Selecione", "Fechar" );
  232.         }
  233.     }
  234.  
  235.     return 1;
  236. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement