am1re
Ученик
Всем привет! На локальном сервере такой фигни не писало в логе:
А вот когда онлайн 15+ начинает писать.
Собственно сам паблик:
Занаю там много не оптимизировано, но сейчас не об этом. Так в чем может быть проблема?
PHP:
[19:01:21] [debug] Run time error 4: "Array index out of bounds"
[19:01:21] [debug] Accessing element at negative index -1
[19:01:21] [debug] AMX backtrace:
[19:01:21] [debug] #0 001c89ec in public OnPlayerKeyStateChange (0x0000000b, 0x00000010, 0x00000000) from new.amx
Собственно сам паблик:
PHP:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(!IsPlayerConnected(playerid)) return 1;
if(GetPVarInt(playerid,"Logined") == 0) return Kick(playerid);
AntiCheat(playerid);
if(pTemp[playerid][pCuffee] == playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
{
if((newkeys & KEY_JUMP || newkeys & KEY_FIRE || newkeys & KEY_CROUCH || (newkeys & KEY_HANDBRAKE && newkeys & KEY_SECONDARY_ATTACK)))
{
ClearAnimations(playerid);
SetTimerEx("Unfreez2",3000,0,"i",playerid);
ApplyAnimation(playerid,"FAT","IDLE_tired",3.0,1,0,0,0,3000,1);
TogglePlayerControllable(playerid,0);
ShowMessageEx(playerid, 1, mesnoticetime,"Вы не использовать это действие так как вы в наручниках.");
}
}
}
if(oldkeys & KEY_SPRINT && !IsPlayerInAnyVehicle(playerid))
{
if(newkeys & KEY_JUMP) CheckBunnyHop(playerid);
else SetPVarInt(playerid, "PlayerJag", GetTickCount());
}
if(IsPlayerInAnyVehicle(playerid) && newkeys == 2) if(PlayerToPoint(5.0,playerid,1015.3531,-1438.2787,13.5469) || PlayerToPoint(5.0,playerid,2384.6409,1026.9692,10.8203) || PlayerToPoint(5.0,playerid,-1917.2198,295.4781,41.0469)) ShowPlayerDialog(playerid,dStoRAK,DIALOG_STYLE_LIST,"{"#cGREEN"}Автомастерская: {ffffff}Список услуг","1. Перекраска т.с [500$]\n2. Ремонт т.с [100$]\n3. Смена дисков [1000$]\n4. Установка нитро\n5. Гидравлика [2500$]","Выбрать","Закрыть");
if(newkeys == KEY_SUBMISSION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return OnPlayerCommandText(playerid, "/en");
if(newkeys & KEY_WALK) if(!IsPlayerInAnyVehicle(playerid)) for(new i;i<ATM_COUNT;i++) if(IsPlayerInDynamicArea(playerid,gATMArea[i])) ShowPlayerDialog(playerid,dBank,2,"{"#cYELLOW"}Услуги банка","1. Баланс банковского счета\n2. Снять с банковского счета\n3. Положить деньги на банковский счет\n4. Оплата недвижимости\n5. Оплата бизнеса\n6. Оплата штрафа","Выбрать","Выйти");
if(newkeys & KEY_CROUCH)
{
if(GetPlayerVirtualWorld(playerid) == 0 && PlayerToPoint(10.0,playerid,713.9270020,-1416.1839600,13.3850012))
{
if(barrier[1]) return 1;
MoveObject(barrier[0],713.9270020,-1416.1739600,13.3750012,0.01,0.0000000,0.0000000,356.7500000);
SetTimer("BarrierClose", 8000, 0);
barrier[1] = 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
if(PlayerToPoint(5.0,playerid,-1950.0366,-1014.1642,32.1443))
{
if(!IsACop(playerid)) return 1;
if(fbida == 1) return 1;
MoveDynamicObject(gBarrier[8], -1952.6964111,-1015.1713867,31.3134995, 2.0);
SetTimerEx("CloseBarrier",5000,0,"i",13);
fbida = 1;
}
}
}
if(newkeys & KEY_YES)
{
if(GetPVarInt(playerid,"Wed") == 2)
{
format(mes, sizeof(mes), "Жених %s и Супруга %s успешно вступили в брак", Name2(WeddingTwo[playerid]), Name2(playerid));
SendClientMessageToAll(0xcc33ffff, mes);
new sendername[32],giveplayer[32];
GetPlayerName(playerid, sendername,MAX_PLAYER_NAME);
GetPlayerName(WeddingTwo[playerid], giveplayer,MAX_PLAYER_NAME);
strmid(pData[playerid][pDivorce], giveplayer, 0, strlen(giveplayer), 32);
strmid(pData[WeddingTwo[playerid]][pDivorce], sendername, 0, strlen(sendername), 32);
new query[128];
format(query,sizeof(query),"UPDATE `members` SET `divorce` = '%s' WHERE `nickname` = '%s'",sendername,Name2(WeddingTwo[playerid]));
mysql_empty(mysql, query);
format(query,sizeof(query),"UPDATE `members` SET `divorce` = '%s' WHERE `nickname` = '%s'",giveplayer,Name2(playerid));
mysql_empty(mysql, query);
WeddingTwo[playerid] = -1;
SetPVarInt(playerid,"Wed",0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 304.6951,307.3586,999.1484)) ShowPlayerDialog(playerid, dSborka, 2, "{ffcc00}Лаборатория", "{"#cWHITE"}1. Создать препарат {"#cYELLOW"}Fiberius\n{"#cWHITE"}2. Создать препарат {"#cYELLOW"}Flara\n{"#cWHITE"}3. Информация о препаратах", "Выбрать", "Закрыть");
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1384.5718,-25.8539,1000.9229)) ShowPlayerDialog(playerid,dGrain,0,"Создание наркотика","{"#cBLUE"}Сборка наркотика:\n\n{"#cWHITE"}1 наркотик = 10 зерен\n\n{"#cYELLOW"}Вы согласны?","Да","Нет");
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1387.5725,-25.3795,1000.9229)) ShowPlayerDialog(playerid, dPodval, 2, "{ffcc00}Подвал", "1. Сделать оружие\n2. Собрать самодельную бомбу", "Выбрать", "Закрыть");
if(GetPVarInt(playerid,"21ShowDiplact") == playerid)
{
new id = GetPVarInt(playerid,"21ShowDiplpl"), id1 = GetPVarInt(playerid,"321ShowDiplact");
format(mes,sizeof(mes),"передал(а) вторую одежду %s",Name2(playerid));
MeAction(id,mes);
SetPlayerSkin(playerid,id1);
pData[playerid][pSkin] = id1;
UpdatePlayerData(playerid,"skin",pData[playerid][pSkin]);
if(GetPVarInt(id,"iderid") == 1)
{
if(pData[id][pSex] == 2) pData[id][pSkin] = 90;
else pData[id][pSkin] = 252;
UpdatePlayerData(id,"skin",pData[id][pSkin]);
SetPlayerSkin(id,pData[id][pSkin]);
new houseid = pData[id][pHouse]-1;
if(!pData[id][pHouse] || !gHouses[houseid][houseImprove][1] || ((houseid+1) > 0 && !GetString(Name2(id),gHouses[houseid][houseOwner]))) {}
else
{
new slot=-1;
for(new i;i<3;i++)
{
if(GetPlayerSkin(id) == gHouses[houseid][houseSkin][i]) return SendClientMessage(id,CGRAY,"У Вас уже есть эта одежда в шкафу.");
if(!gHouses[houseid][houseSkin][i]) {slot = i; break;}
}
gHouses[houseid][houseSkin][slot] = GetPlayerSkin(id);
UpdateHouseDress(houseid);
}
}
else if(GetPVarInt(id,"iderid") == 2)
{
if(pData[id][pSex] == 2) pData[id][pFractionSkin] = 90;
else pData[id][pFractionSkin] = 252;
UpdatePlayerData(id,"fractionskin",pData[id][pFractionSkin]);
SetPlayerSkin(id,pData[id][pFractionSkin]);
}
new houseid = pData[playerid][pHouse]-1;
if(!pData[playerid][pHouse] || !gHouses[houseid][houseImprove][1] || ((houseid+1) > 0 && !GetString(Name2(playerid),gHouses[houseid][houseOwner]))) {}
else
{
new slot=-1;
for(new i;i<3;i++)
{
if(GetPlayerSkin(playerid) == gHouses[houseid][houseSkin][i]) return SendClientMessage(id,CGRAY,"У Вас уже есть эта одежда в шкафу.");
if(!gHouses[houseid][houseSkin][i]) {slot = i; break;}
}
gHouses[houseid][houseSkin][slot] = GetPlayerSkin(playerid);
UpdateHouseDress(houseid);
}
SetPVarInt(playerid,"21ShowDiplpl",-1);
SetPVarInt(playerid,"21ShowDiplact",-1);
}
if(GetPVarInt(playerid,"ShowDiplact") == playerid)
{
new id = GetPVarInt(playerid,"ShowDiplpl");
new mes2[256];
format(mes2,sizeof(mes2),"{"#cBLUE"} Список образований:\n{"#cWHITE"}Юридическое: Изучено на {"#cYELLOW"}%d%%\n{"#cWHITE"}Медицинское: Изучено на {"#cYELLOW"}%d%%\n{"#cWHITE"}Журналистское: Изучено на {"#cYELLOW"}%d%%",pData[id][pObraz1],pData[id][pObraz3],pData[id][pObraz4]);
ShowPlayerDialog(playerid,dMes,0," Образования ",mes2,"OK","");
format(mes,sizeof(mes),"показал(а) образования %s",Name2(playerid));
MeAction(id,mes);
SetPVarInt(playerid,"ShowDiplpl",-1);
SetPVarInt(playerid,"ShowDiplact",-1);
}
if(pTemp[playerid][pShowPassact] == playerid)
{
new acter = pTemp[playerid][pShowPasspl];
ShowPass(acter,playerid);
format(mes,sizeof(mes),"достал(а) паспорт и показал(а) его %s",Name2(playerid));
MeAction(acter,mes);
pTemp[playerid][pShowPassact] = -1;
}
if(pTemp[playerid][pShowLicact] == playerid)
{
new mes2[350];
new acter = pTemp[playerid][pShowLicpl];
strcat(mes2,"{"#cWHITE"}Водительские права: ");
if(pData[acter][pLicenses][LIC_DRIVING]) strcat(mes2,"{739F95}Есть\n");
else strcat(mes2,"{"#cRED"}Нет\n");
strcat(mes2,"{"#cWHITE"}Лицензия пилота: ");
if(pData[acter][pLicenses][LIC_FLY]) strcat(mes2,"{739F95}Есть\n");
else strcat(mes2,"{"#cRED"}Нет\n");
strcat(mes2,"{"#cWHITE"}Лицензия на водный транспорт: ");
if(pData[acter][pLicenses][LIC_BOAT]) strcat(mes2,"{739F95}Есть\n");
else strcat(mes2,"{"#cRED"}Нет\n");
strcat(mes2,"{"#cWHITE"}Лицензия на оружие: ");
if(pData[acter][pLicenses][LIC_WEAP]) strcat(mes2,"{739F95}Есть\n");
else strcat(mes2,"{"#cRED"}Нет\n");
ShowPlayerDialog(playerid,dMes,0,"Ваши лицензии",mes2,"OK","");
format(mes,sizeof(mes),"показал лицензии %s",Name2(playerid));
MeAction(acter,mes);
pTemp[playerid][pShowLicact] = -1;
}
if(pTemp[playerid][pSellHouseOffee] == playerid) //Согласился купить дом
{
new houseid = pTemp[playerid][pSellHouseID];
new price = pTemp[playerid][pSellHousePrice];
new offerid = pTemp[playerid][pSellHouseOffer];
if(!gHouses[houseid][houseOwner] || !pData[offerid][pHouse])
{
ShowMessageEx(playerid, 2, mesnoticetime2,"Дом был продан государству.");
pTemp[offerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHousePrice] = 0;
pTemp[playerid][pSellHouseID] = 0;
return 1;
}
if(pTemp[offerid][pSellHouseOffer] == INVALID_PLAYER_ID || !IsPlayerConnected(offerid))
{
ShowMessageEx(playerid, 2, mesnoticetime2,"Продавец вышел из игры, либо продал дом другому игроку.");
pTemp[offerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHousePrice] = 0;
pTemp[playerid][pSellHouseID] = 0;
return 1;
}
if(GetPlayerMoneyEx(playerid) < price)
{
ShowMessageEx(playerid, 2, mesnoticetime2,"У Вас недостаточно денег на руках.");
ShowMessageEx(offerid, 1, mesnoticetime2,"У покупателя недостаточно денег.");
pTemp[offerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHousePrice] = 0;
pTemp[playerid][pSellHouseID] = 0;
return 1;
}
UpdatePlayerData(offerid,"house",0);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Ошибка MySQL 1");
UpdatePlayerData(playerid,"house",houseid+1);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Ошибка MySQL 2");
new query[256];
format(query,sizeof(query),"UPDATE `houses` SET `ownerid` = '%d', `owner` = '%s',`inhabit2id` = '0',`inhabit3id` = '0',`inhabit4id` = '0',`inhabit2`='',`inhabit3`='',`inhabit4`='' WHERE `id` = '%d'",pData[playerid][pMysqlID],Name2(playerid),houseid+1);
mysql_empty(mysql, query);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Ошибка MySQL 3");
TransferMoney(playerid,offerid,price);
pData[playerid][pHouse] = houseid+1;
pData[offerid][pHouse] = 0;
gHouses[houseid][houseOwnerID] = pData[playerid][pMysqlID];
format(gHouses[houseid][houseOwner],MAX_PLAYER_NAME,"%s",Name2(playerid));
strdel(gHouseHabits[houseid][0],0,24);
strdel(gHouseHabits[houseid][1],0,24);
strdel(gHouseHabits[houseid][2],0,24);
gHouses[houseid][houseHabitID][0] = 0;
gHouses[houseid][houseHabitID][1] = 0;
gHouses[houseid][houseHabitID][2] = 0;
UpdatePlayerData(playerid, "house", pData[playerid][pHouse]);
UpdatePlayerData(offerid, "house", pData[offerid][pHouse]);
if(gHouses[houseid][houseImprove][1])
{
gHouses[houseid][houseSkin][0] = pData[playerid][pSkin];
ShowMessageEx(playerid, 2, mesnoticetime2,"Ваша одежда помещена в шкаф купленного Вами дома.");
}
gHouses[houseid][houseSkin][1] = 0;
gHouses[houseid][houseSkin][2] = 0;
gHouses[houseid][houseSkin][3] = 0;
if(pData[playerid][pFraction]) gHouses[houseid][houseSkin][3] = pData[playerid][pFractionSkin];
UpdateHouseDress(houseid);
if(pData[offerid][pFraction]) SetPlayerSkin(offerid,pData[offerid][pFractionSkin]);
ShowMessageEx(playerid, 2, mesnoticetime2,"Поздравляем, Вы купили дом.");
ShowMessageEx(offerid, 1, mesnoticetime2,"Дом продан.");
pTemp[offerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHousePrice] = 0;
pTemp[playerid][pSellHouseID] = 0;
}
if(pTemp[playerid][pSellBusinessOffee] == playerid) //Согласился купить бизнес
{
new businessid = pTemp[playerid][pSellBusinessID]-1;
new price = pTemp[playerid][pSellBusinessPrice];
new offerid = pTemp[playerid][pSellBusinessOffer];
if(!gBusiness[businessid][busiOwnerID] || !pData[offerid][pBusiness])
{
ShowMessageEx(playerid, 2, mesnoticetime2,"Бизнес был продан государством владельцем.");
pTemp[offerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessPrice] = 0;
pTemp[playerid][pSellBusinessID] = 0;
return 1;
}
if(pTemp[offerid][pSellBusinessOffer] == INVALID_PLAYER_ID || !IsPlayerConnected(offerid))
{
ShowMessageEx(playerid, 2, mesnoticetime2,"Продавец вышел из игры, либо продал бизнес другому игроку.");
pTemp[offerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessPrice] = 0;
pTemp[playerid][pSellBusinessID] = 0;
return 1;
}
if(GetPlayerMoneyEx(playerid) < price)
{
ShowMessageEx(playerid, 2, mesnoticetime2,"У Вас недостаточно денег на руках.");
ShowMessageEx(offerid, 1, mesnoticetime2,"У покупателя недостаточно денег.");
pTemp[offerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessPrice] = 0;
pTemp[playerid][pSellBusinessID] = 0;
return 1;
}
UpdatePlayerData(offerid,"bussiness",0);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Ошибка MySQL 1");
UpdatePlayerData(playerid,"bussiness",businessid+1);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Ошибка MySQL 2");
new query[256];
format(query,sizeof(query),"UPDATE `business` SET `ownerid` = '%d', `owner` = '%s' WHERE `id` = '%d'",pData[playerid][pMysqlID],Name2(playerid),businessid+1);
mysql_empty(mysql, query);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Ошибка MySQL 3");
TransferMoney(playerid,offerid,price);
pData[playerid][pBusiness] = businessid;
pData[offerid][pBusiness] = 0;
gBusiness[businessid][busiOwnerID] = pData[playerid][pMysqlID];
SetString(gBusiness[businessid][busiOwner],Name2(playerid));
UpdateBusinessText(businessid);
UpdatePlayerData(playerid, "bussiness", pData[playerid][pBusiness]);
UpdatePlayerData(offerid, "bussiness", pData[offerid][pBusiness]);
ShowMessageEx(playerid, 2, mesnoticetime2,"Поздравляем, Вы купили бизнес.");
ShowMessageEx(offerid, 1, mesnoticetime2,"Бизнес продан.");
PlayerPlaySound(playerid,1185,0.0,0.0,0.0);
SetTimerEx("PlayerPlaySoundDelay",6900,0,"ii",playerid,1186);
pTemp[offerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessPrice] = 0;
pTemp[playerid][pSellBusinessID] = 0;
}
if(pTemp[playerid][pSettleHouseOffee] == playerid)
{
new houseid = pTemp[playerid][pSettleHouseID];
new offerid = pTemp[playerid][pSettleHouseOffer];
if(pTemp[offerid][pSettleHouseOffer] == INVALID_PLAYER_ID || !IsPlayerConnected(offerid))
{
ShowMessageEx(playerid, 2, mesnoticetime2,"Тот, кто предлагал поселиться у него дома, вышел из игры.");
pTemp[offerid][pSettleHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseID] = 0;
return 1;
}
new slot=-1;
for(new i;i<gHouses[houseid][houseClass];i++) if(!gHouses[houseid][houseHabitID][i]) {slot = i; break;}
if(slot == -1)
{
ShowMessageEx(playerid, 1, mesnoticetime,"В доме нет места.");
ShowMessageEx(offerid, 1, mesnoticetime,"В доме нет места.");
pTemp[offerid][pSettleHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseID] = 0;
}
UpdatePlayerData(playerid,"house",houseid+1);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Произошла ошибка mysql");
new query[128];
format(query,sizeof(query),"UPDATE `houses` SET `inhabit%did`='%d', `inhabit%d`='%s' WHERE `id`='%d'",slot+2,pData[playerid][pMysqlID],slot+2,Name2(playerid),houseid+1);
mysql_empty(mysql, query);
if(mysql_errno()) return SendClientMessage(playerid,CRED,"Произошла ошибка mysql");
SFCM(playerid,CINFO,"Вы стали жильцом в доме {"#cWHITE"}%s",Name2(offerid));
SFCM(offerid,CINFO,"Вы приняли {"#cWHITE"}%s {"#cINFO"}жильцом в свой дом",Name2(playerid));
pData[playerid][pHouse] = houseid+1;
UpdatePlayerData(playerid, "house", pData[playerid][pHouse]);
gHouses[houseid][houseHabitID][slot] = pData[playerid][pMysqlID];
format(gHouseHabits[houseid][slot],MAX_PLAYER_NAME,"%s",Name2(playerid));
pTemp[offerid][pSettleHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSettleHouseID] = 0;
}
if(pTemp[playerid][pSellCarOffee] == playerid)
{
if(!pData[playerid][pPasport]) return ShowMessageEx(playerid, 1, mesnoticetime,"У Вас нету паспорта. Получите его в паспортном столе.");
new offerid = pTemp[playerid][pSellCarOffer];
new price = pTemp[playerid][pSellCarPrice];
if(!pData[playerid][pHouse]) return ShowMessageEx(playerid, 1, mesnoticetime,"У Вас нету дома.");
new houseid = pData[playerid][pHouse]-1;
if(!pData[offerid][pCar])
{
ShowMessageEx(playerid, 2, mesnoticetime2,"Авто было продано государству.");
pTemp[offerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarPrice] = 0;
pTemp[playerid][pSellCarID] = 0;
return 1;
}
if(pTemp[offerid][pSellCarOffer] == INVALID_PLAYER_ID || !IsPlayerConnected(offerid))
{
ShowMessageEx(playerid, 1, mesnoticetime,"Продавец вышел из игры.");
pTemp[offerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarPrice] = 0;
pTemp[playerid][pSellCarID] = 0;
return 1;
}
if(GetPlayerMoneyEx(playerid) < price)
{
ShowMessageEx(playerid, 2, mesnoticetime2,"У Вас недостаточно денег на руках.");
ShowMessageEx(offerid, 1, mesnoticetime2,"У покупателя недостаточно денег.");
pTemp[offerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarPrice] = 0;
pTemp[playerid][pSellCarID] = 0;
return 1;
}
pData[playerid][pCarID] = pData[offerid][pCarID];
pData[playerid][pCar] = pData[offerid][pCar];
pData[playerid][pFuel] = pData[offerid][pFuel];
pData[playerid][pLimit] = pData[offerid][pLimit];
UpdatePlayerData(playerid,"car",pData[offerid][pCar]);
UpdatePlayerData(playerid,"carid",pData[offerid][pCarID]);
UpdatePlayerData(playerid,"limit",pData[offerid][pLimit]);
pData[offerid][pCar] = 0;
pData[offerid][pFuel] = 0;
pData[offerid][pLimit] = 0;
UpdatePlayerData(offerid,"car",0);
UpdatePlayerData(offerid,"fuel",0);
UpdatePlayerData(offerid,"limit",0);
ShowMessageEx(playerid, 2, mesnoticetime2,"Поздравляем. Вы купили т.с.");
ShowMessageEx(offerid, 1, mesnoticetime2,"Т.c. продано.");
TransferMoney(playerid,offerid,price);
DestroyVehicle(gVehicles[pData[offerid][pHouse]][vvID]);
gVehicles[pData[offerid][pHouse]][vvID] = -1;
new vehicleid = CreateVehicle(gTransport[pData[playerid][pCar]-400][trModel],gHouses[houseid][houseParkX],gHouses[houseid][houseParkY],gHouses[houseid][houseParkZ],gHouses[houseid][houseParkR],pData[playerid][pColor1],pData[playerid][pColor2],-1);
gVehicles[pData[playerid][pHouse]][vvID] = vehicleid;
gVehicles[pData[playerid][pHouse]][vProbability] = pData[playerid][pLimit];
gVehicles[pData[playerid][pHouse]][vProbability2] = 1;
SetVehicleHealthEx(gVehicles[pData[playerid][pHouse]][vvID],1000);
ToggleLock(gVehicles[pData[playerid][pHouse]][vvID]);
pTemp[offerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarPrice] = 0;
pTemp[playerid][pSellCarID] = 0;
}
if(GetPVarInt(playerid,"repairoffee") == playerid && GetPVarInt(playerid,"repairoffer") != playerid)
{
new offer = GetPVarInt(playerid,"repairoffer");
new price = GetPVarInt(playerid,"repairprice");
if(GetPVarInt(offer,"repairoffee") == playerid)
{
SetPVarInt(playerid,"repairoffee",-1);
SetPVarInt(playerid,"repairoffer",-1);
SetPVarInt(playerid,"repairprice",0);
SetPVarInt(offer,"repairoffee",0);
new vehicleid = GetPlayerVehicleID(playerid);
if(!vehicleid) return ShowMessageEx(playerid, 1, mesnoticetime,"Вы должны быть в т.с.");
if(GetPlayerMoneyEx(playerid) < price) return ShowMessageEx(playerid, 1, mesnoticetime,"У Вас недостаточно денег.");
TransferMoney(playerid,offer,price);
SetVehicleHealthEx(vehicleid,1000.0);
RepairVehicle(vehicleid);
SFCM(playerid,CBLUE,"Вам отремонтировали т.с. за $%d",price);
SFCM(offer,CBLUE,"Вы отремонтировали т.с. за $%d",price);
}
}
if(GetPVarInt(playerid,"gunoffee") == playerid && GetPVarInt(playerid,"gunoffer") != playerid)
{
new offer = GetPVarInt(playerid,"gunoffer");
new price = GetPVarInt(playerid,"gunprice");
new needammo = GetPVarInt(playerid,"gunammo");
new weaponid = GetPVarInt(playerid,"gunid");
if(GetPVarInt(offer,"gunoffee") == playerid)
{
SetPVarInt(playerid,"gunoffee",0);
SetPVarInt(playerid,"gunoffer",0);
SetPVarInt(playerid,"gunammo",0);
SetPVarInt(playerid,"gunprice",0);
SetPVarInt(playerid,"gunid",0);
SetPVarInt(offer,"gunoffee",0);
new slot = GetWeaponSlot(weaponid);
new weapon,ammo;
GetPlayerWeaponData(offer,slot,weapon,ammo);
if(weapon != weaponid || ammo < needammo) return ShowMessageEx(playerid, 1, mesnoticetime,"У продавца закончилось оружие.");
new remain = ammo - needammo;
if(remain > ammo) return 1;
if(GetPlayerMoneyEx(playerid) < price) return ShowMessageEx(playerid, 1, mesnoticetime,"У Вас недостаточно денег.");
pData[offer][pAmmo] += remain;
UpdatePlayerData(offer,"ammo",pData[offer][pAmmo]);
GivePlayerWeaponEx(playerid,weaponid,needammo);
SetPlayerAmmoEx(offer,weaponid,0);
SetPlayerArmedWeapon(offer,0);
TransferMoney(playerid,offer,price);
format(mes,sizeof(mes),"продал оружие %s",Name2(playerid));
MeAction(offer,mes);
ShowInfo(offer,2,remain,1);
SendClientMessage(offer,CGREEN,"Вы продали оружие, и оставшиеся патроны были вам возвращены");
}
}
else if(GetPVarInt(playerid,"selectpoint") == 2)
{
new driverid = GetPVarInt(playerid,"taxidriver");
if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER || GetPlayerVehicleID(playerid) != pTemp[driverid][pTaxiID])
{
SetPVarInt(playerid,"selectpoint",0);
SetPVarInt(playerid,"taxidriver",0);
RemovePlayerMapIcon(playerid,iconTaxi);
}
new Float:x, Float:y;
x = GetPVarFloat(playerid,"selectpointX");
y = GetPVarFloat(playerid,"selectpointY");
SetPlayerMapIcon(driverid,iconTaxi,x,y,0.0,0,CYELLOW,1);
SetPVarFloat(playerid,"selectpointX",x);
SetPVarFloat(playerid,"selectpointY",y);
SetPVarInt(playerid,"selectpoint",0);
SetPVarInt(driverid,"selectpoint",0);
SendClientMessage(playerid,CINFO,"Данные о месте назначения отправлены таксисту");
SendClientMessage(driverid,CINFO,"Пассажир установил {"#cYELLOW"}метку {"#cINFO"}на карте. Чтобы убрать метку введите: {"#cWHITE"}/untaxi");
}
}
if(newkeys & KEY_NO)
{
if(GetPVarInt(playerid,"Wed") == 2)
{
SendClientMessage(playerid,CBLUE,"Вы отвергли предложение вступить в брак");
SendClientMessage(WeddingTwo[playerid],CBLUE,"Вам отвергли предложение вступить в брак");
WeddingTwo[playerid] = -1;
SetPVarInt(playerid,"Wed",0);
}
if(pTemp[playerid][pShowPassact] == playerid)
{
SendClientMessage(playerid,-1,"Вы отказались от предложения");
SendClientMessage(pTemp[playerid][pShowPasspl],-1,"Игрок отказался от предложения");
pTemp[playerid][pShowPassact] = -1;
}
if(pTemp[playerid][pShowLicact] == playerid)
{
SendClientMessage(playerid,-1,"Вы отказались от предложения");
SendClientMessage(pTemp[playerid][pShowLicpl],-1,"Игрок отказался от предложения");
pTemp[playerid][pShowLicact] = -1;
}
if(playerid == pTemp[playerid][pSellHouseOffee])
{
new offerid = pTemp[playerid][pSellHouseOffer];
SendClientMessage(playerid,CGRAY,"Вы отказались от покупки дома");
SendClientMessage(offerid,CGRAY,"Покупатель отказался покупать дом");
pTemp[offerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHouseOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellHousePrice] = 0;
pTemp[playerid][pSellHouseID] = 0;
}
if(pTemp[playerid][pSellBusinessOffee] == playerid)
{
new offerid = pTemp[playerid][pSellBusinessOffer];
SendClientMessage(playerid,CGRAY,"Вы отказались от покупки бизнеса");
SendClientMessage(offerid,CGRAY,"Покупатель отказался покупать бизнес");
pTemp[offerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellBusinessPrice] = 0;
pTemp[playerid][pSellBusinessID] = 0;
}
else if(pTemp[playerid][pSellCarOffee] == playerid)
{
new offerid = pTemp[playerid][pSellCarOffer];
SendClientMessage(playerid,CGRAY,"Вы отказались от покупки т/с");
SendClientMessage(offerid,CGRAY,"Покупатель отказался покупать т/с");
pTemp[offerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffer] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarOffee] = INVALID_PLAYER_ID;
pTemp[playerid][pSellCarPrice] = 0;
pTemp[playerid][pSellCarID] = 0;
}
if(GetPVarInt(playerid,"repairoffee") == playerid)
{
new offer = GetPVarInt(playerid,"repairoffer");
if(GetPVarInt(offer,"repairoffee") == playerid)
{
SetPVarInt(playerid,"repairoffee",-1);
SetPVarInt(playerid,"repairoffer",-1);
SetPVarInt(playerid,"repairprice",0);
SetPVarInt(offer,"repairoffee",0);
SendClientMessage(playerid,CBLUE,"Вы отказались от ремонта");
SendClientMessage(offer,CBLUE,"Клиент отказался от ремонта");
}
}
else StatisticData(playerid);
}
if(newkeys & KEY_WALK)
{
if(GetPlayerVirtualWorld(playerid) == 6)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, -4.6460,389.2099,1043.7756)) ShowPlayerDialog(playerid,dBuygun,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"Silenced Colt 45\"\n{FFFFFF}Кол-во патрон: {E2880E}150\n{FFFFFF}Стоимость: {31B522}2700$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, -4.2930,383.2103,1043.7756)) ShowPlayerDialog(playerid,dBuygun1,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"Desert Eagle\"\n{FFFFFF}Кол-во патрон: {E2880E}90\n{FFFFFF}Стоимость: {31B522}3200$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, -7.1549,387.3505,1043.7756)) ShowPlayerDialog(playerid,dBuygun3,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"MP5\"\n{FFFFFF}Кол-во патрон: {E2880E}150\n{FFFFFF}Стоимость: {31B522}3500$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, -1.7310,386.5650,1043.7756)) ShowPlayerDialog(playerid,dBuygun4,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"Shotgun\"\n{FFFFFF}Кол-во патрон: {E2880E}60\n{FFFFFF}Стоимость: {31B522}4000$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, -4.2970,386.5428,1043.7756)) ShowPlayerDialog(playerid,dBuygun5,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"Baseball Bat\"\n{FFFFFF}Стоимость: {31B522}$100","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, 0.8463,387.4106,1043.7756)) ShowPlayerDialog(playerid,dBuygun6,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"Sniper\"\n{FFFFFF}Кол-во патрон: {E2880E}40\n{FFFFFF}Стоимость: {31B522}6000$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, 0.2692,389.2097,1043.7756)) ShowPlayerDialog(playerid,dBuygun7,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"M4\"\n{FFFFFF}Кол-во патрон: {E2880E}200\n{FFFFFF}Стоимость: {31B522}4200$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, -6.5778,389.2104,1043.7756)) ShowPlayerDialog(playerid,dBuygun8,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить это оружие ?\n\n\"AK-47\"\n{FFFFFF}Кол-во патрон: {E2880E}200\n{FFFFFF}Стоимость: {31B522}4200$","Купить","Отмена");
else if (IsPlayerInRangeOfPoint(playerid, 1.0, -1.7590,382.9603,1043.7756)) ShowPlayerDialog(playerid,dBuygun9,DIALOG_STYLE_MSGBOX,"{1B8E06}Выбор оружия","{FFFFFF}Желаете купить бронежилет ?\n\n{FFFFFF}Стоимость: {31B522}1000$","Купить","Отмена");
}
if(GetPlayerVirtualWorld(playerid) == 0)
{
if(GetPVarInt(playerid, "SleepSpawn"))
{
new Float:x, Float:y, Float:z;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
ClearAnimations(playerid);
DeletePVar(playerid, "SleepSpawn");
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y-1,z);
}
else if(PlayerToPoint(2.0,playerid,723.1499,-1432.3470,14.0580)) SetPlayerPosAnim(playerid,723.1499,-1432.3470,14.0580), SetPlayerFacingAngle(playerid, 167.0561), GoAnim(playerid,"CRACK","Crckidle2",4.1,1,0,0,0,0,0),SendClientMessage(playerid,CYELLOW,"Нажмите ALT, чтобы встать."),SetPVarInt(playerid,"SleepSpawn",1);
else if(PlayerToPoint(2.0,playerid,728.6383,-1432.3848,14.0580)) SetPlayerPosAnim(playerid,728.6383,-1432.3848,14.0580), SetPlayerFacingAngle(playerid, 167.0561), GoAnim(playerid,"CRACK","Crckidle2",4.1,1,0,0,0,0,0),SendClientMessage(playerid,CYELLOW,"Нажмите ALT, чтобы встать."),SetPVarInt(playerid,"SleepSpawn",1);
else if(PlayerToPoint(2.0,playerid,734.0121,-1432.3921,14.0580)) SetPlayerPosAnim(playerid,734.0121,-1432.3921,14.0580), SetPlayerFacingAngle(playerid, 167.0561), GoAnim(playerid,"CRACK","Crckidle2",4.1,1,0,0,0,0,0),SendClientMessage(playerid,CYELLOW,"Нажмите ALT, чтобы встать."),SetPVarInt(playerid,"SleepSpawn",1);
}
if(pData[playerid][pQuest][0] == 2)
{
if(PlayerToPoint(0.3,playerid,1833.9944,-2165.6191,2949.7473)) SetPlayerFacingAngle(playerid, 0.6121), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
else if(PlayerToPoint(0.3,playerid,1834.0206,-2168.0601,2949.7473)) SetPlayerFacingAngle(playerid, 0.6121), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
else if(PlayerToPoint(0.3,playerid,1834.0361,-2169.4924,2949.7473)) SetPlayerFacingAngle(playerid, 0.6121), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
else if(PlayerToPoint(0.3,playerid,1831.7480,-2170.9216,2949.7473)) SetPlayerFacingAngle(playerid, 0.6121), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
else if(PlayerToPoint(0.3,playerid,1831.5653,-2169.1880,2949.1729)) SetPlayerFacingAngle(playerid, 0.6121), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
else if(PlayerToPoint(0.3,playerid,1831.5880,-2166.7878,2949.1729)) SetPlayerFacingAngle(playerid, 0.6121), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
else if(PlayerToPoint(0.3,playerid,1831.6511,-2165.0044,2949.7400)) SetPlayerFacingAngle(playerid, 183.2870), GoAnim(playerid,"MISC","seat_LR",4.1,1,0,0,0,0,0), SetPVarInt(playerid, "SeatOkay",1);
}
if(GetPlayerVirtualWorld(playerid) == 1 || GetPlayerVirtualWorld(playerid) == 2 || GetPlayerVirtualWorld(playerid) == 3)
{
if(PlayerToPoint(2.0,playerid,1708.7024,-1670.2324,23.7057))
{
if(pData[playerid][pOtelNomer] != 1) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №1");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7043,-1665.0304,23.7044))
{
if(pData[playerid][pOtelNomer] != 2) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №2");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7029,-1659.8270,23.7031))
{
if(pData[playerid][pOtelNomer] != 3) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №3");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7021,-1654.5770,23.7018))
{
if(pData[playerid][pOtelNomer] != 4) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №4");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7019,-1649.3079,23.6953))
{
if(pData[playerid][pOtelNomer] != 5) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №5");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0483,-1642.2540,23.7578))
{
if(pData[playerid][pOtelNomer] != 6) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №6");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0646,-1648.1945,23.7448))
{
if(pData[playerid][pOtelNomer] != 7) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №7");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0820,-1654.0867,23.7318))
{
if(pData[playerid][pOtelNomer] != 8) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №8");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0988,-1660.0123,23.7188))
{
if(pData[playerid][pOtelNomer] != 9) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №9");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7017,-1670.2111,27.1953))
{
if(pData[playerid][pOtelNomer] != 10) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №10");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7028,-1665.0184,27.1953))
{
if(pData[playerid][pOtelNomer] != 11) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №11");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7098,-1659.7622,27.1953))
{
if(pData[playerid][pOtelNomer] != 12) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №12");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7083,-1654.5234,27.1953))
{
if(pData[playerid][pOtelNomer] != 13) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №13");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1708.7184,-1649.2904,27.1953))
{
if(pData[playerid][pOtelNomer] != 14) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №14");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0482,-1642.3508,27.2392))
{
if(pData[playerid][pOtelNomer] != 15) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №15");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0631,-1648.2434,27.2304))
{
if(pData[playerid][pOtelNomer] != 16) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №16");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0767,-1654.1727,27.2216))
{
if(pData[playerid][pOtelNomer] != 17) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №17");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
if(PlayerToPoint(2.0,playerid,1735.0927,-1660.0815,27.2128))
{
if(pData[playerid][pOtelNomer] != 18) return SendClientMessage(playerid,CBLUE,"Вы не владелец гостиничного номера №18");
if(GetPlayerVirtualWorld(playerid) != pData[playerid][pOtel]) return SendClientMessage(playerid,CBLUE,"Вы не проживаете в этом отеле");
SetPlayerPos(playerid,-2168.4741,642.1261,1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,playerid);
}
}
if(GetPVarInt(playerid,"IsInKamera") == 2)
{
if(PlayerToPoint(2.0,playerid,-310.6909,-257.2500,1082.7289))
{
SetPlayerPos(playerid,-307.6929,-256.9103,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-310.6935,-262.6185,1082.7289))
{
SetPlayerPos(playerid,-307.9105,-262.6128,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-310.6912,-267.9289,1082.7289))
{
SetPlayerPos(playerid,-307.3654,-268.0378,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-310.7006,-273.1307,1082.7289))
{
SetPlayerPos(playerid,-307.3427,-273.4765,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-319.0814,-257.3622,1082.7289)) // 5
{
SetPlayerPos(playerid,-321.5524,-257.2225,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-319.0825,-262.6073,1082.7289))
{
SetPlayerPos(playerid,-321.7930,-262.7053,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-319.0825,-267.8094,1082.7289))
{
SetPlayerPos(playerid,-321.8169,-268.1629,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
if(PlayerToPoint(2.0,playerid,-319.0816,-273.3595,1082.7289)) // 8
{
SetPlayerPos(playerid,-322.0327,-273.5317,1082.7289);
SetPVarInt(playerid,"IsInKamera",3);
}
}
if(GetPVarInt(playerid,"IsInHouse") == 1)
{
new houseid = pTemp[playerid][pSelectedHouseID];
new hint = gHouses[houseid][houseHint];
new Float:x, Float:y, Float:z;
x = gHints[hint][hintX];
y = gHints[hint][hintY];
z = gHints[hint][hintZ];
if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
{
if(gHouses[houseid][houseImprove][0])
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPVarInt(playerid,"JustTP",1);
SetPlayerPos(playerid,gHouses[houseid][houseX],gHouses[houseid][houseY],gHouses[houseid][houseZ]);
SetPlayerFacingAngle(playerid,gHouses[houseid][houseR]);
SetPVarInt(playerid,"IsInHouse",0);
}
else ShowMessageEx(playerid, 1, mesnoticetime,"Улучшение отсутствует. Используйте /exit");
}
}
if(PlayerToPoint(3,playerid,1380.5771,-13.3953,1000.9246)) OnPlayerCommandText(playerid, "/gohome");
if(PlayerToPoint(3,playerid,1394.4858,-19.7839,1000.9229)) ShowPlayerDialog(playerid,dGaraj,2,"Ваше личное т.с","1. Загнать в подвал / гараж\n2. Отогнать к дому\n3. Заменить движок","ОК","Отмена");
}
if (newkeys & KEY_SECONDARY_ATTACK)
{
if(GetPVarInt(playerid,"SelectStoreGun") == 1)
{
new Float:x, Float:y, Float:z, Float:x1, Float:y1, Float:z1;
x = GetPVarFloat(playerid,"oldcx");
y = GetPVarFloat(playerid,"oldcy");
z = GetPVarFloat(playerid,"oldcz");
GetPlayerCameraPos(playerid,x1,y1,z1);
InterpolateCameraPos(playerid,x1,y1,z1,x,y,z,700,CAMERA_MOVE);
SetTimerEx("SetCameraBehindPlayerDelay",1000,false,"i",playerid);
SetPVarInt(playerid,"SelectStoreGun",0);
pTemp[playerid][pStoreGun] = 0;
GameTextForPlayer(playerid," ",100,3);
TogglePlayerControllable(playerid,1);
}
if(GetPVarInt(playerid,"ChangingSkin") == 1)
{
SetPVarInt(playerid,"ChangingSkin",0);
SetPlayerSkin(playerid,pData[playerid][pSkin]);
SetPlayerVirtualWorld(playerid,1);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPVarInt(playerid,"JustTP",1);
GameTextForPlayer(playerid,"_",200,3);
}
new houseid = pData[playerid][pHouse] - 1;
new hintid = gHouses[houseid][houseHint];
if(PlayerToPoint(1,playerid,gHintDress[hintid][0][0],gHintDress[hintid][0][1],gHintDress[hintid][0][2])) return OnPlayerCommandText(playerid, "/store");
if(PlayerToPoint(3,playerid,322.1280,1118.8314,1083.8828)) return OnPlayerCommandText(playerid, "/buygrain");
}
if (newkeys & KEY_CTRL_BACK)
{
if(IsGang(pData[playerid][pFraction]) && IsPlayerInDynamicArea(playerid,gAreas[arArmyAmmo]))
{
if(GetPVarInt(playerid,"carrygun")) return ShowMessageEx(playerid, 1, mesnoticetime,"У Вас уже есть ящик с оружием.");
new armyid = GetPlayerVirtualWorld(playerid);
if(gArmyWarehouse[armyid][0] < 100 && gArmyWarehouse[armyid][0] < 100) return ShowMessageEx(playerid, 1, mesnoticetime,"Неостаточно боеприпасов на складе.");
if(gArmyWarehouse[armyid][0] >= 100)
{
gArmyWarehouse[armyid][0] -= 100;
SetPVarInt(playerid,"carrygun",100);
}
if(gArmyWarehouse[armyid][1] >= 100)
{
gArmyWarehouse[armyid][1] -= 100;
SetPVarInt(playerid,"carryammo",100);
}
WHDataUpdate();
SetPlayerFacingAngle(playerid,270.0);
ClearAnimations(playerid);
ApplyAnimation(playerid,"CARRY","putdwn",4.0,0,1,1,0,0,1);
SetPlayerSpecialAction (playerid, SPECIAL_ACTION_CARRY);
SetPlayerAttachedObject(playerid,0,2358,6,0.0,0.10,-0.2, -110.0,0.0,78.0);
}
if((pData[playerid][pFraction] == 8 || pData[playerid][pFraction] == 9) && IsPlayerInDynamicArea(playerid,gAreas[arZavodSklad2]))
{
if(!GetPVarInt(playerid,"carrygun"))
{
SetPlayerFacingAngle(playerid,270.0);
ClearAnimations(playerid);
ApplyAnimation(playerid,"CARRY","putdwn",4.0,0,1,1,0,0,1);
SetPlayerSpecialAction (playerid, SPECIAL_ACTION_CARRY);
SetPlayerAttachedObject(playerid,0,2358,6,0.0,0.10,-0.2, -110.0,0.0,78.0);
SetPVarInt(playerid,"carrygun",500);
}
}
}
if (newkeys & KEY_FIRE)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid) ToggleLamp(vehicleid, playerid);
}
}
return 1;
}
