SHOW:
|
|
- or go back to the newest paste.
1 | case 17: | |
2 | { | |
3 | if(response) | |
4 | { | |
5 | if(listitem == 0) | |
6 | { | |
7 | new string[500]; | |
8 | for(new h = 1; h <= m_h; h++) if(strcmp(House[h][hOwner], "None", true) == 0) format(string,sizeof(string), "{C53A3A}%sДом: %d - Цена: %d\n", string, h, House[h][hPrice]); | |
9 | ShowPlayerDialog(playerid,18,DIALOG_STYLE_LIST,"{C53A3A}[Свободные дома в Лос-Сантосе]", string, "Принять", "Отмена"); | |
10 | } | |
11 | } | |
12 | } | |
13 | case 18: | |
14 | { | |
15 | if(response) | |
16 | { | |
17 | new poi = -1; | |
18 | for(new h=1; h <= m_h; h++) if(!strcmp(House[h][hOwner], "None", true)) poi++; | |
19 | if(poi < 0) return 1; | |
20 | for(new i=0; i <= poi; i++) if(listitem == i) SetPVarInt(playerid, "ebaldom",i), ShowPlayerDialog(playerid,19,DIALOG_STYLE_LIST,"{C53A3A}[Подробнее о доме]", "Информация\nКупить", "Принять", "Отмена"); | |
21 | } | |
22 | } | |
23 | case 19: | |
24 | { | |
25 | if(response) | |
26 | { | |
27 | if(listitem == 0) | |
28 | { | |
29 | SendClientMessage(playerid, -1, "{C53A3A}[ERROR]: - {FFFFFF}В разработке!"); | |
30 | } | |
31 | if(listitem == 1) | |
32 | { | |
33 | new poi=-1; | |
34 | for(new h=1; h <= m_h; h++) | |
35 | { | |
36 | if(!strcmp(House[h][hOwner], "None", true)) poi++; | |
37 | - | if(poi == GetPVarInt(playerid, "ebaldom") |
37 | + | if(poi == GetPVarInt(playerid, "ebaldom")) |
38 | { | |
39 | if(GetPlayerMoney(playerid) < House[h][hPrice]) return SendClientMessage(playerid, -1, "{C53A3A}[WARNING]: - {FFFFFF}У вас не достаточно средств!"); | |
40 | strmid(House[h][hOwner], Name(playerid), 0, 24, 24), UpdateHouse(h); | |
41 | SaveHouse(h); | |
42 | GivePlayerMoney(playerid, -House[h][hPrice]); | |
43 | SendClientMessage(playerid, -1, "{C53A3A}Поздравляем! Вы успешно приобрели дом!"); | |
44 | return 1; | |
45 | - | return 1; |
45 | + | |
46 | } | |
47 | } | |
48 | } | |
49 | } |