Guest User

Untitled

a guest
Jan 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.00 KB | None | 0 0
  1.     if(strcmp(cmd, "/vida", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             tmp = strtok(cmdtext, idx);
  6.             GetPlayerName(playerid, sendername, sizeof(sendername));
  7.             new location = PlayerInfo[playerid][pLocal];
  8.             if(!strlen(tmp))
  9.             {
  10.                 if(location != 255)
  11.                 {
  12.                     if(location < 99)
  13.                     {
  14.                         if(HouseInfo[location][hArm] == 1 && IsACop(playerid))
  15.                         {
  16.                             format(string, sizeof(string), "* %s Foi Curado.", sendername);
  17.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  18.                             TogglePlayerControllable(playerid, 0);
  19.                             GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
  20.                             Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
  21.                             Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
  22.                             SetPlayerPos(playerid,1527.5,-12.1,1002.0);
  23.                             PlayerInfo[playerid][pLocal] = 255;
  24.                             SetPlayerInterior(playerid,99);
  25.                             Spectate[playerid] = 257;
  26.                         }
  27.                         else
  28.                         {
  29.                             format(string, sizeof(string), "Este lugar nao tem lugar de se curar.");
  30.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  31.                         }
  32.                         if(HouseInfo[location][hHel] == 1)
  33.                         {
  34.                             new Float:tempheal;
  35.                             GetPlayerHealth(playerid,tempheal);
  36.                             if ( tempheal < 100.0)
  37.                             {
  38.                                 SetPlayerHealth(playerid,100.0);
  39.                                 PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  40.                                 format(string, sizeof(string), "Voce foi curando com *100* para sua vida.");
  41.                                 HouseInfo[location][hHel] = 0;
  42.                                 SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  43.                             }
  44.                             else
  45.                             {
  46.                                 SendClientMessage(playerid, TEAM_GREEN_COLOR,"Voce ja esta curado.");
  47.                             }
  48.                         }
  49.                         else
  50.                         {
  51.                             format(string, sizeof(string), "Este lugar nao tem lugar de se curar.");
  52.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  53.                         }
  54.                         return 1;
  55.                     }
  56.                     else if(location == 101)//Restaurant
  57.                     {
  58.                         new Float:tempheal;
  59.                         GetPlayerHealth(playerid,tempheal);
  60.                         if ( tempheal < 100.0)
  61.                         {
  62.                             SetPlayerHealth(playerid,100.0);
  63.                             PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  64.                             format(string, sizeof(string), "Voce foi curando com *100* para sua vida.");
  65.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  66.                         }
  67.                         else
  68.                         {
  69.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,"Voce ja esta curado.");
  70.                         }
  71.                     }
  72.                     else if(location == 102 && IsACop(playerid))//Police Armorry
  73.                     {
  74.                         SetPlayerHealth(playerid,100.0);
  75.                         format(string, sizeof(string), "* %s Foi Curado.", sendername);
  76.                         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  77.                         TogglePlayerControllable(playerid, 0);
  78.                         GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
  79.                         Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
  80.                         Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
  81.                         SetPlayerPos(playerid,1527.5,-12.1,1002.0);
  82.                         PlayerInfo[playerid][pLocal] = 255;
  83.                         SetPlayerInterior(playerid,99);
  84.                         Spectate[playerid] = 257;
  85.                     }
  86.                 }
  87.                 else
  88.                 {
  89.                     SendClientMessage(playerid, COLOR_GRAD2, "USE: /vida [ id ] [price]");
  90.                     return 1;
  91.                 }
  92.             }
  93.             giveplayerid = ReturnUser(tmp);
  94.             tmp = strtok(cmdtext, idx);
  95.             if(!strlen(tmp))
  96.             {
  97.                 SendClientMessage(playerid, COLOR_GRAD2, "USE: /vida [ id ] [price]");
  98.                 return 1;
  99.             }
  100.             moneys = strval(tmp);
  101.             if(moneys < 1 || moneys > 1000) { SendClientMessage(playerid, COLOR_GREY, "   O Preco nao pode passar de 1000 !"); return 1; }
  102.             if (giveplayerid == playerid)
  103.             {
  104.                 SendClientMessage(playerid, COLOR_GRAD1, "   Voce nao pode se curar!");
  105.                 return 1;
  106.             }
  107.             if (IsPlayerConnected(giveplayerid))
  108.             {
  109.                 if(giveplayerid != INVALID_PLAYER_ID)
  110.                 {
  111.                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  112.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  113.                     if(gTeam[playerid] == TEAM_CYAN||PlayerInfo[playerid][pMembro]==4||PlayerInfo[playerid][pLider]==4)//model
  114.                     {
  115.                         new Veh = GetPlayerVehicleID(playerid);
  116.                         if(IsAnAmbulanceCar(Veh))
  117.                         {
  118.                             new Float:tempheal;
  119.                             GetPlayerHealth(giveplayerid,tempheal);
  120.                             if(tempheal >= 100.0)
  121.                             {
  122.                                 SendClientMessage(playerid, TEAM_GREEN_COLOR,"   Este player ja esta curado.");
  123.                                 return 1;
  124.                             }
  125.                             format(string, sizeof(string), "~y~Voce foi curado ~n~~w~%s~n~~g~R$%d", giveplayer,moneys);
  126.                             GameTextForPlayer(playerid, string, 5000, 1);
  127.                             GivePlayerMoneyEx(playerid,moneys);
  128.                             GivePlayerMoneyEx(giveplayerid,-moneys);
  129.                             new hp = 0;
  130.                             if(PlayerInfo[playerid][pPainPerk] > 0)
  131.                             {
  132.                                 hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100;
  133.                                 SetPlayerHealth(giveplayerid, hp);
  134.                             }
  135.                             else
  136.                             {
  137.                                 hp = 100;
  138.                                 SetPlayerHealth(giveplayerid, 100);
  139.                             }
  140.                             PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  141.                             PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0);
  142.                             format(string, sizeof(string), "Voce foi curado, %d de saude por -R$%d",hp,moneys);
  143.                             SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
  144.                             if(DSTPlayer[giveplayerid] > 0)
  145.                             {
  146.                                 DSTPlayer[giveplayerid] = 0;
  147.                                 SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Voce nao esta infectado com nem uma DST, por causa de ajuda medicas!");
  148.                             }
  149.                         }
  150.                         else
  151.                         {
  152.                             SendClientMessage(playerid, COLOR_GRAD1, "   Um de vocês não está no veiculo !");
  153.                             return 1;
  154.                         }
  155.                     }
  156.                     else
  157.                     {
  158.                         SendClientMessage(playerid, COLOR_GRAD1, "Você não está autorizado a usar o comando!");
  159.                         return 1;
  160.                     }
  161.                 }
  162.             }
  163.             else
  164.             {
  165.                 format(string, sizeof(string), "   %d e um player desativado.", giveplayerid);
  166.                 SendClientMessage(playerid, COLOR_GRAD1, string);
  167.             }
  168.         }
  169.         return 1;
  170.     }
Add Comment
Please, Sign In to add comment