Advertisement
Synchr0

dZones Test Filterscript

Nov 25th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.50 KB | None | 0 0
  1. // Gamemode bare editado, créditos para os originais autores. (c) SA-MP
  2.  
  3. #include <a_samp>
  4.  
  5. #if defined MAX_GANG_ZONES
  6.     #undef MAX_GANG_ZONES
  7. #endif
  8. // Economizando memória
  9. #define MAX_GANG_ZONES 2
  10.  
  11. // Importando a include
  12. #include <dzones>
  13.  
  14. // Variavel global para armazenar o ID da gangzone
  15. new g_los_santos_zone;
  16.  
  17. main()
  18. {
  19.     print("\n----------------------------------");
  20.     print("  (Bare) Test Script by SA-MP Team\n");
  21.     print("  Editado por Larceny\n");
  22.     print("----------------------------------\n");
  23. }
  24.  
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27.     new idx;
  28.     new cmd[256];
  29.    
  30.     cmd = strtok(cmdtext, idx);
  31.  
  32.     // Comando para ir para a area criada
  33.     if(strcmp(cmd, "/irarea", true) == 0) {
  34.         ShowDynamicZoneForPlayer( playerid, g_los_santos_zone );
  35.         SetPlayerPos( playerid, 1482.26, -1650.28, 15.0 );
  36.         return 1;
  37.     }
  38.  
  39.     return 0;
  40. }
  41.  
  42. public OnPlayerEnterDynamicZone(playerid, zoneid)
  43. {
  44.     SendClientMessage(playerid, -1, "Bem-vindo a gangzone, você faz ela piscar!");
  45.     FlashDynamicZoneForPlayer(playerid, g_los_santos_zone, 0xFF00007F);
  46.     return 1;
  47. }
  48.  
  49. public OnPlayerExitDynamicZone(playerid, zoneid)
  50. {
  51.     SendClientMessage(playerid, -1, "Você saiu da gangzone, ela não vai piscar mais.");
  52.     StopFlashDynamicZoneForPlayer(playerid, g_los_santos_zone);
  53.     return 1;
  54. }
  55.  
  56. public OnPlayerSpawn(playerid)
  57. {
  58.     SetPlayerInterior(playerid,0);
  59.     TogglePlayerClock(playerid,0);
  60.     return 1;
  61. }
  62.  
  63. SetupPlayerForClassSelection(playerid)
  64. {
  65.     SetPlayerInterior(playerid,14);
  66.     SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  67.     SetPlayerFacingAngle(playerid, 270.0);
  68.     SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  69.     SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  70. }
  71.  
  72. public OnPlayerRequestClass(playerid, classid)
  73. {
  74.     SetupPlayerForClassSelection(playerid);
  75.     return 1;
  76. }
  77.  
  78. public OnGameModeInit()
  79. {
  80.     SetGameModeText("Bare Script");
  81.  
  82.     AddPlayerClass(299,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
  83.     // Criando a gangzone no departamento de policia de Los Santos
  84.     g_los_santos_zone = CreateDynamicZone( 1444.231, -1741.078, 1539.302, -1595.012, 0xFFFFFF7F );
  85.  
  86.     return 1;
  87. }
  88.  
  89. strtok(const string[], &index)
  90. {
  91.     new length = strlen(string);
  92.     while ((index < length) && (string[index] <= ' '))
  93.     {
  94.         index++;
  95.     }
  96.  
  97.     new offset = index;
  98.     new result[20];
  99.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  100.     {
  101.         result[index - offset] = string[index];
  102.         index++;
  103.     }
  104.     result[index - offset] = EOS;
  105.     return result;
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement