Guest User

Sistema de faculdade

a guest
Jun 29th, 2011
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.08 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8. #define Verde 0x00FF00AA
  9. #define Vermelho 0xFF0000AA
  10. #define Branco 0xFFFFFFAA
  11. #define MaxPlayers 100
  12.  
  13. new bool: kFaculdade[Max_PLAYERS];
  14. new kAvisos[MAX_PLAYERS]=0;
  15. new bool: kFaculdadeStatus;
  16. new kSemestre[MAX_PLAYERS];
  17. new kAulas[MAX_PLAYERS];
  18. new sStr[128];
  19. new sStr[0x3C*3];
  20.  
  21. forward FaculdadeAberta(playerid);
  22. forward InfoFaculdade();
  23.  
  24. public OnFilterScriptInit()
  25. {
  26.     print("\n--------------------------------------");
  27.     print(" Blank Filterscript by your name here");
  28.     print("--------------------------------------\n");
  29.     return 1;
  30.  
  31.     SetTimer("InfoFaculdade", 600000, true);
  32.     SetTimer("FaculdadeAberta", 160000, true);
  33. }
  34.  
  35. public OnFilterScriptExit()
  36. {
  37.     return 1;
  38. }
  39.  
  40. #else
  41.  
  42. main()
  43. {
  44.     print("\n----------------------------------");
  45.     print(" ");
  46.     print("----------------------------------\n");
  47. }
  48.  
  49. #endif
  50.  
  51. public OnGameModeInit()
  52. {
  53.     // Don't use these lines if it's a filterscript
  54.  
  55.     SetTimer("InfoFaculdade", 600000, true);
  56.     SetTimer("FaculdadeAberta", 160000, true);
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerText( playerid, text[] )
  61. {
  62.   if(kFaculdade[playerid] == true)
  63.   {
  64.       kAvisos[ playerid ] += 1;
  65.       format( sStr, sizeof( sStr ), "Não pode falar na faculdade! [Avisos: %d | Maximo: 3]", fAvisos[ playerid ] );
  66.       SendClientMessage( playerid, Branco, sStr );
  67.       if( kAvisos[ playerid ] >= 3 )
  68.       {
  69.         kAvisos[ playerid ] = 0;
  70.         SetPlayerInterior( playerid, 0 );
  71.         SpawnPlayer( playerid );
  72.         kSemestre[ playerid ] -= 1;
  73.         SendClientMessage( playerid, Vermelho, "Você foi expulso da Faculdade e perdeu 1 semestre!" );
  74.       }
  75.       return false;
  76.   }
  77.   return false;
  78. }
  79.  
  80. public OnPlayerCommandText(playerid, cmdtext[])
  81. {
  82.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  83.     {
  84.         // Do something here
  85.         return 1;
  86.     }
  87.     return 0;
  88. }
  89. public InfoFaculdade()
  90. {
  91.   if( FaculdadeStatus == true )
  92.   {
  93.       kFaculdadeStatus = false;
  94.       SendClientMessageToAll( -1, "Faculdade Fechada!" );
  95.       for( new i = 0; i <= MAX_PLAYERS; i++ )
  96.       {
  97.         if( kFaculdade[ i ] == true )
  98.         {
  99.             SpawnPlayer( i );
  100.         }
  101.       }
  102.   }
  103.   else
  104.   {
  105.       kFaculdadeStatus = true;
  106.       SendClientMessageToAll( -1, "Faculdade Aberta!" );
  107.   }
  108.   return true;
  109. }
  110. public FaculdadeAberta( playerid )
  111. {
  112.   for( new i = 0; i <= MAX_PLAYERS; i++ )
  113.   {
  114.       if( IsPlayerInRangeOfPoint( i, 12.0, -2029.5188,-116.4738,1035.1719) ) //Alterar coordenadas
  115.       {
  116.         if( kFaculdadeStatus == true )
  117.         {
  118.             kAulas[ i ]++;
  119.             SendClientMessage( i, -1, "Uma aula foi adicionada ao seu curriculo (:" );
  120.             if( kAulas[ playerid ] == 7 )
  121.             {
  122.               kAulas[ playerid ] = false;
  123.               kSemestre[ playerid ]++;
  124.               SendClientMessage( playerid, -1, "Você superou as 7 aulas, agora foi adicionado +1 semestre ao seu curriculo (:" );
  125.             }
  126.         }
  127.       }
  128.   }
  129.   return true;
  130. }
Advertisement
Add Comment
Please, Sign In to add comment