Yamchilov[CM]
Дата: Воскресенье, 15.03.2015, 19:33 | Сообщение # 1
Новичок
Сообщений: 5
Статус: Offline
Перейдем сразу к делу. Покупка интерьера производится в мэрии. ( Координаты указаны в команде ). Ко всем new В public OnPlayerSelectedMenuRow(playerid, row)
if(Current == Buyint) { ShowMenuForPlayer(Buyint,playerid); switch(row) { case 0: // NEXT >> { if(pokupka[playerid] == 1) { SetPlayerPos(playerid,2262.83,-1137.71,1050.63); SetPlayerInterior(playerid,10); pokupka[playerid] = 2; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}100000"); } else if(pokupka[playerid] == 2) { SetPlayerPos(playerid,2365.42,-1131.85,1050.88); SetPlayerInterior(playerid,8); pokupka[playerid] = 3; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}120000"); } else if(pokupka[playerid] == 3) { SetPlayerPos(playerid,2451.77,-1699.80,1013.51); SetPlayerInterior(playerid,2); pokupka[playerid] = 4; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}130000"); } else if(pokupka[playerid] == 4) { SetPlayerPos(playerid,223.043991,1289.259888,1082.199951); SetPlayerInterior(playerid,1); pokupka[playerid] = 5; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}200000"); } else if(pokupka[playerid] == 5) { SetPlayerPos(playerid,385.803986,1471.769897,1080.20996); SetPlayerInterior(playerid,15); pokupka[playerid] = 6; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}220000"); } else if(pokupka[playerid] == 6) { SetPlayerPos(playerid,2324.33,-1144.79,1050.71); SetPlayerInterior(playerid,12); pokupka[playerid] = 7; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}250000"); } else if(pokupka[playerid] == 7) { SetPlayerPos(playerid,2319.1272,-1023.9562,1050.2109); SetPlayerInterior(playerid,9); pokupka[playerid] = 8; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}270000"); } else if(pokupka[playerid] == 8) { SetPlayerPos(playerid,2260.76,-1210.45,1049.02); SetPlayerInterior(playerid,10); pokupka[playerid] = 9; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}300000"); } else if(pokupka[playerid] == 9) { SetPlayerPos(playerid,225.630997,1022.479980,1084.069946); SetPlayerInterior(playerid,7); pokupka[playerid] = 10; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}320000"); } else if(pokupka[playerid] == 10) { SetPlayerPos(playerid,239.2819,1114.1991,1080.9922); SetPlayerInterior(playerid,5); pokupka[playerid] = 11; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}340000"); } else if(pokupka[playerid] == 11) { SetPlayerPos(playerid,234.2826,1065.229,1084.2101); SetPlayerInterior(playerid,6); pokupka[playerid] = 12; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}380000"); } else if(pokupka[playerid] == 12) { SetPlayerPos(playerid,2262.83,-1137.71,1050.63); SetPlayerInterior(playerid,10); pokupka[playerid] = 1; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}50000"); } } case 1: // $ BUY $ { if(pokupka[playerid] == 1) { if(PlayerInfo[playerid][pCash] < 50000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); /*new house = PlayerInfo[playerid][pPhousekey]; HouseInfo[house][hInt] = 5; HouseInfo[house][hExitx] = 140.9131; HouseInfo[house][hExity]= 1367.9713; HouseInfo[house][hExitz] = 1083.8621;*/ new house = PlayerInfo[playerid][pPhousekey]; HouseInfo[house][hInt] = 5; HouseInfo[house][hExitx] = 2233.7283; HouseInfo[house][hExity] = -1115.2617; HouseInfo[house][hExitz] = 1050.8828; PlayerInfo[playerid][pCash] -= 100000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 50000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 2) { if(PlayerInfo[playerid][pCash] < 100000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // HouseInfo[house][hInt] = 10; HouseInfo[house][hExitx] = 2259.3816; HouseInfo[house][hExity] = -1135.9191; HouseInfo[house][hExitz] = 1050.6403; PlayerInfo[playerid][pCash] -= 100000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 100000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 3) { if(PlayerInfo[playerid][pCash] < 120000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // HouseInfo[house][hInt] = 8; HouseInfo[house][hExitx] = 2365.2073; HouseInfo[house][hExity] = -1135.5981; HouseInfo[house][hExitz] = 1050.8826; PlayerInfo[playerid][pCash] -= 120000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 120000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 4) { if(PlayerInfo[playerid][pCash] < 130000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; //, HouseInfo[house][hInt] = 2; HouseInfo[house][hExitx] = 2468.8430; HouseInfo[house][hExity] = -1698.1530; HouseInfo[house][hExitz] = 1013.5078; PlayerInfo[playerid][pCash] -= 130000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 130000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 5) { if(PlayerInfo[playerid][pCash] < 200000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // HouseInfo[house][hInt] = 1; HouseInfo[house][hExitx] = 223.1932; HouseInfo[house][hExity] = 1287.0768; HouseInfo[house][hExitz] = 1082.1406; PlayerInfo[playerid][pCash] -= 200000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 200000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 6) { if(PlayerInfo[playerid][pCash] < 220000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // HouseInfo[house][hInt] = 15; HouseInfo[house][hExitx] = 387.2260; HouseInfo[house][hExity] = 1471.7313; HouseInfo[house][hExitz] = 1080.1949; PlayerInfo[playerid][pCash] -= 220000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 220000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 7) { if(PlayerInfo[playerid][pCash] < 250000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // ,, HouseInfo[house][hInt] = 12; HouseInfo[house][hExitx] = 2324.4224; HouseInfo[house][hExity] = -1149.4077; HouseInfo[house][hExitz] = 1050.7101; PlayerInfo[playerid][pCash] -= 250000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 250000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 8) { if(PlayerInfo[playerid][pCash] < 270000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // HouseInfo[house][hInt] = 9; HouseInfo[house][hExitx] = 2317.9084; HouseInfo[house][hExity] = -1026.7656; HouseInfo[house][hExitz] = 1050.2178; PlayerInfo[playerid][pCash] -= 270000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 270000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 9) { if(PlayerInfo[playerid][pCash] < 300000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // ,, HouseInfo[house][hInt] = 10; HouseInfo[house][hExitx] = 2269.8389; HouseInfo[house][hExity] = -1210.4169; HouseInfo[house][hExitz] = 1047.5625; PlayerInfo[playerid][pCash] -= 300000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 300000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 10) { if(PlayerInfo[playerid][pCash] < 320000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // ,, HouseInfo[house][hInt] = 7; HouseInfo[house][hExitx] = 225.6452; HouseInfo[house][hExity] = 1021.4452; HouseInfo[house][hExitz] = 1084.0177; PlayerInfo[playerid][pCash] -= 320000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 320000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 11) { if(PlayerInfo[playerid][pCash] < 340000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // ,, HouseInfo[house][hInt] = 5; HouseInfo[house][hExitx] = 226.4627; HouseInfo[house][hExity] = 1114.2662; HouseInfo[house][hExitz] = 1080.9938; PlayerInfo[playerid][pCash] -= 340000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 340000 вирт"); SaveHousee(); Exit(playerid); } else if(pokupka[playerid] == 12) { if(PlayerInfo[playerid][pCash] < 380000)return SendClientMessage(playerid, COLOR_GREY, "Недостаточно средств"); new house = PlayerInfo[playerid][pPhousekey]; // ,, HouseInfo[house][hInt] = 6; HouseInfo[house][hExitx] = 234.3617; HouseInfo[house][hExity] = 1063.7206; HouseInfo[house][hExitz] = 1084.2123; PlayerInfo[playerid][pCash] -= 380000; SendClientMessage(playerid,COLOR_GREEN,"Вы преобрели интерьер стоймостью в 380000 вирт"); SaveHousee(); Exit(playerid); } } case 2: // EXIT { Exit(playerid); } } }
Добавляем команду
else if(strcmp(cmd, "/buyint", true) == 0) { if(!PlayerToPoint(10.0,playerid,X,Y,Z)) return SendClientMessage(playerid, COLOR_GREY, "Вы не на месте заказа интерьера"); // укажи свои координаты вместо X,Y,Z if(PlayerInfo[playerid][pPhousekey] == 255)return SendClientMessage(playerid, COLOR_GREY, "У вас нету дома"); ShowMenuForPlayer(Buyint,playerid); pokupka[playerid] = 1; SendClientMessage(playerid,COLOR_GREEN,"Данный интерьер стоит {FFFFFF}50000"); SetPlayerPos(playerid,2233.6919,-1112.8107,1050.8828); SetPlayerInterior(playerid, 5); }
В stock Menu()
Buyint = CreateMenu("BuyInt", 1, 25.0, 160.0, 100.0); AddMenuItem(Buyint,0,">> Next >>"); AddMenuItem(Buyint,0,"$ Buy $"); AddMenuItem(Buyint,0,"Exit");
Примерно в конце мода , добавляем сток.