Erl | Дата: Четверг, 29.08.2013, 12:05 | Сообщение # 1 |
Освоившийся
Группа:
Продвинутые
Сообщений: 77
Награды: 0
Город: Алчевск
Репутация: 8
Замечания: 0%
Статус:
| Вот код покупки:
Код public FHouseBuy(playerid) { new id=GetHouseID(playerid); new temp[MAX_STRING]; if (id > -1) { if (IsPlayerRegistered(playerid)) { if (PlayerGangid[playerid] != 0) { new price; price = Houses[id][Houses_Cost] + Houses[id][Houses_Buyout]; if(Player[playerid][Money] >= price) { //if(strcomp(Houses[id][Houses_Owner], oGetPlayerName(playerid), true) == 1) //{ // ПРОВЕРКА ЕСТЬ ЛИ УЖЕ ДОМ!!! //SendPlayerFormattedText(playerid, lang_texts[8][15] , 0,COLOUR_RED); //} else { new owner=-1; for (new ownerid = 0; ownerid < MAX_PLAYERS; ownerid++) { if (IsPlayerConnected(ownerid)) { if(strcomp(Houses[id][Houses_Owner], oGetPlayerName(ownerid), true) == 1) { format(temp,sizeof(temp), lang_texts[8][16] ,Houses[id][Houses_Name],oGetPlayerName(playerid)); SendPlayerFormattedText(ownerid, temp, 0,COLOUR_RED); set(temp,nullstr); owner=ownerid; } } } oGivePlayerMoney(playerid,0-price,1); if (owner > -1) { oGivePlayerMoney(owner,0+price,1); } else { new dinifilename[MAX_STRING]; format(dinifilename,sizeof(dinifilename),"%sGTO.Player.%s.txt",PlayerDB,EncodeName(Houses[id][Houses_Owner])); if (dini_Exists(dinifilename)) { new tempmoney; tempmoney = strval(dini_Get(dinifilename,"Money")); tempmoney = tempmoney + price; valstr(temp,tempmoney); dini_Set(dinifilename,"Money",temp); set(temp,nullstr); } } set(Houses[id][Houses_Owner],oGetPlayerName(playerid)); set(Houses[id][Houses_Gang],PlayerGangName[playerid]); Houses[id][Houses_Buyout] = 0; new dinifilename[MAX_STRING]; format(dinifilename,sizeof(dinifilename),"%sGTO.Houses.%s.txt",HousesDB,Houses[id][Houses_Name]); if (dini_Exists(dinifilename)) { dini_Set(dinifilename,"Owner",Houses[id][Houses_Owner]); dini_Set(dinifilename,"Gang",Houses[id][Houses_Gang]); valstr(temp,Houses[id][Houses_Buyout]); dini_Set(dinifilename,"Buyout",temp); set(temp,nullstr); } format(temp,sizeof(temp), lang_texts[8][17] ,Houses[id][Houses_Name]); SendPlayerFormattedText(playerid, temp, 0,COLOUR_GREEN); set(temp,nullstr); new logstring[256]; format(logstring, sizeof (logstring), "player: %d: %s: bought the '%s' (house)",playerid,oGetPlayerName(playerid),Houses[id][Houses_Name]); WriteLog(logstring); } } else { SendPlayerFormattedText(playerid, lang_texts[8][18] , 0,COLOUR_RED); } } else { SendPlayerFormattedText(playerid, lang_texts[8][19] , 0,COLOUR_RED); } } else { SendPlayerFormattedText(playerid, lang_texts[8][20] , 0,COLOUR_RED); } } else { SendPlayerFormattedText(playerid, lang_texts[8][21] , 0,COLOUR_RED); } return 1; }
Главарь банды может покупать дом, потом ещё сколько хочешь не продавая первый)Как исправить? Мод: GTO v0.6.0
-.-
Сообщение отредактировал Erl - Суббота, 31.08.2013, 15:23 |
|
|
|