Guest User

Untitled

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