Advertisement
razvan_xd

Untitled

Jul 28th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.38 KB | None | 0 0
  1. //-----------------------------------[HEAL]-------------------------------------------------------------------------
  2.     if(strcmp(cmd, "/vindeca", true) == 0)
  3.     {
  4.         if(IsPlayerConnected(playerid))
  5.         {
  6.             tmp = strtok(cmdtext, idx);
  7.             GetPlayerName(playerid, sendername, sizeof(sendername));
  8.             new location = PlayerInfo[playerid][pLocal];
  9.             if(!strlen(tmp))
  10.             {
  11.                 if(location != 255)
  12.                 {
  13.                     if(location < 99)
  14.                     {
  15.                         if(HouseInfo[location][hArm] == 1 && IsACop(playerid))
  16.                         {
  17.                             format(string, sizeof(string), "* %s isi pune o vesta.", sendername);
  18.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  19.                             SetPlayerArmour(playerid, 100.0);
  20.                             TogglePlayerControllable(playerid, 0);
  21.                             GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
  22.                             Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
  23.                             Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
  24.                             SetPlayerPos(playerid,1527.5,-12.1,1002.0);
  25.                             PlayerInfo[playerid][pLocal] = 255;
  26.                             SetPlayerInterior(playerid,99);
  27.                             Spectate[playerid] = 257;
  28.                         }
  29.                         else
  30.                         {
  31.                             format(string, sizeof(string), "In acest loc nu sunt veste.");
  32.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  33.                         }
  34.                         if(HouseInfo[location][hHel] == 1)
  35.                         {
  36.                             new Float:tempheal;
  37.                             GetPlayerHealth(playerid,tempheal);
  38.                             if ( tempheal < 100.0)
  39.                             {
  40.                                 SetPlayerHealth(playerid,100.0);
  41.                                 PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  42.                                 format(string, sizeof(string), "Sanatatea ta este foarte buna.");
  43.                                 SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  44.                             }
  45.                             else
  46.                             {
  47.                                 SendClientMessage(playerid, TEAM_GREEN_COLOR,"Deja ai sanatate buna.");
  48.                             }
  49.                         }
  50.                         else
  51.                         {
  52.                             format(string, sizeof(string), "Nu sunt medicamente.");
  53.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  54.                         }
  55.                         return 1;
  56.                     }
  57.                     else if(location == 101)//Restaurant
  58.                     {
  59.                         new Float:tempheal;
  60.                         GetPlayerHealth(playerid,tempheal);
  61.                         if ( tempheal < 100.0)
  62.                         {
  63.                             SetPlayerHealth(playerid,100.0);
  64.                             PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  65.                             format(string, sizeof(string), "Sanatatea ta este foarte buna.");
  66.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
  67.                         }
  68.                         else
  69.                         {
  70.                             SendClientMessage(playerid, TEAM_GREEN_COLOR,"Deja ai sanatatea buna.");
  71.                         }
  72.                     }
  73.                     else if(location == 102 && IsACop(playerid))//Police Armoury
  74.                     {
  75.                         SetPlayerHealth(playerid,100.0);
  76.                         format(string, sizeof(string), "* %s isi pune o vesta.", sendername);
  77.                         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  78.                         TogglePlayerControllable(playerid, 0);
  79.                         GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
  80.                         Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
  81.                         Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
  82.                         SetPlayerPos(playerid,1527.5,-12.1,1002.0);
  83.                         PlayerInfo[playerid][pLocal] = 255;
  84.                         SetPlayerInterior(playerid,99);
  85.                         Spectate[playerid] = 257;
  86.                         SetPlayerArmour(playerid, 100.0);
  87.                     }
  88.                 }
  89.                 else
  90.                 {
  91.                     SendClientMessage(playerid, COLOR_GRAD2, "USE: /vindeca [IdJucator] [pret]");
  92.                     return 1;
  93.                 }
  94.             }
  95.             giveplayerid = ReturnUser(tmp);
  96.             tmp = strtok(cmdtext, idx);
  97.             if(!strlen(tmp))
  98.             {
  99.                 SendClientMessage(playerid, COLOR_GRAD2, "USE: /vindeca [IdJucador] [pret]");
  100.                 return 1;
  101.             }
  102.             moneys = strval(tmp);
  103.             if(moneys < 1 || moneys > 20) { SendClientMessage(playerid, COLOR_GREY, "   Minim 1 sau maxim 20!(Pentru ca ati facut abuz)"); return 1; }
  104.             if (giveplayerid == playerid)
  105.             {
  106.                 SendClientMessage(playerid, COLOR_GRAD1, "  Nu te poti lecui!");
  107.                 return 1;
  108.             }
  109.             if (IsPlayerConnected(giveplayerid))
  110.             {
  111.                 if(giveplayerid != INVALID_PLAYER_ID)
  112.                 {
  113.                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  114.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  115.                     /*new giveambu = GetPlayerVehicleID(giveplayerid);
  116.                     new playambu = GetPlayerVehicleID(playerid);*/
  117.      if(IsAMedic(playerid))//model
  118.                     {
  119.                             new Float:tempheal;
  120.                             GetPlayerHealth(giveplayerid,tempheal);
  121.                             if(tempheal >= 100.0)
  122.                             {
  123.                                 SendClientMessage(playerid, TEAM_GREEN_COLOR,"   Aceasta persoana are sanatatea foarte buna.");
  124.                                 return 1;
  125.                             }
  126.                             format(string, sizeof(string), "~y~L-ai vindecat pe ~n~~w~%s~n~~g~$%d", giveplayer,moneys);
  127.                             GameTextForPlayer(playerid, string, 5000, 1);
  128.                             SafeGivePlayerMoney(playerid,moneys);
  129.                             SafeGivePlayerMoney(giveplayerid,-moneys);
  130.                             new hp = 0;
  131.                             if(PlayerInfo[playerid][pPainPerk] > 0)
  132.                             {
  133.                                 hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100;
  134.                                 SetPlayerHealth(giveplayerid, hp);
  135.                             }
  136.                             else
  137.                             {
  138.                                 hp = 100;
  139.                                 SetPlayerHealth(giveplayerid, 100);
  140.                             }
  141.                             KillTimer(TimerViata[giveplayerid]);
  142.                             SetPVarInt(giveplayerid, "AsteptandSalvarea", 0);
  143.                             TogglePlayerControllable(giveplayerid, true);
  144.                             ClearAnimations(giveplayerid);
  145.                             PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  146.                             PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0);
  147.                             format(string, sizeof(string), "Ati fost vindecat! HP actual: %d, cost: $%d",hp,moneys);
  148.                             SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
  149.                             if(STDPlayer[giveplayerid] > 0)
  150.                             {
  151.                                 STDPlayer[giveplayerid] = 0;
  152.                                 SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Nu mai esti infectat cu SIDA!");
  153.                             }
  154.                             if(MensajeMuriendo[giveplayerid] == 0)
  155.                             {
  156.                                 STDPlayer[giveplayerid] = 0;
  157.                                 MensajeMuriendo[giveplayerid] = 1;
  158.                                 SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Esti vindecat!");
  159.                                 TogglePlayerControllable(giveplayerid,1);
  160.                             }
  161.                     }
  162.                     else
  163.                     {
  164.                         SendClientMessage(playerid, COLOR_GRAD1, "  Nu poti folosi acest cmd!");
  165.                         return 1;
  166.                     }
  167.                 }
  168.             }
  169.             else
  170.             {
  171.                 format(string, sizeof(string), "   %d nu este conectat.", giveplayerid);
  172.                 SendClientMessage(playerid, COLOR_GRAD1, string);
  173.             }
  174.         }
  175.         return 1;
  176.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement