LucasViniciusLV

[FilterScript] ModoWar/4FUN 1.1 @ThunderGamesBR

Jun 22nd, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.94 KB | None | 0 0
  1. //FilterScript de ModoWar feito em [22/06/2013] por Lucas Vinícius, agradecimentos especiais a: Willian Luigi.
  2. //Atualizações realizadas em 24/06/2013, foi utilizado operação ternária e optimizações
  3. #tryinclude < a_samp >
  4. #tryinclude  < zcmd >
  5.  
  6. #define function::%0(%1) forward %0(%1); public %0(%1)
  7.  
  8. new DeathMatch[MAX_PLAYERS] = {0,...};
  9. new bool:LiberouWar;
  10. //new bool:LiberouWar = !!LiberouWar;
  11. //new bool:LiberourWar = !!LiberouWar;
  12. //new bool:LiberouWar = !!LiberouWar;
  13.  
  14. new Float:RandomDM[][3] =
  15. {
  16.   {-329.3650,1536.5566,76.6117},
  17.   {-2386.9773,-587.2404,132.1172}
  18. };
  19.  
  20. //forward VerificarDM(hour);
  21. //public VerificarDM(hour)
  22. function::VerificarDM(hour)
  23. {
  24.   new  minute, second;
  25.   gettime(hour, minute, second);
  26.   //if(hour ==> 19 && minute == 0 && second == 0)
  27.   //if(hour == 19)
  28.   //if(minute >= 00 && minute <= 30)
  29.   if (hour == 19 && 30 >= minute >= 00)
  30.   {
  31.   for(new i; i < MAX_PLAYERS; i++) {
  32.   DeathMatch[i] = 1;
  33.   SendClientMessage(i, 0x00FFFFAA,"* Modo DeathMatch inicilizado,para ir digite '/war'. *");
  34.   printf("* O modo war foi inicializado no horario normal, 19:00 com o prazo de até 19:30, até ser fechado. *");
  35.   return 0x01;
  36.   }
  37.   }
  38.   else if(hour == 00 && minute == 0 && second == 0) {
  39.   for(new i; i < MAX_PLAYERS; i++) {
  40.   if(DeathMatch[i] == 1) {
  41.   SpawnPlayer(i);
  42.   SetPlayerInterior(i, 0);
  43.   DeathMatch[i] = 0;
  44.   SendClientMessage(i, 0x00FFFFAA,"* Modo DeathMatch foi desativado, só será aberto agora às 19:00 de amanhã, obrigado. *");
  45.   printf("* O modo war foi desativado no horario normal, 00:00:00, só será aberto as 19:00 do dia seguinte. *");
  46.   }
  47.   return 0x01;
  48.   }
  49.   return 0x01;
  50.   }
  51.   return 0x01;
  52. }
  53.  
  54. CMD:war(playerid,params[])
  55. {
  56.   if(DeathMatch[playerid] == 0)
  57.   {
  58.   SendClientMessage(playerid, 0x8000FFAA,"* O Mod war está fechado no momento, volte às 19:00. *");
  59.   return 1;
  60.   }
  61.   new rand = random(sizeof(RandomDM));
  62.   SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1], RandomDM[rand][2]);
  63.   if(RandomDM[rand][0]) {
  64.   SendClientMessage(playerid, 0x00FFFFAA,"* Você foi como um policial no DeathMatch. *");
  65.   SetPlayerPos(playerid,-975.975708,1060.983032,1345.671875);
  66.   SetPlayerInterior(playerid,10);
  67.   GivePlayerWeapon(playerid,22,100);
  68.   GivePlayerWeapon(playerid,26,100);
  69.   GivePlayerWeapon(playerid,29,100);
  70.   GivePlayerWeapon(playerid,31,100);
  71.   GivePlayerWeapon(playerid,32,100);
  72.   GivePlayerWeapon(playerid,34,100);
  73.   SetPlayerColor(playerid, 0x808000AA);
  74.   }
  75.   else if(RandomDM[rand][1]) {
  76.   SetPlayerPos(playerid, 1128.4297,1057.4825,1346.4141);
  77.   SetPlayerInterior(playerid,10);
  78.   GivePlayerWeapon(playerid,22,100);
  79.   GivePlayerWeapon(playerid,26,100);
  80.   GivePlayerWeapon(playerid,29,100);
  81.   GivePlayerWeapon(playerid,31,100);
  82.   GivePlayerWeapon(playerid,32,100);
  83.   GivePlayerWeapon(playerid,34,100);
  84.   SendClientMessage(playerid, 0x00FFFFAA,"* Você fo como terrorista no DeathMatch. *");
  85.   SetPlayerColor(playerid, 0x00FF80AA);
  86.   }
  87.   return 0x01;
  88. }
  89.  
  90. CMD:abrir_war(playerid,params[])
  91. {
  92.     if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* Você precisa ser administrador logado na rcon. *");
  93.     if(!LiberouWar)
  94.     {
  95.         LiberouWar = true;
  96.         SendClientMessage(playerid, -1,"{FFFFFF}[INFO]: {D02090}Modo 4Fun/War foi aberto por um administrador.");
  97.     }
  98.     return 0x01;
  99. }
  100.  
  101. CMD:fechar_war(playerid,params[])
  102. {
  103.     if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* Você precisa ser administrador logado na rcon. *");
  104.     if(LiberouWar)
  105.     {
  106.         //LiberouWar = false;
  107.         LiberouWar = !LiberouWar;
  108.         SendClientMessage(playerid, -1,"{FFFFFF}[INFO]: {D02090}Modo 4Fun/War foi fechado por um administrador.");
  109.     }
  110.     return 0x01;
  111. }
  112.  
  113. CMD:sair_war(playerid,params[])
  114. {
  115.     return SpawnPlayer(playerid), 0x01;
  116. }
  117.  
  118. CMD:comandoswar(playerid)
  119. {
  120.     return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Modo War - 4FUN", "[DM]: /war e /sair_war\n[4FUN]: Em breve 4FUN\n\nEm breve, mais novidades!", "Fechar", ""), 0x01;
  121. }
Advertisement
Add Comment
Please, Sign In to add comment