Удалённый пользователь 121243
Привет, резко перестали отображаться дома на карте. Streamer последней версии, все без ошибок.
stock BuyHouse(h)
public OnPlayerEnterDynamicArea(playerid, areaid)
publics: LoadProperty()
Предоставил все что связано с домами.
stock BuyHouse(h)
PHP:
}
stock BuyHouse(h)
{
if(HouseInfo[h][hOwned] == 0)
{
DestroyDynamicMapIcon(HouseInfo[h][hMIcon]);
DestroyPickup(HouseInfo[h][hPickup]);
AddStaticPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
HouseInfo[h][hMIcon] = CreateDynamicMapIcon(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 200.0);
Update3dHouse3d(h);
}
if(HouseInfo[h][hOwned] == 1)
{
DestroyDynamicMapIcon(HouseInfo[h][hMIcon]);
DestroyPickup(HouseInfo[h][hPickup]);
AddStaticPickup(19522, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
HouseInfo[h][hMIcon] = CreateDynamicMapIcon(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 200.0);
Update3dHouse3d(h);
}
return true;
public OnPlayerEnterDynamicArea(playerid, areaid)
PHP:
}
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid >= HouseInfo[0][hSquare] && areaid <= HouseInfo[1999][hSquare])
{
if(GetPVarInt(playerid, "ExitHouse")) return true;
new h = areaid-1;
if(h == 255) return true;
new stringhouse[300];
if(HouseInfo[h][hOwned] == 1)
{
new ttextt[32], ids = GetPlayerID(HouseInfo[h][hOwner]);
if(IsPlayerConnected(ids)) { ttextt = "43dc10"; }
else if(!IsPlayerConnected(ids)) { ttextt = "d62f16"; }
new tstext[10], takings, rooms, zone[64];
GetPlayer2DZone(playerid, zone, sizeof(zone));
switch(HouseInfo[h][hKlass])
{
case 1: {
tstext = "D";
rooms = 4;
}
case 2: {
tstext = "C";
rooms = 3;
}
case 3: {
tstext = "B";
rooms = 5;
}
case 4: {
tstext = "A";
rooms = 3;
}
case 5: {
tstext = "S";
rooms = 3;
}
default: {
tstext = "Nope";
rooms = 1;
}
}
switch(HouseInfo[h][hKlass]) {
case 0: takings = 300;
case 1: takings = 600;
case 2: takings = 900;
case 3: takings = 1200;
case 4: takings = 1500;
case 5: takings = 1800;
}//b - 5, a - 3, nope - 1, d - 4, c - 3, s - 3
format(stringhouse, sizeof(stringhouse), "{FFFFFF}Владелец:\t\t\t{%s}%s{ffffff}\n\nКласс:\t\t\t\t%s\nУлица:\t\t\t\t%s, № %d\nКоличество комнат:\t\t%d\nСтоимость:\t\t\t%d$\nЕжедневная квартплата:\t%d$\nДомашний счёт:\t\t%d$",ttextt,HouseInfo[h][hOwner],tstext,zone,h,rooms,HouseInfo[h][hValue],takings,HouseInfo[h][hTakings]);
SPD(playerid,10075,DIALOG_STYLE_MSGBOX,"{FFCC00}Дом занят",stringhouse,"Войти","Отмена");
return true;
}
else
{
if(PlayerInfo[playerid][pCash] < HouseInfo[h][hValue])
{
GameTextForPlayer(playerid,"~r~No Money",5000,1);
return true;
}
new tstext[10], takings, rooms, zone[64];
GetPlayer2DZone(playerid, zone, sizeof(zone));
switch(HouseInfo[h][hKlass])
{
case 1: {
tstext = "D";
rooms = 4;
}
case 2: {
tstext = "C";
rooms = 3;
}
case 3: {
tstext = "B";
rooms = 5;
}
case 4: {
tstext = "A";
rooms = 3;
}
case 5: {
tstext = "S";
rooms = 3;
}
default: {
tstext = "Nope";
rooms = 1;
}
}
switch(HouseInfo[h][hKlass]) {
case 0: takings = 300;
case 1: takings = 600;
case 2: takings = 900;
case 3: takings = 1200;
case 4: takings = 1500;
case 5: takings = 1800;
}
format(stringhouse, sizeof(stringhouse), "{FFFFFF}Стоимость:\t\t\t%s\n{FFFFFF}Класс:\t\t\t\t%s\n{FFFFFF}Улица:\t\t\t\t%s, № %d\n{FFFFFF}Количество комнат:\t\t%d\n{FFFFFF}Ежедневная квартплата:\t%d$\n{FFFFFF}Домашний счет:\t\t%d$",formatInt(HouseInfo[h][hValue]),tstext,zone,h,rooms,takings,HouseInfo[h][hTakings]);
SPD(playerid,10026,DIALOG_STYLE_MSGBOX,"{63CB00}Дом свободен",stringhouse,"Купить","Отмена");
return true;
publics: LoadProperty()
PHP:
}
publics: LoadProperty()
{
static rows, fields;
cache_get_data(rows, fields);
new temp[64],idx=0;
if(rows)
{
for(new he = 0; he < rows; he++)
{
cache_get_row(he, 0, temp), HouseInfo[he][hID] = strval(temp);
cache_get_row(he, 1, temp), HouseInfo[he][hEntrancex] = floatstr(temp);
cache_get_row(he, 2, temp), HouseInfo[he][hEntrancey] = floatstr(temp);
cache_get_row(he, 3, temp), HouseInfo[he][hEntrancez] = floatstr(temp);
cache_get_row(he, 4, temp), HouseInfo[he][hExitx] = floatstr(temp);
cache_get_row(he, 5, temp), HouseInfo[he][hExity] = floatstr(temp);
cache_get_row(he, 6, temp), HouseInfo[he][hExitz] = floatstr(temp);
cache_get_row(he, 7, temp), strmid(HouseInfo[he][hOwner], temp, 0, strlen(temp), 255);
cache_get_row(he, 8, temp), HouseInfo[he][hValue] = strval(temp);
cache_get_row(he, 9, temp), HouseInfo[he][hHel] = strval(temp);
cache_get_row(he, 10, temp), HouseInfo[he][hInt] = strval(temp);
cache_get_row(he, 11, temp), HouseInfo[he][hLock] = strval(temp);
cache_get_row(he, 12, temp), HouseInfo[he][hOwned] = strval(temp);
cache_get_row(he, 13, temp), HouseInfo[he][hTakings] = strval(temp);
cache_get_row(he, 14, temp), HouseInfo[he][hVec] = strval(temp);
cache_get_row(he, 15, temp), HouseInfo[he][hKlass] = strval(temp);
cache_get_row(he, 16, temp), HouseInfo[he][hVehSost] = strval(temp);
cache_get_row(he, 17, temp), HouseInfo[he][hCarx] = floatstr(temp);
cache_get_row(he, 18, temp), HouseInfo[he][hCary] = floatstr(temp);
cache_get_row(he, 19, temp), HouseInfo[he][hCarz] = floatstr(temp);
cache_get_row(he, 20, temp), HouseInfo[he][hCarc] = floatstr(temp);
cache_get_row(he, 21, temp), HouseInfo[he][hNark] = strval(temp);
cache_get_row(he, 22, temp), HouseInfo[he][hMoney] = strval(temp);
cache_get_row(he, 23, temp), HouseInfo[he][hMatel] = strval(temp);
cache_get_row(he, 24, temp), HouseInfo[he][hduggl] = strval(temp);
cache_get_row(he, 25, temp), HouseInfo[he][hak47] = strval(temp);
cache_get_row(he, 26, temp), HouseInfo[he][hshotgun] = strval(temp);
cache_get_row(he, 27, temp), HouseInfo[he][hm4] = strval(temp);
cache_get_row(he, 28, temp), HouseInfo[he][hsdpist] = strval(temp);
cache_get_row(he, 29, temp), HouseInfo[he][hrifle] = strval(temp);
cache_get_row(he, 30, temp), HouseInfo[he][hsmg] = strval(temp);
cache_get_row(he, 31, temp), sscanf(temp, "a<i>[7]", HouseInfo[he][hdrugs]);
idx++;
HouseInfo[he][hRobhouse] = false;
HouseInfo[he][hSquare] = CreateDynamicSphere(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 1.5, 0, 0, -1);
if(HouseInfo[he][hOwned] == 0)
{
HouseInfo[he][hPickup] = CreatePickup(1273, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],0);
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 200.0);
}
if(HouseInfo[he][hOwned] == 1)
{
HouseInfo[he][hPickup] = CreatePickup(19522, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],0);
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 200.0);
}
Update3dHouse3d(he);
}
printf("[ %d ] Дома успешно загружены.",idx);
}
else printf("Дома не загружены.");
for(new i; i != MAX_PAYNSPRAY; i++) {
PaynSpray[i] = CreateDynamicSphere(paynspray[i][0],paynspray[i][1],paynspray[i][2],10.0);
}
AreaBase = CreateDynamicSphere(492.6442,-153.7014,611.1124,50.0);
door_fbi_area = CreateDynamicSphere(584.0284,1270.3948,1080.3250,4.0);
return true;
Предоставил все что связано с домами.
