Guest User

Untitled

a guest
May 20th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.94 KB | None | 0 0
  1. //==========================[Âûåçä èç ãàðàæà]===================================
  2. if(strcmp(cmd, "/gexit", true) == 0)
  3. {
  4.     if(IsPlayerConnected(playerid))
  5.     {
  6.         if(PlayerToKvadrat(playerid, 2237.1670, -2324.4834, 2269.6880, -2279.6177))
  7.         {
  8.             if (GetPlayerState(playerid) == 2)
  9.             {
  10.                 SetVehiclePos(GetPlayerVehicleID(playerid), 2252.3154,-2321.4077,21.5805);
  11.                 SetVehicleZAngle(GetPlayerVehicleID(playerid), 183.8832);
  12.             }
  13.             else
  14.             {
  15.                 SetPlayerPos(playerid, 2250.9250,-2323.8477,21.9625);
  16.             }
  17.                 SendClientMessage(playerid, COLOR_GRAD1, "Âû âûéõàëè èç ãàðàæà!");
  18.             }
  19.             else
  20.             {
  21.             SendClientMessage(playerid, COLOR_GRAD1, "Âû íå â ãàðàæå!");
  22.         }
  23.     }
  24.     return 1;
  25. }
  26. //==========================[Âúåçä â ãàðàæè]====================================
  27. if(strcmp(cmd, "/garage", true) == 0)
  28. {
  29.     if(PlayerInfo[playerid][pPgaragekey] != 255)
  30.     {
  31.         tmp = strtok(cmdtext, idx);
  32.         new tmpcar = GetPlayerVehicleID(playerid);
  33.         garagenum = strval(tmp);
  34.         if(garagenum == 1)
  35.         {
  36.             if (PlayerToPoint(2.5, playerid,2256.9060,-2320.4949,21.9625))
  37.             {
  38.                 SetVehiclePos(tmpcar, 2243.3142,-2320.2605,21.5830);
  39.                 SetVehicleZAngle(tmpcar, 270.7682);
  40.                 SetPlayerPos(playerid, 2245.8423,-2317.7783,21.9625);
  41.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  42.             }
  43.         }
  44.         else if(garagenum == 2)
  45.         {
  46.             if (PlayerToPoint(2.5, playerid,2256.6345,-2313.0808,21.9625))
  47.             {
  48.                 SetVehiclePos(tmpcar, 2243.2529,-2312.8540,21.5839);
  49.                 SetVehicleZAngle(tmpcar, 272.8101);
  50.                 SetPlayerPos(playerid, 2246.5332,-2310.4453,21.9625);
  51.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  52.             }
  53.         }
  54.         else if(garagenum == 3)
  55.         {
  56.             if (PlayerToPoint(2.5, playerid,2257.2866,-2305.2278,21.9625))
  57.             {
  58.                 SetVehiclePos(tmpcar,2243.3406,-2305.1606,21.5850);
  59.                 SetVehicleZAngle(tmpcar,272.1346);
  60.                 SetPlayerPos(playerid,2246.2175,-2302.9695,21.9625);
  61.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  62.             }
  63.         }
  64.         else if(garagenum == 4)
  65.         {
  66.             if (PlayerToPoint(2.5, playerid,2257.2029,-2297.5176,21.9625))
  67.             {
  68.                 SetVehiclePos(tmpcar,2242.8269,-2297.7490,21.5829);
  69.                 SetVehicleZAngle(tmpcar,271.0504);
  70.                 SetPlayerPos(playerid,2246.3472,-2295.3289,21.9625);
  71.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  72.             }
  73.         }
  74.         else if(garagenum == 5)
  75.         {
  76.             if (PlayerToPoint(2.5, playerid,2257.2825,-2290.9556,21.9625))
  77.             {
  78.                 SetVehiclePos(tmpcar,2243.1101,-2290.9460,21.5835);
  79.                 SetVehicleZAngle(tmpcar,274.0207);
  80.                 SetPlayerPos(playerid,2246.1550,-2288.8042,21.9625);
  81.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  82.             }
  83.         }
  84.         else if(garagenum == 6)
  85.         {
  86.             if (PlayerToPoint(2.5, playerid,2257.0667,-2283.6091,21.9625))
  87.             {
  88.                 SetVehiclePos(tmpcar,2243.2046,-2283.7122,21.5841);
  89.                 SetVehicleZAngle(tmpcar,271.6969);
  90.                 SetPlayerPos(playerid,2246.7976,-2281.2944,21.9625);
  91.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  92.             }
  93.         }
  94.         else if(garagenum == 7)
  95.         {
  96.             if (PlayerToPoint(2.5, playerid,2250.1541,-2283.4910,21.9625))
  97.             {
  98.                 SetVehiclePos(tmpcar,2263.1626,-2320.2600,21.5837);
  99.                 SetVehicleZAngle(tmpcar,91.3686);
  100.                 SetPlayerPos(playerid,2260.2988,-2318.2815,21.9625);
  101.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  102.             }
  103.         }
  104.         else if(garagenum == 8)
  105.         {
  106.             if (PlayerToPoint(2.5, playerid,2249.7822,-2290.3433,21.9625))
  107.             {
  108.                 SetVehiclePos(tmpcar,2263.8469,-2312.8611,21.5856);
  109.                 SetVehicleZAngle(tmpcar,90.7584);
  110.                 SetPlayerPos(playerid,2260.6953,-2312.7083,21.9625);
  111.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  112.             }
  113.         }
  114.         else if(garagenum == 9)
  115.         {
  116.             if (PlayerToPoint(2.5, playerid,2249.4963,-2297.3486,21.9625))
  117.             {
  118.                 SetVehiclePos(tmpcar,2264.5613,-2305.1443,21.5816);
  119.                 SetVehicleZAngle(tmpcar,89.5290);
  120.                 SetPlayerPos(playerid,2260.2539,-2307.4050,21.9625);
  121.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  122.             }
  123.         }
  124.         else if(garagenum == 10)
  125.         {
  126.             if (PlayerToPoint(2.5, playerid,2249.3135,-2305.0928,21.9625))
  127.             {
  128.                 SetVehiclePos(tmpcar,2263.8755,-2297.5029,21.5836);
  129.                 SetVehicleZAngle(tmpcar,93.5016);
  130.                 SetPlayerPos(playerid,2260.3025,-2300.0317,21.9625);
  131.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  132.             }
  133.         }
  134.         else if(garagenum == 11)
  135.         {
  136.             if (PlayerToPoint(2.5, playerid,2249.3547,-2312.5369,21.9625))
  137.             {
  138.                 SetVehiclePos(tmpcar,2263.3008,-2290.5237,21.5705);
  139.                 SetVehicleZAngle(tmpcar,90.8524);
  140.                 SetPlayerPos(playerid,2259.9685,-2292.4934,21.9625);
  141.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  142.             }
  143.         }
  144.         else if(garagenum == 12)
  145.         {
  146.             if (PlayerToPoint(2.5, playerid,2249.4688,-2320.3904,21.9625))
  147.             {
  148.                 SetVehiclePos(tmpcar,2264.0378,-2283.5911,21.5833);
  149.                 SetVehicleZAngle(tmpcar,91.9541);
  150.                 SetPlayerPos(playerid,2260.4990,-2281.3589,21.9625);
  151.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
  152.             }
  153.         }
  154.         return 1;
  155.     }
  156. }
  157. //==============================================================================
  158.     if(strcmp(cmd, "/buygarage", true) == 0)
  159.     {
  160.         if(IsPlayerConnected(playerid))
  161.         {
  162.             new Float:oldposx, Float:oldposy, Float:oldposz;
  163.             GetPlayerName(playerid, playername, sizeof(playername));
  164.             GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  165.             for(new h = 0; h < sizeof(GarageInfo); h++)
  166.             {
  167.                 if(IsPlayerInRangeOfPoint(playerid,2.0, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]) && GarageInfo[h][gOwned] == 0)
  168.                 {
  169.                     if(PlayerInfo[playerid][pLevel] < GarageInfo[h][gLevel])
  170.                     {
  171.                         format(string, sizeof(string), "    Âû äîëæíû áûòü óðîâíåì %d!", GarageInfo[h][gLevel]);
  172.                         SendClientMessage(playerid, COLOR_GRAD5, string);
  173.                         return 1;
  174.                     }
  175.                     if(PlayerInfo[playerid][pPgaragekey] != 255 && strcmp(playername, GarageInfo[PlayerInfo[playerid][pPgaragekey]][gOwner], true) == 0)
  176.                     {
  177.                         SendClientMessage(playerid, COLOR_WHITE, "×òî áû ïðîäàòü ãàðàæ, ââåäèòå /sellgarage");
  178.                         return 1;
  179.                     }
  180.                     if(GetPlayerMoney(playerid) > GarageInfo[h][gValue])
  181.                     {
  182.                         PlayerInfo[playerid][pPgaragekey] = h;
  183.                         GarageInfo[h][gOwned] = 1;
  184.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  185.                         strmid(GarageInfo[h][gOwner], sendername, 0, strlen(sendername), 255);
  186.                         ServerGivePlayerMoney(playerid,-GarageInfo[h][gValue]);
  187.                         PlayerPlayMusic(playerid);
  188.                         SendClientMessage(playerid, COLOR_WHITE, "*Ïîçäðàâëÿåì âàñ ñ íîâîé ïîêóïêîé");
  189.                         SendClientMessage(playerid, COLOR_WHITE, "*Èñïîëüçóéòå /garage [1-12] ÷òîáû ïîñòàâèòü ìàøèíó â ãàðàæ");
  190.                         SendClientMessage(playerid, COLOR_WHITE, "*Ïîäðîáíóþ èíôîðìàöèþ î ãàðàæ âû ìîæåòå óçíàòü ââåäÿ /help");
  191.                         DateProp(playerid);
  192.                         OnPropUpdateGarage();
  193.                         SavePlayer(playerid);
  194.                         return 1;
  195.                     }
  196.                     else
  197.                     {
  198.                         SendClientMessage(playerid, COLOR_WHITE, "(( Ó âàñ íåòó äåíåã íà ïîêóïêó ãàðàæà ))");
  199.                         return 1;
  200.                     }
  201.                 }
  202.             }
  203.         }
  204.         return 1;
  205.     }
  206.     if(strcmp(cmd, "/sellgarage", true) == 0)
  207.     {
  208.         if(IsPlayerConnected(playerid))
  209.         {
  210.             GetPlayerName(playerid, playername, sizeof(playername));
  211.             if(PlayerInfo[playerid][pPgaragekey] == 255)
  212.             {
  213.                 SendClientMessage(playerid, COLOR_WHITE, "(( Ó âàñ íåò ãàðàæà ))");
  214.                 return 1;
  215.             }
  216.             if(PlayerInfo[playerid][pPgaragekey] != 255 && strcmp(playername, GarageInfo[PlayerInfo[playerid][pPgaragekey]][gOwner], true) == 0)
  217.             {
  218.                 new garage = PlayerInfo[playerid][pPgaragekey];
  219.                 GarageInfo[garage][gOwned] = 0;
  220.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  221.                 strmid(GarageInfo[garage][gOwner], "The State", 0, strlen("The State"), 255);
  222.                 ConsumingMoney[playerid] = 1;
  223.                 ServerGivePlayerMoney(playerid,GarageInfo[garage][gValue] / 2);
  224.                 PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  225.                 format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d", GarageInfo[garage][gValue]/2);
  226.                 GameTextForPlayer(playerid, string, 10000, 3);
  227.                 PlayerInfo[playerid][pPgaragekey] = 255;
  228.                 OnPropUpdateGarage();
  229.                 SavePlayer(playerid);
  230.                 return 1;
  231.             }
  232.             else
  233.             {
  234.                 SendClientMessage(playerid, COLOR_WHITE, "(( Âû íå âëàäåëåö ãàðàæà ))");
  235.             }
  236.         }
  237.         return 1;
  238.     }
  239.     if(strcmp(cmd, "/asellgarage", true) == 0)
  240.     {
  241.         if(IsPlayerConnected(playerid))
  242.         {
  243.             GetPlayerName(playerid, playername, sizeof(playername));
  244.             tmp = strtok(cmdtext, idx);
  245.             if(!strlen(tmp))
  246.             {
  247.                 SendClientMessage(playerid, COLOR_GRAD1, "Ïîäñêàçêà: /asellgarage [garageid]");
  248.                 return 1;
  249.             }
  250.             new garage = strval(tmp);
  251.             if (PlayerInfo[playerid][pAdmin] >= 4)
  252.             {
  253.                 GarageInfo[garage][gOwned] = 0;
  254.                 strmid(GarageInfo[garage][gOwner], "The State", 0, strlen("The State"), 255);
  255.                 PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  256.                 format(string, sizeof(string), "~w~You have sold this property", GarageInfo[garage][gValue]);
  257.                 GameTextForPlayer(playerid, string, 10000, 3);
  258.                 OnPropUpdateGarage();
  259.                 return 1;
  260.             }
  261.             else { SendClientMessage(playerid, COLOR_WHITE, "You are not an admin."); }
  262.         }
  263.         return 1;
  264.     }
  265. //==============================================================================
  266. for(new h = 0; h < sizeof(GarageInfo); h++)
  267. {
  268.     if(PlayerToPoint(1.0, playerid, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]))
  269.     {
  270.         if(GarageInfo[h][gOwned] == 1)
  271.         {
  272.             format(string, sizeof(string),"Âëàäåëåö: %s\nLevel ãàðàæà: %d",GarageInfo[h][gOwner],GarageInfo[h][gLevel]);
  273.             ShowPlayerDialog(playerid,148,DIALOG_STYLE_MSGBOX," Èíôîðìàöèÿ î Ãàðàæå",string,"îê","îê");
  274.         }
  275.         else
  276.         {
  277.             format(string, sizeof(string),"Ñâîáîäíûé ãàðàæ\nÑòîèìîñòü: %d\nLevel ãàðàæà: %d\nÄëÿ ïîêóïêè:\n((/buyhouse))",GarageInfo[h][gValue],GarageInfo[h][gLevel]);
  278.             ShowPlayerDialog(playerid,148,DIALOG_STYLE_MSGBOX,"Èíôîðìàöèÿ î Ãàðàæå",string,"îê","îê");
  279.         }
  280.     }
  281. }
  282. //==============================================================================
  283. //------------------------------------------------------------------------------
  284. for(new h = 0; h < sizeof(GarageInfo); h++)
  285. {
  286.     if(GarageInfo[h][gOwned] == 0)
  287.     {
  288.         AddStaticPickup(1274, 23, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]);
  289.         pickups++;
  290.         new temp[MAX_STRING];
  291.         format(temp,sizeof(temp), "[Öåíà: %d]\n[Ïðîäà¸òñÿ]",GarageInfo[h][gValue]);
  292.         Create3DTextLabel(temp,0x4CD10FF,GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey],GarageInfo[h][gEntrancez],10.0,0);
  293.     }
  294.     if(GarageInfo[h][gOwned] == 1)
  295.     {
  296.         AddStaticPickup(1239, 23, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]);
  297.         pickups++;
  298.         new temp[MAX_STRING];
  299.         format(temp,sizeof(temp), "[Âëàäåëåö %s]\n[Ãàðàæ]\n((/garage[1-12]))", GarageInfo[h][gOwner]);
  300.         Create3DTextLabel(temp,0x4CD10FF,GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez],10.0,0);
  301.     }
  302. }
  303. //------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment