Guest User

Mata-Mata deserto

a guest
Jul 18th, 2011
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 34.46 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4.  
  5. #pragma tabsize 0
  6.  
  7. #define COLOR_GREY 0xAFAFAFAA
  8. #define ROXO 0x661764FF
  9. #define COLOR_DGREEN 0x8FBC8FFF
  10. #define COLOR_BLACK 0x000000FF
  11. #define COLOR_BLUE 0x2641FEAA
  12. #define COLOR_GREEN 0x33AA33AA
  13. #define COLOR_RED 0xAA3333AA
  14. #define COLOR_YELLOW 0xFFFF00AA
  15. #define COLOR_WHITE 0xFFFFFFAA
  16. #define INACTIVE_PLAYER_ID 255
  17. #define GIVECASH_DELAY 5000
  18.  
  19. #define NUMVALUES 4
  20.  
  21. forward Givecashdelaytimer(playerid);
  22. forward SendMSG();
  23. forward PayDay();
  24. forward SetPlayerRandomSpawn(playerid);
  25. forward SetupPlayerForClassSelection(playerid);
  26. forward GameModeExitFunc();
  27. forward SendPlayerFormattedText(playerid, const str[], define);
  28. forward public SendAllFormattedText(playerid, const str[], define);
  29.  
  30. //------------------------------------------------------------------------------------------------------
  31. new RandomMSG[][] =
  32. {
  33.   "[SERVER] Adicione nosso ip aos favoritos: 189.1.173.161:7795",
  34.   "[SERVER] Não mate membros do seu time.",
  35.   "[SERVER] Use /ajuda para ver alguns comandos",
  36.   "[SERVER] Está cansado da Deagle? Use /armas",
  37.   "[SERVER] Utilize /mudar para mudar de time!",
  38.   "[SERVER] Não faça DB (Drive-BY, Atropelar ou matar alguem de dentro do carro) ou será punido!",
  39.   "[SERVER] Se você está num veiculo e a vitima estiver em outro, não é drive-by!"
  40. };
  41.  
  42. new RandomColors [] =
  43. {
  44.   0xEEDD82 //Azul Piscina
  45. };
  46.  
  47. new Text:players;
  48. new iSpawnSet[MAX_PLAYERS];
  49. new pClass[MAX_PLAYERS]; // Stores the player's class
  50. new Text:dTextDraw;
  51.  
  52. new Float:gRandomPlayerSpawns[4][3] = {
  53. {413.513,2533.530,18.668}, // Base Terroristas
  54. {-131.450,1229.313,19.469}, // Base Mercenarios
  55. {693.668,1959.560,5.109}, // Base Vingadores
  56. {-548.710,2593.98,53.483} // Base Agentes
  57. };
  58.  
  59. new Float:gCopPlayerSpawns[2][3] = {
  60. {2297.1064,2452.0115,10.8203},
  61. {2297.0452,2468.6743,10.8203}
  62.  
  63. };
  64.  
  65. //Round code stolen from mike's Manhunt :P
  66. //new gRoundTime = 3600000;                   // Round time - 1 hour
  67. //new gRoundTime = 1200000;                 // Round time - 20 mins
  68. //new gRoundTime = 900000;                  // Round time - 15 mins
  69. //new gRoundTime = 600000;                  // Round time - 10 mins
  70. //new gRoundTime = 300000;                  // Round time - 5 mins
  71. //new gRoundTime = 120000;                  // Round time - 2 mins
  72. //new gRoundTime = 60000;                   // Round time - 1 min
  73.  
  74. new gActivePlayers[MAX_PLAYERS];
  75. new gLastGaveCash[MAX_PLAYERS];
  76.  
  77. //------------------------------------------------------------------------------------------------------
  78.  
  79. main()
  80. {
  81.         print("\n------------------------------------------------");
  82.         print("              Rodando Guerra Deserto v0.4");
  83.         print("                     Codado Por");
  84.         print("            Arakuta, com ajuda do forum sa-mp");
  85.         print("-------------------------------------------------\n");
  86. }
  87.  
  88. public OnPlayerConnect(playerid)
  89. {
  90.     GameTextForPlayer(playerid,"Seja bem vindo ao Brasil Guerra Deserto",5000,5);
  91.     SendPlayerFormattedText(playerid, "Seja bem vindo, utilize /ajuda para ver os comandos.", 0);
  92.     gActivePlayers[playerid]++;
  93.     gLastGaveCash[playerid] = GetTickCount();
  94.             new strings[15];
  95.     format(strings, 15, "%d Online",GetOnLinePlayers());
  96.     TextDrawSetString(players, strings);
  97.     TextDrawShowForPlayer(playerid, players);
  98.     new string[128], Player_Name[MAX_PLAYER_NAME];
  99.     GetPlayerName(playerid,Player_Name,sizeof(Player_Name));
  100.     format(string,256,"==> %s [Id:%i] Entrou no servidor",Player_Name,playerid); SendClientMessageToAll(ROXO,string);
  101.     return 1;
  102. }
  103.  
  104. //------------------------------------------------------------------------------------------------------
  105. public OnPlayerDisconnect(playerid)
  106. {
  107.     new strings[15];
  108.     format(strings, 15, "%d Online",GetOnLinePlayers());
  109.     TextDrawSetString(players, strings);
  110.     TextDrawShowForPlayer(playerid, players);
  111.     gActivePlayers[playerid]--;
  112.     new string[128], Player_Name[MAX_PLAYER_NAME];
  113.     GetPlayerName(playerid,Player_Name,sizeof(Player_Name));
  114.     format(string,256,"==> %s [Id:%i] Saiu do servidor",Player_Name,playerid); SendClientMessageToAll(ROXO,string);
  115. }
  116. //------------------------------------------------------------------------------------------------------
  117.  
  118. public OnPlayerCommandText(playerid, cmdtext[])
  119. {
  120.     if(GetPVarInt(playerid,"Morto") == 1)
  121.         return SendClientMessage(playerid,COLOR_RED,"Você não pode utilizar comandos enquanto está morto!");
  122.     new string[256];
  123.     new playermoney;
  124.     new sendername[MAX_PLAYER_NAME];
  125.     new giveplayer[MAX_PLAYER_NAME];
  126.     new cmd[256];
  127.     new giveplayerid, moneys, idx;
  128.  
  129.     cmd = strtok(cmdtext, idx);
  130.  
  131.     if(strcmp(cmd, "/ajuda", true) == 0) {
  132.         SendClientMessage(playerid, COLOR_DGREEN, " - Para ver o objetivo do server, utilize /objetivo");
  133.         SendClientMessage(playerid, COLOR_DGREEN, " - Para ver os comandos do server, utilize /comandos");
  134.         SendClientMessage(playerid, COLOR_DGREEN, " - Para ver as regras do server, utilize /regras");
  135.         SendClientMessage(playerid, COLOR_DGREEN, " - Para ver as informações do server, utilize /info");
  136.     return 1;
  137.     }
  138.     if(strcmp(cmd, "/comandos", true) == 0) {
  139.         SendClientMessage(playerid, COLOR_DGREEN, " - AJUDA - /ajuda /info /comandos /armas /objetivo /regras");
  140.         SendClientMessage(playerid, COLOR_DGREEN, " - ARMAS - /m4 /sniper /deagle /shotgun /mp5");
  141.         SendClientMessage(playerid, COLOR_DGREEN, " - JOGADOR - /mudar /kill");
  142.         SendClientMessage(playerid, COLOR_DGREEN, " - TELEPORTS - /arena");
  143.     return 1;
  144.     }
  145.     if(strcmp(cmd, "/armas", true) == 0) {
  146.         SendClientMessage(playerid, COLOR_DGREEN, " - 100 balas de Deagle ($1000) /deagle");
  147.         SendClientMessage(playerid, COLOR_DGREEN, " - 25 balas de Sniper ($5000) /sniper");
  148.         SendClientMessage(playerid, COLOR_DGREEN, " - 100 balas de M4 ($3000) /m4");
  149.         SendClientMessage(playerid, COLOR_DGREEN, " - 100 balas de MP5 ($2000) /mp5");
  150.         SendClientMessage(playerid, COLOR_DGREEN, " - 50 balas de Shotgun ($2000) /shotgun");
  151.     return 1;
  152.     }
  153.     if(strcmp(cmd, "/arena", true) == 0)
  154.     {
  155.     if(GetPVarInt(playerid,"Arena") == 1) return SendClientMessage(playerid,COLOR_RED,"Você ja foi pra arena!");
  156.         SetPVarInt(playerid,"Arena",1);
  157.         SetPlayerPos(playerid,2479.7864,2318.5823,91.6300);
  158.         SetPlayerHealth(playerid, 100);
  159.         GameTextForPlayer(playerid,"~g~Mate ~w~e nao ~r~morra!",3000,5);
  160.             new Player_Name[MAX_PLAYER_NAME];
  161.             GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  162.             format(string,128,"[ID:%i] %s Foi para a arena (/arena)",playerid,Player_Name),
  163.             SendClientMessageToAll(COLOR_DGREEN,string);
  164.     return 1;
  165.     }
  166.     if(strcmp(cmd, "/deagle", true) == 0)
  167.     {
  168.     if(GetPlayerMoney(playerid)>=1000)
  169.     {
  170.         GivePlayerWeapon(playerid,24,100);
  171.         GivePlayerMoney(playerid,-1000);
  172.         new Player_Name[MAX_PLAYER_NAME];
  173.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  174.         format(string,128,"[ID:%i] %s comprou uma Deagle (/deagle)",playerid,Player_Name),
  175.         SendClientMessageToAll(COLOR_DGREEN,string);
  176.     }
  177.     else return SendClientMessage(playerid,COLOR_GREY, "Você não tem nem $1000!");
  178.     return 0x01;
  179.     }
  180.         if(strcmp(cmd, "/sniper", true) == 0)
  181.     {
  182.     if(GetPlayerMoney(playerid)>=5000)
  183.     {
  184.         GivePlayerWeapon(playerid,34,100);
  185.         GivePlayerMoney(playerid,-5000);
  186.         SendClientMessage(playerid,COLOR_GREY, "Você comprou uma sniper com 100 balas por $5000!");
  187.         new Player_Name[MAX_PLAYER_NAME];
  188.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  189.         format(string,128,"[ID:%i] %s comprou uma Sniper (/sniper)",playerid,Player_Name),
  190.         SendClientMessageToAll(COLOR_DGREEN,string);
  191.     }
  192.     else return SendClientMessage(playerid,COLOR_GREY, "Você não tem nem $5000!");
  193.     return 0x01;
  194.     }
  195.     if(strcmp(cmd, "/m4", true) == 0)
  196.     {
  197.     if(GetPlayerMoney(playerid)>=3000)
  198.     {
  199.         GivePlayerWeapon(playerid,31,100);
  200.         GivePlayerMoney(playerid,-3000);
  201.         SendClientMessage(playerid,COLOR_GREY, "Você comprou uma m4 com 100 balas por $3000!");
  202.         new Player_Name[MAX_PLAYER_NAME];
  203.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  204.         format(string,128,"[ID:%i] %s Comprou uma m4 (/m4)",playerid,Player_Name),
  205.         SendClientMessageToAll(COLOR_DGREEN,string);
  206.     }
  207.     else return SendClientMessage(playerid,COLOR_GREY, "Você não tem nem $3000!");
  208.     return 0x01;
  209.     }
  210.         if(strcmp(cmd, "/mp5", true) == 0)
  211.     {
  212.     if(GetPlayerMoney(playerid)>=2000)
  213.     {
  214.         GivePlayerWeapon(playerid,29,100);
  215.         GivePlayerMoney(playerid,-2000);
  216.         SendClientMessage(playerid,COLOR_GREY, "Você comprou uma mp5 com 100 balas por $2000!");
  217.     new Player_Name[MAX_PLAYER_NAME];
  218.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  219.         format(string,128,"[ID:%i] %s comprou uma MP5 (/mp5)",playerid,Player_Name),
  220.         SendClientMessageToAll(COLOR_DGREEN,string);
  221.     }
  222.     else return SendClientMessage(playerid,COLOR_GREY, "Você não tem nem $2000!");
  223.     return 0x01;
  224.     }
  225.         if(strcmp(cmd, "/shotgun", true) == 0)
  226.     {
  227.     if(GetPlayerMoney(playerid)>=2000)
  228.     {
  229.         GivePlayerWeapon(playerid,25,50);
  230.         GivePlayerMoney(playerid,-2000);
  231.         SendClientMessage(playerid,COLOR_GREY, "Você comprou uma Shotgun com 50 balas por $2000!");
  232.         new Player_Name[MAX_PLAYER_NAME];
  233.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  234.         format(string,128,"[ID:%i] %s comprou uma Shotgun (/shotgun)",playerid,Player_Name),
  235.         SendClientMessageToAll(COLOR_DGREEN,string);
  236.     }
  237.     else return SendClientMessage(playerid,COLOR_GREY, "Você não tem nem $2000!");
  238.     return 0x01;
  239.     }
  240.     if(strcmp(cmd, "/mudar", true) == 0) {
  241.         ForceClassSelection(playerid);
  242.         SetPlayerHealth(playerid,0);
  243.         new Player_Name[MAX_PLAYER_NAME];
  244.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  245.         format(string,128,"[ID:%i] %s Resolveu mudar de time (/mudar)",playerid,Player_Name),
  246.         SendClientMessageToAll(COLOR_DGREEN,string);
  247.     return 1;
  248.     }
  249.     if(strcmp(cmd, "/objetivo", true) == 0) {
  250.         SendClientMessage(playerid, COLOR_DGREEN, " - Após escolher um time, você deve matar os outros jogadores");
  251.         SendClientMessage(playerid, COLOR_DGREEN, " - Quando você mata um jogador você ganha um de score e $1000 para gastar.");
  252.         SendClientMessage(playerid, COLOR_DGREEN, " - Portanto para ter mais poder de fogo, é necessário ter dinheiro. (/armas)");
  253.     return 1;
  254.     }
  255.     if(strcmp(cmd, "/regras", true) == 0) {
  256.         SendClientMessage(playerid, COLOR_DGREEN, " - Proibido o uso de: Cheats, Mods CLEO, e outros programas/mods ilegais");
  257.         SendClientMessage(playerid, COLOR_DGREEN, " - Proibido DB/Spawn Kill/Heli Kill, PROIBIDO SE MATAR NA ARENA (PULAR DO PREDIO)");
  258.         SendClientMessage(playerid, COLOR_DGREEN, " - Proibido Team Kill: Matar jogador do mesmo time! (mesma cor de nick)");
  259.         SendClientMessage(playerid, COLOR_DGREEN, " - O descumprimento das regras acima causará ban/kick/cadeia");
  260.     return 1;
  261.     }
  262.  if(strcmp(cmdtext, "/kill", true) == 0)
  263.     {
  264.         new Float:Life;
  265.         GetPlayerHealth(playerid,Life);
  266.         if(Life < 80)
  267.         {
  268.             SendClientMessage(playerid,COLOR_RED,"Você precisa ter 80 de vida ou mais para usar este comando");
  269.             return true;
  270.         }
  271.         SetPlayerHealth(playerid,0);
  272.         new Player_Name[MAX_PLAYER_NAME];
  273.         GetPlayerName(playerid,Player_Name,sizeof(Player_Name)),
  274.         format(string,128,"[ID:%i] %s Se matou (/kill)",playerid,Player_Name),
  275.         SendClientMessageToAll(COLOR_DGREEN,string);
  276.         return true;
  277.     }
  278.  
  279.     if(strcmp(cmd, "/dargrana", true) == 0) {
  280.         new tmp[256];
  281.         tmp = strtok(cmdtext, idx);
  282.  
  283.         if(!strlen(tmp)) {
  284.             SendClientMessage(playerid, COLOR_GREY, "USE: /dargrana [ID] [QUANTIDADE]");
  285.             return 1;
  286.         }
  287.         giveplayerid = strval(tmp);
  288.  
  289.         tmp = strtok(cmdtext, idx);
  290.         if(!strlen(tmp)) {
  291.             SendClientMessage(playerid, COLOR_GREY, "USE: /dargrana [ID] [QUANTIDADE]");
  292.             return 1;
  293.         }
  294.         moneys = strval(tmp);
  295.  
  296.         //printf("givecash_command: %d %d",giveplayerid,moneys);
  297.  
  298.  
  299.         if (IsPlayerConnected(giveplayerid)) {
  300.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  301.             GetPlayerName(playerid, sendername, sizeof(sendername));
  302.             playermoney = GetPlayerMoney(playerid);
  303.             if (moneys > 0 && playermoney >= moneys) {
  304.                 GivePlayerMoney(playerid, (0 - moneys));
  305.                 GivePlayerMoney(giveplayerid, moneys);
  306.                 format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
  307.                 SendClientMessage(playerid, COLOR_YELLOW, string);
  308.                 format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
  309.                 SendClientMessage(giveplayerid, COLOR_YELLOW, string);
  310.                 printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
  311.             }
  312.             else {
  313.                 SendClientMessage(playerid, COLOR_YELLOW, "Invalid transaction amount.");
  314.             }
  315.         }
  316.         else {
  317.                 format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  318.                 SendClientMessage(playerid, COLOR_YELLOW, string);
  319.             }
  320.         return 1;
  321.     }
  322.  
  323.     // PROCESS OTHER COMMANDS
  324.  
  325.  
  326.     return SendClientMessage(playerid,COLOR_YELLOW,"Comando inexistente. Use /ajuda");
  327. }
  328.  
  329. //------------------------------------------------------------------------------------------------------
  330.  
  331. public OnPlayerSpawn(playerid)
  332. {
  333.     SetPlayerInterior(playerid,0);
  334.     SetPlayerRandomSpawn(playerid);
  335.     TogglePlayerClock(playerid,0);
  336.     GivePlayerWeapon(playerid,24,200);
  337.     SetPVarInt(playerid,"Arena",0);
  338.     SetPVarInt(playerid,"Morto",0);
  339.     GivePlayerWeapon(playerid,24,300);
  340.  
  341.     switch(pClass[playerid])
  342.     {
  343.         case 0:
  344.         {
  345.             SetPlayerColor(playerid, 0xFF0000AA);// Vingadores
  346.             SetPlayerPos(playerid, 693.668,1959.560,5.109);
  347.             SetPlayerFacingAngle(playerid, 180.0);
  348.         }
  349.         case 1:
  350.         {
  351.             SetPlayerColor(playerid, 0xFF0000AA); // Vingadores
  352.             SetPlayerPos(playerid, 693.668,1959.560,5.109);
  353.             SetPlayerFacingAngle(playerid, 180.0);
  354.         }
  355.         case 2:
  356.         {
  357.             SetPlayerColor(playerid, 0xFF0000AA); // Vingadores
  358.             SetPlayerPos(playerid, 693.668,1959.560,5.109);
  359.             SetPlayerFacingAngle(playerid, 180.0);
  360.         }
  361.         case 3:
  362.         {
  363.             SetPlayerColor(playerid, 0xFF0000AA); // Vingadores
  364.             SetPlayerPos(playerid, 693.668,1959.560,5.109);
  365.             SetPlayerFacingAngle(playerid, 180.0);
  366.         }
  367.         case 4:
  368.         {
  369.             SetPlayerColor(playerid, 0x2641FEAA); // Mercenarios
  370.             SetPlayerPos(playerid, -131.450,1229.313,19.469);
  371.             SetPlayerFacingAngle(playerid, 180.0);
  372.         }
  373.         case 5:
  374.         {
  375.             SetPlayerColor(playerid, 0x2641FEAA); // Mercenarios
  376.             SetPlayerPos(playerid, -131.450,1229.313,19.469);
  377.             SetPlayerFacingAngle(playerid, 180.0);
  378.         }
  379.         case 6:
  380.         {
  381.             SetPlayerColor(playerid, 0x2641FEAA); // Mercenarios
  382.             SetPlayerPos(playerid, -131.450,1229.313,19.469);
  383.             SetPlayerFacingAngle(playerid, 180.0);
  384.         }
  385.         case 7:
  386.         {
  387.             SetPlayerColor(playerid, 0x2641FEAA); // Mercenarios
  388.             SetPlayerPos(playerid, -131.450,1229.313,19.469);
  389.             SetPlayerFacingAngle(playerid, 180.0);
  390.         }
  391.         case 8:
  392.         {
  393.             SetPlayerColor(playerid, 0xAFAFAFAA); // Agentes
  394.             SetPlayerPos(playerid, -548.710,2593.98,53.483);
  395.             SetPlayerFacingAngle(playerid, 180.0);
  396.         }
  397.         case 9:
  398.         {
  399.             SetPlayerColor(playerid, 0xAFAFAFAA); // Agentes
  400.             SetPlayerPos(playerid, -548.710,2593.98,53.483);
  401.             SetPlayerFacingAngle(playerid, 180.0);
  402.         }
  403.         case 10:
  404.         {
  405.             SetPlayerColor(playerid, 0xAFAFAFAA); // Agentes
  406.             SetPlayerPos(playerid, -548.710,2593.98,53.483);
  407.             SetPlayerFacingAngle(playerid, 180.0);
  408.         }
  409.         case 11:
  410.         {
  411.             SetPlayerColor(playerid, 0xAFAFAFAA); // Agentes
  412.             SetPlayerPos(playerid, -548.710,2593.98,53.483);
  413.             SetPlayerFacingAngle(playerid, 180.0);
  414.         }
  415.         case 12:
  416.         {
  417.             SetPlayerColor(playerid, ROXO); // Terroristas
  418.             SetPlayerPos(playerid, 413.513,2533.530,18.668);
  419.             SetPlayerFacingAngle(playerid, 90.0);
  420.         }
  421.         case 13:
  422.         {
  423.             SetPlayerColor(playerid, ROXO); // Terroristas
  424.             SetPlayerPos(playerid, 413.513,2533.530,18.668);
  425.             SetPlayerFacingAngle(playerid, 90.0);
  426.         }
  427.         case 14:
  428.         {
  429.             SetPlayerColor(playerid, ROXO); // Terroristas
  430.             SetPlayerPos(playerid, 413.513,2533.530,18.668);
  431.             SetPlayerFacingAngle(playerid, 90.0);
  432.         }
  433.         case 15:
  434.         {
  435.             SetPlayerColor(playerid, ROXO); // Terroristas
  436.             SetPlayerPos(playerid, 413.513,2533.530,18.668);
  437.             SetPlayerFacingAngle(playerid, 90.0);
  438.         }
  439.     }
  440.     return 1;
  441. }
  442.  
  443. public SetPlayerRandomSpawn(playerid)
  444. {
  445.     if (iSpawnSet[playerid] == 1)
  446.     {
  447.         new rand = random(sizeof(gCopPlayerSpawns));
  448.         SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
  449.         SetPlayerFacingAngle(playerid, 270.0);
  450.     }
  451.     else if (iSpawnSet[playerid] == 0)
  452.     {
  453.         new rand = random(sizeof(gRandomPlayerSpawns));
  454.         SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
  455.     }
  456.     return 1;
  457. }
  458.  
  459. //------------------------------------------------------------------------------------------------------
  460.  
  461. public OnPlayerDeath(playerid, killerid, reason)
  462. {
  463.     SetPVarInt(playerid,"Morto",1);
  464.     SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) +1);
  465.     SetPlayerWantedLevel(playerid, 0);
  466.     SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  467.     SendClientMessage(killerid,COLOR_WHITE, "Você matou e ganhou 1 de score, e $2000");
  468.     GivePlayerMoney(killerid,2000);
  469.     GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Levou um pra ~p~cova!",5000,3);
  470.     GameTextForPlayer(playerid,"~w~Voce foi pra ~p~cova!",5000,3);
  471.     SendDeathMessage(killerid, playerid, reason);
  472.     new Float:Health;
  473.     GetPlayerHealth(killerid, Health);
  474.     if(Health <= 80)
  475.     {
  476.     SetPlayerHealth(killerid, Health + 20);
  477.     SendClientMessage(killerid,COLOR_WHITE,"Você tinha menos que 80 de vida, e ganhou 20!");
  478.     }
  479.     if(GetPlayerColor(playerid) == GetPlayerColor(killerid))
  480.     {
  481.     if(GetPVarInt(killerid,"TK") == 0)
  482.         {
  483.         new Float:x, Float:y, Float:z;
  484.         GetPlayerPos(playerid, x, y, z);
  485.         SetPlayerPos(killerid, x, y, z+200);
  486.         SetPlayerScore(killerid,GetPlayerScore(killerid) - 1);
  487.         SendClientMessage(killerid, COLOR_RED, "Você foi teleportado pois não é permitido matar um jogador do mesmo time.");
  488.         GivePlayerMoney(killerid,-2000);
  489.         SetPVarInt(killerid,"TK",1);
  490.         }
  491.         else
  492.         {
  493.         if(GetPVarInt(killerid,"TK") == 1)
  494.         {
  495.         SendClientMessage(killerid, COLOR_RED,"Você foi kikado por cometer Team-Kill 2 vezes.");
  496.         Kick(killerid);
  497.         }
  498.         }
  499.     }
  500.      if (GetPlayerScore(killerid) > 0)
  501.     {
  502.         new serialkiller[MAX_PLAYER_NAME], string[100]; GetPlayerName(killerid, serialkiller, sizeof serialkiller) ;
  503.         if(GetPlayerScore(killerid) == 1) {
  504.             format(string, sizeof(string), "%s começou no ramo de assassinatos, ja levou 1 pra cova", serialkiller);
  505.             SendClientMessageToAll(COLOR_RED, string);
  506.         }
  507.         if(GetPlayerScore(killerid) == 5) {
  508.             format(string, sizeof(string), "%s pegou o jeito da coisa, ja levou 5 pra cova", serialkiller);
  509.             SendClientMessageToAll(COLOR_RED, string);
  510.         }
  511.         if(GetPlayerScore(killerid) == 10) {
  512.             format(string, sizeof(string), "%s gostou da profissão, ja levou 10 pra cova", serialkiller);
  513.             SendClientMessageToAll(COLOR_RED, string);
  514.         }
  515.         if(GetPlayerScore(killerid) == 25) {
  516.             format(string, sizeof(string), "%s é amigo do diabo, ja levou 25 pra cova", serialkiller);
  517.             SendClientMessageToAll(COLOR_RED, string);
  518.         }
  519.         if(GetPlayerScore(killerid) == 50) {
  520.             format(string, sizeof(string), "%s é o chuck norris dirfarçado, ja levou 50 pra cova", serialkiller);
  521.             SendClientMessageToAll(COLOR_RED, string);
  522.         }
  523.         if(GetPlayerScore(killerid) == 90) {
  524.             format(string, sizeof(string), "%s tá querendo entrar pro Guinnes, ja levou 90 pra cova", serialkiller);
  525.             SendClientMessageToAll(COLOR_RED, string);
  526.         }
  527.         if(GetPlayerScore(killerid) == 150) {
  528.             format(string, sizeof(string), "%s não tem amor pela vida, ja levou 150 pra cova", serialkiller);
  529.             SendClientMessageToAll(COLOR_RED, string);
  530.         }
  531.         if(GetPlayerScore(killerid) == 220) {
  532.             format(string, sizeof(string), "%s é fodão no x1, ja levou 220 pra cova", serialkiller);
  533.             SendClientMessageToAll(COLOR_RED, string);
  534.         }
  535.         if(GetPlayerScore(killerid) == 300) {
  536.             format(string, sizeof(string), "%s tomou gosto pela coisa, ja levou 300 pra cova", serialkiller);
  537.             SendClientMessageToAll(COLOR_RED, string);
  538.         }
  539.         if(GetPlayerScore(killerid) == 400) {
  540.             format(string, sizeof(string), "%s entrou pro Guinnes, ja levou 400 pra cova", serialkiller);
  541.             SendClientMessageToAll(COLOR_RED, string);
  542.         }
  543.         if(GetPlayerScore(killerid) == 550) {
  544.             format(string, sizeof(string), "%s não se contentou com o recorde, ja levou 550 pra cova", serialkiller);
  545.             SendClientMessageToAll(COLOR_RED, string);
  546.         }
  547.         if(GetPlayerScore(killerid) == 800) {
  548.             format(string, sizeof(string), "%s É primo da morte, ja levou 800 pra cova", serialkiller);
  549.             SendClientMessageToAll(COLOR_RED, string);
  550.         }
  551.         if(GetPlayerScore(killerid) == 1200) {
  552.             format(string, sizeof(string), "%s é um zumbi na frente do PC, ja levou 1200 pra cova", serialkiller);
  553.             SendClientMessageToAll(COLOR_RED, string);
  554.         }
  555.         if(GetPlayerScore(killerid) == 1700) {
  556.             format(string, sizeof(string), "%s ta inspirado, ja levou 1700 pra cova", serialkiller);
  557.             SendClientMessageToAll(COLOR_RED, string);
  558.         }
  559.         if(GetPlayerScore(killerid) == 3000) {
  560.             format(string, sizeof(string), "%s é a morte jogando SA-MP, ja levou 3000 pra cova", serialkiller);
  561.             SendClientMessageToAll(COLOR_RED, string);
  562.         }
  563.         if(GetPlayerScore(killerid) == 10000) {
  564.             format(string, sizeof(string), "%s é um viciado, ja levou 10000 pra cova", serialkiller);
  565.             SendClientMessageToAll(COLOR_RED, string);
  566.         }
  567.     }
  568.     return 1;
  569.  
  570. }
  571.  
  572. //------------------------------------------------------------------------------------------------------
  573.  
  574. public OnPlayerRequestClass(playerid, classid)
  575. {
  576.     iSpawnSet[playerid] = 0;
  577.     SetupPlayerForClassSelection(playerid);
  578.      pClass[playerid] = classid;
  579.     TextDrawShowForPlayer(playerid,dTextDraw);
  580.     if(classid == 0)
  581.     {
  582.         GameTextForPlayer(playerid,"~w~Time ~r~Vermelho",5000,3);
  583.     }
  584.     if(classid == 1)
  585.     {
  586.         GameTextForPlayer(playerid,"~w~Time ~r~Vermelho",5000,3);
  587.     }
  588.     if(classid == 2)
  589.     {
  590.         GameTextForPlayer(playerid,"~w~Time ~r~Vermelho",5000,3);
  591.     }
  592.     if(classid == 3)
  593.     {
  594.         GameTextForPlayer(playerid,"~w~Time ~r~Vermelho",5000,3);
  595.     }
  596.     if(classid == 4)
  597.     {
  598.         GameTextForPlayer(playerid,"~w~Time ~b~Azul",5000,3);
  599.     }
  600.     if(classid == 5)
  601.     {
  602.         GameTextForPlayer(playerid,"~w~Time ~b~Azul",5000,3);
  603.     }
  604.     if(classid == 6)
  605.     {
  606.         GameTextForPlayer(playerid,"~w~Time ~b~Azul",5000,3);
  607.     }
  608.     if(classid == 7)
  609.     {
  610.         GameTextForPlayer(playerid,"~w~Time ~b~Azul",50000,3);
  611.     }
  612.     if(classid == 8)
  613.     {
  614.         GameTextForPlayer(playerid,"~w~Time dos ~g~Policiais",5000,3);
  615.     }
  616.     if(classid == 9)
  617.     {
  618.         GameTextForPlayer(playerid,"~w~Time dos ~g~Policiais",5000,3);
  619.     }
  620.     if(classid == 10)
  621.     {
  622.         GameTextForPlayer(playerid,"~w~Time dos ~g~Policiais",5000,3);
  623.     }
  624.     if(classid == 11)
  625.     {
  626.         GameTextForPlayer(playerid,"~w~Time dos ~g~Policiais",5000,3);
  627.     }
  628.     if(classid == 12)
  629.     {
  630.         GameTextForPlayer(playerid,"~w~Time ~p~Roxo",5000,3);
  631.     }
  632.     if(classid == 13)
  633.     {
  634.         GameTextForPlayer(playerid,"~w~Time ~p~Roxo",5000,3);
  635.     }
  636.         if(classid == 14)
  637.     {
  638.         GameTextForPlayer(playerid,"~w~Time ~p~Roxo",5000,3);
  639.     }
  640.         if(classid == 15)
  641.     {
  642.         GameTextForPlayer(playerid,"~w~Time ~p~Roxo",5000,3);
  643.     }
  644.     return 1;
  645. }
  646.  
  647. public SetupPlayerForClassSelection(playerid)
  648. {
  649.     SetPlayerInterior(playerid,0);
  650.     SetPlayerPos(playerid,-371.5435,2134.4326,133.1797);
  651.     SetPlayerFacingAngle(playerid, 179.0);
  652.     SetPlayerCameraPos(playerid,-371.5435,2127.4326,140.1797);
  653.     SetPlayerCameraLookAt(playerid,-371.5435,2134.4326,133.1797);
  654. }
  655.  
  656. public GameModeExitFunc()
  657. {
  658.     GameModeExit();
  659.  
  660.     TextDrawHideForAll(players);
  661.     TextDrawDestroy(players);
  662.  
  663. }
  664.  
  665. public OnGameModeInit()
  666. {
  667.     players = TextDrawCreate(54.000000, 326.000000, "_");
  668.     TextDrawBackgroundColor(players, 255);
  669.     TextDrawFont(players, 2);
  670.     TextDrawLetterSize(players, 0.500000, 1.000000);
  671.     TextDrawColor(players, -65281);
  672.     TextDrawSetOutline(players, 1);
  673.     TextDrawSetProportional(players, 1);
  674.     dTextDraw = TextDrawCreate(510.0000,420.0000,"Mata-Mata Deserto");
  675.     TextDrawFont(dTextDraw, 3);
  676.     TextDrawSetShadow(dTextDraw,0);
  677.     TextDrawSetOutline(dTextDraw,0);
  678.     TextDrawBackgroundColor(dTextDraw,65535);
  679.     TextDrawColor(dTextDraw,COLOR_DGREEN);
  680.     TextDrawLetterSize(dTextDraw, 0.4000,2.2999);
  681.  
  682.     for(new i; i < MAX_PLAYERS; i ++)
  683.     {
  684.         if(IsPlayerConnected(i))
  685.         {
  686.             TextDrawShowForPlayer(i, players);
  687.         }
  688.     }
  689.     SetGameModeText("Guerra Deserto [v0.4]");
  690.     SetTimer("SendMSG", 60000, true);
  691.     SetTimer("PayDay", 600000, true); // 11 minutos
  692.     SendRconCommand("mapname Deserto de LV");
  693.  
  694.     ShowPlayerMarkers(1);
  695.     UsePlayerPedAnims();
  696.     ShowNameTags(1);
  697.     DisableInteriorEnterExits();
  698.     EnableStuntBonusForAll(0);
  699.  
  700.     // Player Class's
  701.     AddPlayerClass(19,2512.8611,-1673.2799,13.5104,87.7485,0,0,0,0,0,0); // Class 0 Vingadores
  702.     AddPlayerClass(40,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 1 Vingadores
  703.     AddPlayerClass(170,2512.8611,-1673.2799,13.5104,87.7485,0,0,0,0,0,0); // Class 2 Vingadores
  704.     AddPlayerClass(190,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 3 Vingadores
  705.     AddPlayerClass(69,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 4 Mercenários
  706.     AddPlayerClass(84,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 5 Mercenários
  707.     AddPlayerClass(177,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 6 Mercenários
  708.     AddPlayerClass(41,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 7 Mercenários
  709.     AddPlayerClass(285,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 8 Agentes
  710.     AddPlayerClass(284,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 9 Agentes
  711.     AddPlayerClass(280,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 10 Agentes
  712.     AddPlayerClass(287,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 11 Agentes
  713.     AddPlayerClass(228,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 12 Terroristas
  714.     AddPlayerClass(217,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 13 Terroristas
  715.     AddPlayerClass(211,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 14 Terroristas
  716.     AddPlayerClass(169,2508.1372,-1656.6781,13.5938,129.4222,0,0,0,0,0,0); // Class 15 Terroristas
  717.  
  718.     // Base Terroristas
  719.  
  720.     AddStaticVehicle(411,390.748,2541.178,16.059,180.000,149,149);
  721.     AddStaticVehicle(411,385.748,2541.178,16.059,180.000,149,149);
  722.     AddStaticVehicle(411,380.748,2541.178,16.059,180.000,149,149);
  723.     AddStaticVehicle(411,375.748,2541.178,16.059,180.000,149,149);
  724.     AddStaticVehicle(411,370.748,2541.178,16.059,180.000,149,149);
  725.     AddStaticVehicle(411,365.748,2541.178,16.059,180.000,149,149);
  726.     AddStaticVehicle(411,360.748,2541.178,16.059,180.000,149,149);
  727.     AddStaticVehicle(411,355.748,2541.178,16.059,180.000,149,149);
  728.     AddStaticVehicle(411,350.748,2541.178,16.059,180.000,149,149);
  729.     AddStaticVehicle(411,345.748,2541.178,16.059,180.000,149,149);
  730.     AddStaticVehicle(487,365.059,2466.570,16.211,0.000,149,149);
  731.     AddStaticVehicle(487,340.059,2466.570,16.211,0.000,149,149);
  732.     AddStaticVehicle(522,418.189,2531.904,16.319,180.000,149,149);
  733.     AddStaticVehicle(522,420.189,2531.904,16.319,180.000,149,149);
  734.     AddStaticVehicle(522,422.189,2531.904,16.319,180.000,149,149);
  735.     AddStaticVehicle(522,424.189,2531.904,16.319,180.000,149,149);
  736.     AddStaticVehicle(522,426.189,2531.904,16.319,180.000,149,149);
  737.  
  738.  
  739.     // Base Mercenarios
  740.  
  741.     AddStaticVehicle(522,-177.707,1225.307,19.469,270.000,79,79);
  742.     AddStaticVehicle(522,-177.707,1222.307,19.469,270.000,79,79);
  743.     AddStaticVehicle(522,-177.707,1219.307,19.469,270.000,79,79);
  744.     AddStaticVehicle(522,-177.707,1216.307,19.469,270.000,79,79);
  745.     AddStaticVehicle(522,-177.707,1213.307,19.469,270.000,79,79);
  746.     AddStaticVehicle(402,-158.171,1229.100,19.469,180.000,79,79);
  747.     AddStaticVehicle(415,-163.171,1229.100,19.469,180.000,79,79);
  748.     AddStaticVehicle(424,-168.171,1229.100,19.469,180.000,79,79);
  749.     AddStaticVehicle(429,-134.379,1217.458,19.469,180.000,79,79);
  750.     AddStaticVehicle(439,-139.379,1217.458,19.469,180.000,79,79);
  751.     AddStaticVehicle(451,-144.379,1217.458,19.469,180.000,79,79);
  752.     AddStaticVehicle(477,-149.379,1217.458,19.469,180.000,79,79);
  753.  
  754.     // Base Vingadores
  755.  
  756.     AddStaticVehicle(522,730.545,1949.693,5.103,180.000,3,3);
  757.     AddStaticVehicle(522,726.545,1949.693,5.103,180.000,3,3);
  758.     AddStaticVehicle(402,721.664,1949.693,5.103,180.000,3,3);
  759.     AddStaticVehicle(415,716.230,1949.693,5.103,180.000,3,3);
  760.     AddStaticVehicle(424,711.663,1949.693,5.103,180.000,3,3);
  761.     AddStaticVehicle(429,706.816,1949.693,5.103,180.000,3,3);
  762.     AddStaticVehicle(522,701.105,1949.693,5.103,180.000,3,3);
  763.     AddStaticVehicle(522,696.453,1949.693,5.103,180.000,3,3);
  764.     AddStaticVehicle(439,691.637,1949.693,5.103,180.000,3,3);
  765.     AddStaticVehicle(451,686.793,1949.693,5.103,180.000,3,3);
  766.     AddStaticVehicle(477,681.548,1949.693,5.103,180.000,3,3);
  767.     AddStaticVehicle(522,676.445,1949.693,5.103,180.000,3,3);
  768.  
  769.     // Base Agentes do Governo
  770.  
  771.     AddStaticVehicle(523,-527.113,2579.040,52.984,90.000,11,11); // HPV 1000
  772.     AddStaticVehicle(523,-527.113,581.454,52.984,90.000,11,11); // HPV 1000
  773.     AddStaticVehicle(523,-527.113,2576.397,52.984,90.000,11,11); // HPV 1000
  774.     AddStaticVehicle(523,-527.113,2573.866,52.984,90.000,11,11); // HPV 1000
  775.     AddStaticVehicle(523,-527.113,2571.356,52.984,90.000,11,11); // HPV 1000
  776.     AddStaticVehicle(598,-529.922,2563.687,52.979,90.000,11,11); // LVPD
  777.     AddStaticVehicle(598,-529.992,2558.218,52.979,90.000,11,11); // LVPD
  778.     AddStaticVehicle(598,-521.068,2559.008,52.978,270.000,11,11); // LVPD
  779.     AddStaticVehicle(598,-521.068,2564.219,52.979,270.000,11,11); // LVPD
  780.     AddStaticVehicle(598,-521.068,2569.458,52.979,270.000,11,11); // LVPD
  781.     AddStaticVehicle(528,-519.800,2577.061,52.985,270.000,11,11); // FBI
  782.     AddStaticVehicle(528,-519.800,2582.120,52.985,270.000,11,11); // FBI
  783.     AddStaticVehicle(470,-538.258,2603.697,52.980,270.000,11,11); // Patriot
  784.     AddStaticVehicle(470,-538.258,2608.662,52.980,270.000,11,11); // Patriot
  785.     AddStaticVehicle(470,-538.258,2613.509,52.980,270.000,11,11); // Patriot
  786.     AddStaticVehicle(470,-538.258,2618.340,52.980,270.000,11,11); // Patriot
  787.     AddStaticVehicle(470,-538.258,2623.540,52.980,270.000,11,11); // Patriot
  788.     AddStaticVehicle(497,-510.126,2632.243,52.979,90.000,11,11); // Heli
  789.     AddStaticVehicle(497,-511.969,2605.545,52.980,90.000,11,11); // Heli
  790.  
  791.     // Carros espalhados
  792.  
  793.     AddStaticVehicle(568,9.2662,1231.0234,18.9078,89.6072,1,1); //
  794. AddStaticVehicle(424,16.2422,1166.0085,19.1346,0.1662,2,2); //
  795. AddStaticVehicle(495,18.4716,1353.1819,8.7386,23.3455,3,3); //
  796. AddStaticVehicle(505,-34.4963,1377.6820,8.8819,141.9388,4,4); //
  797. AddStaticVehicle(403,-100.1622,1380.6021,9.8428,105.4320,5,5); //
  798. AddStaticVehicle(413,-89.2076,1535.0980,16.1564,35.0308,6,6); //
  799. AddStaticVehicle(421,-165.2876,1676.9580,14.3540,19.4646,7,7); //
  800. AddStaticVehicle(422,-57.6921,1841.9924,17.1237,74.9541,8,8); //
  801. AddStaticVehicle(426,-231.4026,2042.8424,28.7066,347.3830,9,9); //
  802. AddStaticVehicle(434,-38.0279,2236.6855,37.8787,309.6378,10,10); //
  803. AddStaticVehicle(463,-22.2527,2333.0918,23.7102,5.7975,11,11); //
  804. AddStaticVehicle(471,-241.0324,2595.2539,62.2753,358.2202,12,12); //
  805. AddStaticVehicle(568,-204.4339,2595.8342,62.2612,358.0206,13,13); //
  806. AddStaticVehicle(424,-223.0472,2770.4795,62.2559,179.0655,14,14); //
  807. AddStaticVehicle(495,-275.9200,2718.8606,62.1983,6.1004,15,15); //
  808. AddStaticVehicle(505,-600.7001,2701.3452,71.8574,115.1483,16,16); //
  809. AddStaticVehicle(413,-682.1919,2705.9470,69.1983,147.5775,17,17); //
  810. AddStaticVehicle(403,-767.0948,2760.2974,45.3398,180.6232,18,18); //
  811. AddStaticVehicle(421,-840.2679,2742.2256,45.3325,183.0326,19,19); //
  812. AddStaticVehicle(422,-1316.2272,2696.1790,49.6391,118.6256,20,20); //
  813. AddStaticVehicle(426,-1399.9670,2640.6926,55.2526,85.5841,21,21); //
  814. AddStaticVehicle(434,-1401.2579,2656.4988,55.2537,86.8121,22,22); //
  815. AddStaticVehicle(463,-1506.9604,2525.9380,55.2563,0.3813,23,23); //
  816. AddStaticVehicle(471,-1526.2809,2638.7605,55.3870,96.9867,24,24); //
  817.  
  818.  
  819.     return 1;
  820. }
  821.  
  822. public SendMSG()
  823. {
  824.   new random2 = random(sizeof(RandomColors));
  825.   new randMSG = random(sizeof(RandomMSG));
  826.   SendClientMessageToAll(RandomColors[random2], RandomMSG[randMSG]);
  827. }
  828. public PayDay()
  829. {
  830. for(new i=0; i<=MAX_PLAYERS; i++) GivePlayerMoney(i, 10000);
  831. SendClientMessageToAll(COLOR_RED, "PayDay! Salário: 10000");
  832. }
  833.  
  834. public SendPlayerFormattedText(playerid, const str[], define)
  835. {
  836.     new tmpbuf[256];
  837.     format(tmpbuf, sizeof(tmpbuf), str, define);
  838.     SendClientMessage(playerid, 0xFF004040, tmpbuf);
  839. }
  840.  
  841. public SendAllFormattedText(playerid, const str[], define)
  842. {
  843.     new tmpbuf[256];
  844.     format(tmpbuf, sizeof(tmpbuf), str, define);
  845.     SendClientMessageToAll(0xFFFF00AA, tmpbuf);
  846. }
  847.  
  848. strtok(const string[], &index)
  849. {
  850.     new length = strlen(string);
  851.     while ((index < length) && (string[index] <= ' '))
  852.     {
  853.         index++;
  854.     }
  855.  
  856.     new offset = index;
  857.     new result[20];
  858.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  859.     {
  860.         result[index - offset] = string[index];
  861.         index++;
  862.     }
  863.     result[index - offset] = EOS;
  864.     return result;
  865. }
  866.  
  867.  
  868. stock GetOnLinePlayers()
  869. {
  870.     new OnLine;
  871.     for(new i, g = GetMaxPlayers(); i < g; i++)
  872.         if(IsPlayerConnected(i))
  873.             OnLine++;
  874.     return OnLine;
  875. }
Advertisement
Add Comment
Please, Sign In to add comment