Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==========================[Выезд из гаража]===================================
- if(strcmp(cmd, "/gexit", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerToKvadrat(playerid, 2237.1670, -2324.4834, 2269.6880, -2279.6177))
- {
- if (GetPlayerState(playerid) == 2)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid), 2252.3154,-2321.4077,21.5805);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), 183.8832);
- }
- else
- {
- SetPlayerPos(playerid, 2250.9250,-2323.8477,21.9625);
- }
- SendClientMessage(playerid, COLOR_GRAD1, "Âû âûéõàëè èç ãàðàæà!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Âû íå â ãàðàæå!");
- }
- }
- return 1;
- }
- //==========================[Въезд в гараж]====================================
- if(strcmp(cmd, "/garage", true) == 0)
- {
- if(PlayerInfo[playerid][pPgaragekey] != 255)
- {
- tmp = strtok(cmdtext, idx);
- new tmpcar = GetPlayerVehicleID(playerid);
- garagenum = strval(tmp);
- if(garagenum == 1)
- {
- if (PlayerToPoint(2.5, playerid,2256.9060,-2320.4949,21.9625))
- {
- SetVehiclePos(tmpcar, 2243.3142,-2320.2605,21.5830);
- SetVehicleZAngle(tmpcar, 270.7682);
- SetPlayerPos(playerid, 2245.8423,-2317.7783,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 2)
- {
- if (PlayerToPoint(2.5, playerid,2256.6345,-2313.0808,21.9625))
- {
- SetVehiclePos(tmpcar, 2243.2529,-2312.8540,21.5839);
- SetVehicleZAngle(tmpcar, 272.8101);
- SetPlayerPos(playerid, 2246.5332,-2310.4453,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 3)
- {
- if (PlayerToPoint(2.5, playerid,2257.2866,-2305.2278,21.9625))
- {
- SetVehiclePos(tmpcar,2243.3406,-2305.1606,21.5850);
- SetVehicleZAngle(tmpcar,272.1346);
- SetPlayerPos(playerid,2246.2175,-2302.9695,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 4)
- {
- if (PlayerToPoint(2.5, playerid,2257.2029,-2297.5176,21.9625))
- {
- SetVehiclePos(tmpcar,2242.8269,-2297.7490,21.5829);
- SetVehicleZAngle(tmpcar,271.0504);
- SetPlayerPos(playerid,2246.3472,-2295.3289,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 5)
- {
- if (PlayerToPoint(2.5, playerid,2257.2825,-2290.9556,21.9625))
- {
- SetVehiclePos(tmpcar,2243.1101,-2290.9460,21.5835);
- SetVehicleZAngle(tmpcar,274.0207);
- SetPlayerPos(playerid,2246.1550,-2288.8042,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 6)
- {
- if (PlayerToPoint(2.5, playerid,2257.0667,-2283.6091,21.9625))
- {
- SetVehiclePos(tmpcar,2243.2046,-2283.7122,21.5841);
- SetVehicleZAngle(tmpcar,271.6969);
- SetPlayerPos(playerid,2246.7976,-2281.2944,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 7)
- {
- if (PlayerToPoint(2.5, playerid,2250.1541,-2283.4910,21.9625))
- {
- SetVehiclePos(tmpcar,2263.1626,-2320.2600,21.5837);
- SetVehicleZAngle(tmpcar,91.3686);
- SetPlayerPos(playerid,2260.2988,-2318.2815,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 8)
- {
- if (PlayerToPoint(2.5, playerid,2249.7822,-2290.3433,21.9625))
- {
- SetVehiclePos(tmpcar,2263.8469,-2312.8611,21.5856);
- SetVehicleZAngle(tmpcar,90.7584);
- SetPlayerPos(playerid,2260.6953,-2312.7083,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 9)
- {
- if (PlayerToPoint(2.5, playerid,2249.4963,-2297.3486,21.9625))
- {
- SetVehiclePos(tmpcar,2264.5613,-2305.1443,21.5816);
- SetVehicleZAngle(tmpcar,89.5290);
- SetPlayerPos(playerid,2260.2539,-2307.4050,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 10)
- {
- if (PlayerToPoint(2.5, playerid,2249.3135,-2305.0928,21.9625))
- {
- SetVehiclePos(tmpcar,2263.8755,-2297.5029,21.5836);
- SetVehicleZAngle(tmpcar,93.5016);
- SetPlayerPos(playerid,2260.3025,-2300.0317,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 11)
- {
- if (PlayerToPoint(2.5, playerid,2249.3547,-2312.5369,21.9625))
- {
- SetVehiclePos(tmpcar,2263.3008,-2290.5237,21.5705);
- SetVehicleZAngle(tmpcar,90.8524);
- SetPlayerPos(playerid,2259.9685,-2292.4934,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- else if(garagenum == 12)
- {
- if (PlayerToPoint(2.5, playerid,2249.4688,-2320.3904,21.9625))
- {
- SetVehiclePos(tmpcar,2264.0378,-2283.5911,21.5833);
- SetVehicleZAngle(tmpcar,91.9541);
- SetPlayerPos(playerid,2260.4990,-2281.3589,21.9625);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "×òî áû âûéõàòü èç ãàðàæà, ââåäèòå /gexit");
- }
- }
- return 1;
- }
- }
- //==============================================================================
- if(strcmp(cmd, "/buygarage", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new h = 0; h < sizeof(GarageInfo); h++)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]) && GarageInfo[h][gOwned] == 0)
- {
- if(PlayerInfo[playerid][pLevel] < GarageInfo[h][gLevel])
- {
- format(string, sizeof(string), " Âû äîëæíû áûòü óðîâíåì %d!", GarageInfo[h][gLevel]);
- SendClientMessage(playerid, COLOR_GRAD5, string);
- return 1;
- }
- if(PlayerInfo[playerid][pPgaragekey] != 255 && strcmp(playername, GarageInfo[PlayerInfo[playerid][pPgaragekey]][gOwner], true) == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "×òî áû ïðîäàòü ãàðàæ, ââåäèòå /sellgarage");
- return 1;
- }
- if(GetPlayerMoney(playerid) > GarageInfo[h][gValue])
- {
- PlayerInfo[playerid][pPgaragekey] = h;
- GarageInfo[h][gOwned] = 1;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(GarageInfo[h][gOwner], sendername, 0, strlen(sendername), 255);
- ServerGivePlayerMoney(playerid,-GarageInfo[h][gValue]);
- PlayerPlayMusic(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "*Ïîçäðàâëÿåì âàñ ñ íîâîé ïîêóïêîé");
- SendClientMessage(playerid, COLOR_WHITE, "*Èñïîëüçóéòå /garage [1-12] ÷òîáû ïîñòàâèòü ìàøèíó â ãàðàæ");
- SendClientMessage(playerid, COLOR_WHITE, "*Ïîäðîáíóþ èíôîðìàöèþ î ãàðàæ âû ìîæåòå óçíàòü ââåäÿ /help");
- DateProp(playerid);
- OnPropUpdateGarage();
- SavePlayer(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "(( Ó âàñ íåòó äåíåã íà ïîêóïêó ãàðàæà ))");
- return 1;
- }
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/sellgarage", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- if(PlayerInfo[playerid][pPgaragekey] == 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, "(( Ó âàñ íåò ãàðàæà ))");
- return 1;
- }
- if(PlayerInfo[playerid][pPgaragekey] != 255 && strcmp(playername, GarageInfo[PlayerInfo[playerid][pPgaragekey]][gOwner], true) == 0)
- {
- new garage = PlayerInfo[playerid][pPgaragekey];
- GarageInfo[garage][gOwned] = 0;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(GarageInfo[garage][gOwner], "The State", 0, strlen("The State"), 255);
- ConsumingMoney[playerid] = 1;
- ServerGivePlayerMoney(playerid,GarageInfo[garage][gValue] / 2);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d", GarageInfo[garage][gValue]/2);
- GameTextForPlayer(playerid, string, 10000, 3);
- PlayerInfo[playerid][pPgaragekey] = 255;
- OnPropUpdateGarage();
- SavePlayer(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "(( Âû íå âëàäåëåö ãàðàæà ))");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/asellgarage", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Ïîäñêàçêà: /asellgarage [garageid]");
- return 1;
- }
- new garage = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 4)
- {
- GarageInfo[garage][gOwned] = 0;
- strmid(GarageInfo[garage][gOwner], "The State", 0, strlen("The State"), 255);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~You have sold this property", GarageInfo[garage][gValue]);
- GameTextForPlayer(playerid, string, 10000, 3);
- OnPropUpdateGarage();
- return 1;
- }
- else { SendClientMessage(playerid, COLOR_WHITE, "You are not an admin."); }
- }
- return 1;
- }
- //==============================================================================
- for(new h = 0; h < sizeof(GarageInfo); h++)
- {
- if(PlayerToPoint(1.0, playerid, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]))
- {
- if(GarageInfo[h][gOwned] == 1)
- {
- format(string, sizeof(string),"Âëàäåëåö: %s\nLevel ãàðàæà: %d",GarageInfo[h][gOwner],GarageInfo[h][gLevel]);
- ShowPlayerDialog(playerid,148,DIALOG_STYLE_MSGBOX," Èíôîðìàöèÿ î Ãàðàæå",string,"îê","îê");
- }
- else
- {
- format(string, sizeof(string),"Ñâîáîäíûé ãàðàæ\nÑòîèìîñòü: %d\nLevel ãàðàæà: %d\nÄëÿ ïîêóïêè:\n((/buyhouse))",GarageInfo[h][gValue],GarageInfo[h][gLevel]);
- ShowPlayerDialog(playerid,148,DIALOG_STYLE_MSGBOX,"Èíôîðìàöèÿ î Ãàðàæå",string,"îê","îê");
- }
- }
- }
- //==============================================================================
- //------------------------------------------------------------------------------
- for(new h = 0; h < sizeof(GarageInfo); h++)
- {
- if(GarageInfo[h][gOwned] == 0)
- {
- AddStaticPickup(1274, 23, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]);
- pickups++;
- new temp[MAX_STRING];
- format(temp,sizeof(temp), "[Öåíà: %d]\n[Ïðîäà¸òñÿ]",GarageInfo[h][gValue]);
- Create3DTextLabel(temp,0x4CD10FF,GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey],GarageInfo[h][gEntrancez],10.0,0);
- }
- if(GarageInfo[h][gOwned] == 1)
- {
- AddStaticPickup(1239, 23, GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez]);
- pickups++;
- new temp[MAX_STRING];
- format(temp,sizeof(temp), "[Âëàäåëåö %s]\n[Ãàðàæ]\n((/garage[1-12]))", GarageInfo[h][gOwner]);
- Create3DTextLabel(temp,0x4CD10FF,GarageInfo[h][gEntrancex], GarageInfo[h][gEntrancey], GarageInfo[h][gEntrancez],10.0,0);
- }
- }
- //------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment