Advertisement
Guest User

GM

a guest
Aug 14th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.16 KB | None | 0 0
  1. //Spawn Carros
  2.     if (strcmp(cmd, "/destruirid", true) == 0)
  3.     {
  4.         if(IsPlayerConnected(playerid))
  5.         {
  6.             if(PlayerInfo[playerid][pAdmin] < 3)
  7.             {
  8.                 SendClientMessage(playerid, COLOR_GRAD1, "   Você não está autorizado a usar este comando !");
  9.                 return true;
  10.             }
  11.    if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
  12.             {
  13.                 SendClientMessage(playerid, COLOR_GRAD1, "Você não está trabalhando! (/trabalhar)");
  14.                 return true;
  15.             }
  16.             new counter = 0;
  17.             new result;
  18.             new plyName[MAX_PLAYER_NAME];
  19.             GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  20.             for(new i; i != MAX_VEHICLES; i++)
  21.             {
  22.                 new dist = ChecarveiculoThiago(5, playerid, i);
  23.                 if(dist)
  24.                 {
  25.                     result = i;
  26.                     counter++;
  27.                 }
  28.             }
  29.             switch(counter)
  30.             {
  31.                 case 0:
  32.                 {
  33.                     SendClientMessage(playerid, COLOR_GREY, "   Não há nenhum carro nesse raio!");
  34.                 }
  35.                 case 1:
  36.                 {
  37.                     if(result < CAR_AMOUNT)
  38.                     {
  39.                         SendClientMessage(playerid, COLOR_GREY, "Você só pode destruir veículos criados");
  40.                         return true;
  41.                     }
  42.                     new name[MAX_PLAYER_NAME];
  43.                     GetPlayerName(playerid, name, sizeof(name));
  44.                     DestroyVehicle(result);
  45.                     format(string, sizeof(string), "Você destruiu o veículo ID:[%d]", result);
  46.                     SendClientMessage(playerid, COLOR_GREY, string);
  47.                     if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
  48.                     {
  49.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi destruido Por: ADM_Bot", result);
  50.                         ABroadCast(COLOR_YELLOW,string,1);
  51.                     }
  52.                     else
  53.                     {
  54.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi destruido Por: %s", result, name);
  55.                         ABroadCast(COLOR_YELLOW,string,1);
  56.                     }
  57.                 }
  58.                 default:
  59.                 {
  60.                     SendClientMessage(playerid, COLOR_GREY, "   Foram encontrados mais de um carro nesse raio");
  61.                 }
  62.             }
  63.         }
  64.         return true;
  65.     }
  66.     if (strcmp(cmd, "/respawnid", true) == 0)
  67.     {
  68.         if(IsPlayerConnected(playerid))
  69.         {
  70.             if(PlayerInfo[playerid][pAdmin] < 3)
  71.             {
  72.                 SendClientMessage(playerid, COLOR_GRAD1, "   Você não está autorizado a usar este comando !");
  73.                 return true;
  74.             }
  75.    if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
  76.             {
  77.                 SendClientMessage(playerid, COLOR_GRAD1, "Você não está trabalhando! (/trabalhar)");
  78.                 return true;
  79.             }
  80.             new counter = 0;
  81.             new result;
  82.             new plyName[MAX_PLAYER_NAME];
  83.             GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  84.             for(new i; i != MAX_VEHICLES; i++)
  85.             {
  86.                 new dist = ChecarveiculoThiago(5, playerid, i);
  87.                 if(dist)
  88.                 {
  89.                     result = i;
  90.                     counter++;
  91.                 }
  92.             }
  93.             switch(counter)
  94.             {
  95.                 case 0:
  96.                 {
  97.                     SendClientMessage(playerid, COLOR_GREY, "   Não há nenhum carro nesse raio!");
  98.                 }
  99.                 case 1:
  100.                 {
  101.                     new name[MAX_PLAYER_NAME];
  102.                     GetPlayerName(playerid, name, sizeof(name));
  103.                     format(string, sizeof(string), "Você deu respawn no carro ID:[%d]", result);
  104.                     SendClientMessage(playerid, COLOR_GREY, string);
  105.                     if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
  106.                     {
  107.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi respawnado Por: ADM_Bot", result);
  108.                         ABroadCast(COLOR_YELLOW,string,1);
  109.                     }
  110.                     else
  111.                     {
  112.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi respawnado Por: %s", result, name);
  113.                         ABroadCast(COLOR_YELLOW,string,1);
  114.                     }
  115.                     SetVehicleToRespawn(result);
  116.                 }
  117.                 default:
  118.                 {
  119.                     SendClientMessage(playerid, COLOR_GREY, "   Foram encontrados mais de um carro nesse raio");
  120.                 }
  121.             }
  122.         }
  123.         return true;
  124.     }
  125.     if (strcmp(cmd, "/abastecerid", true) == 0)
  126.     {
  127.         if(IsPlayerConnected(playerid))
  128.         {
  129.             if(PlayerInfo[playerid][pAdmin] < 3)
  130.             {
  131.                 SendClientMessage(playerid, COLOR_GRAD1, "   Você não está autorizado a usar este comando !");
  132.                 return true;
  133.             }
  134.    if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
  135.             {
  136.                 SendClientMessage(playerid, COLOR_GRAD1, "Você não está trabalhando! (/trabalhar)");
  137.                 return true;
  138.             }
  139.             new counter = 0;
  140.             new result;
  141.             new plyName[MAX_PLAYER_NAME];
  142.             GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  143.             for(new i; i != MAX_VEHICLES; i++)
  144.             {
  145.                 new dist = ChecarveiculoThiago(5, playerid, i);
  146.                 if(dist)
  147.                 {
  148.                     result = i;
  149.                     counter++;
  150.                 }
  151.             }
  152.             switch(counter)
  153.             {
  154.                 case 0:
  155.                 {
  156.                     SendClientMessage(playerid, COLOR_GREY, "   Não há nenhum carro nesse raio!");
  157.                 }
  158.                 case 1:
  159.                 {
  160.                     new name[MAX_PLAYER_NAME];
  161.                     GetPlayerName(playerid, name, sizeof(name));
  162.                     format(string, sizeof(string), "Você abasteceu o carro ID:[%d]", result);
  163.                     SendClientMessage(playerid, COLOR_GREY, string);
  164.                     if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
  165.                     {
  166.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi abastecido Por: Homem_Aranha, result);
  167.                         ABroadCast(COLOR_YELLOW,string,1);
  168.                     }
  169.                     else
  170.                     {
  171.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi abastecido Por: %s", result, name);
  172.                         ABroadCast(COLOR_YELLOW,string,1);
  173.                     }
  174.                     Gas[result] = 100;
  175.                 }
  176.                 default:
  177.                 {
  178.                     SendClientMessage(playerid, COLOR_GREY, "   Foram encontrados mais de um carro nesse raio");
  179.                 }
  180.             }
  181.         }
  182.         return true;
  183.     }
  184.     if (strcmp(cmd, "/repararid", true) == 0)
  185.     {
  186.         if(IsPlayerConnected(playerid))
  187.         {
  188.             if(PlayerInfo[playerid][pAdmin] < 3)
  189.             {
  190.                 SendClientMessage(playerid, COLOR_GRAD1, "   Você não está autorizado a usar este comando !");
  191.                 return true;
  192.             }
  193.   if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
  194.             {
  195.                 SendClientMessage(playerid, COLOR_GRAD1, "Você não está trabalhando! (/trabalhar)");
  196.                 return true;
  197.             }
  198.             new counter = 0;
  199.             new result;
  200.             new plyName[MAX_PLAYER_NAME];
  201.             GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  202.             for(new i; i != MAX_VEHICLES; i++)
  203.             {
  204.                 new dist = ChecarveiculoThiago(5, playerid, i);
  205.                 if(dist)
  206.                 {
  207.                     result = i;
  208.                     counter++;
  209.                 }
  210.             }
  211.             switch(counter)
  212.             {
  213.                 case 0:
  214.                 {
  215.                     SendClientMessage(playerid, COLOR_GREY, "   Não há nenhum carro nesse raio!");
  216.                 }
  217.                 case 1:
  218.                 {
  219.                     new name[MAX_PLAYER_NAME];
  220.                     GetPlayerName(playerid, name, sizeof(name));
  221.                     format(string, sizeof(string), "Você reparou o carro ID:[%d]", result);
  222.                     SendClientMessage(playerid, COLOR_GREY, string);
  223.                     if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
  224.                     {
  225.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi reparado Por: ADM_Bot", result);
  226.                         ABroadCast(COLOR_YELLOW,string,1);
  227.                     }
  228.                     else
  229.                     {
  230.                         format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi reparado Por: %s", result, name);
  231.                         ABroadCast(COLOR_YELLOW,string,1);
  232.                     }
  233.                     RepairVehicle(result);
  234.                 }
  235.                 default:
  236.                 {
  237.                     SendClientMessage(playerid, COLOR_GREY, "   Foram encontrados mais de um carro nesse raio");
  238.                 }
  239.             }
  240.         }
  241.         return true;
  242.     }
  243.    if(strcmp(cmd, "/respawncarros", true) == 0)
  244.     {
  245.         if(IsPlayerConnected(playerid))
  246.         {
  247.             if (PlayerInfo[playerid][pAdmin] < 4)
  248.             {
  249.                 SendClientMessage(playerid, COLOR_GRAD1, "   Você não está autorizado a usar este comando !");
  250.                 return true;
  251.             }
  252.             GetPlayerName(playerid, playername, sizeof(playername));
  253.             if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
  254.             {
  255.                 format(string, sizeof(string), "{FFFFFF}[{37E031}Atenção{FFFFFF}] Todos os carros foram para seus locais de inicio. By: ADM_Bot.");
  256.             }
  257.             else
  258.             {
  259.                 format(string, sizeof(string), "{FFFFFF}[{37E031}Atenção{FFFFFF}] Todos os veículos foram para seus locais de inicio. By: {FFEA00}%s.", playername);
  260.             }
  261.             SendClientMessageToAll(COLOR_RCARRO,string);
  262.             new bool:unwanted[CAR_AMOUNT];
  263.             for(new player=0; player<MAX_PLAYERS; player++)
  264.             {
  265.                 if(IsPlayerConnected(player) && IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
  266.             }
  267.             for(new car = 1; car <= CAR_AMOUNT; car++)
  268.             {
  269.                 if(!unwanted[car]) SetVehicleToRespawn(car);
  270.             }
  271.         }
  272.         return 0;
  273.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement