Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int GetCurrZoneID(CPed *playa2) {
- unsigned int zone1 = CTheZones::m_CurrLevel;
- auto zoneName1 = CTheZones::FindSmallestZoneForPosition(playa2->GetPosition(), true);
- if (playa2->m_pEnex) {
- CEntryExit *playaEnex = reinterpret_cast<CEntryExit *>(playa2->m_pEnex);
- CVector playaEnexPos = playaEnex->m_vecExitPos;
- zoneName1 = CTheZones::FindSmallestZoneForPosition(playaEnexPos, true);
- if (PointWithinRectangle(playaEnexPos, -728.85f, 1249.78f, 855.36f, 2901.67f)) {
- zone1 = THE_DESERT;
- } else {
- if (PointWithinRectangle(playaEnexPos, 3000.0f, -200.0f, 8500.0f, 3500.0f)) { // LC
- zone1 = LIBERTY_CITY;
- } else {
- if (PointWithinRectangle(playaEnexPos, 3000.0f, -4500.0f, 8500.0f, -200.0f)) { // VC
- zone1 = VICE_CITY;
- }
- }
- }
- }
- std::string zoneName1Txt = zoneName1->m_szTextKey;
- auto playa3 = playa2;
- // CMessages::AddMessage(zoneName1->m_szTextKey, -1, true, true);
- if (zoneName1Txt == "BONE" || zoneName1Txt == "SUNMA" || zoneName1Txt == "SUNNN" || zoneName1Txt == "BIGE" ||
- zoneName1Txt == "ELQUE" || zoneName1Txt == "BARRA" || zoneName1Txt == "CARSO" || zoneName1Txt == "PAYAS" ||
- zoneName1Txt == "PROBE" || zoneName1Txt == "ELCA" || zoneName1Txt == "ARCO" || zoneName1Txt == "VALLE" ||
- zoneName1Txt == "ROBINT" || zoneName1Txt == "TOM" || zoneName1Txt == "ALDEA" || zoneName1Txt == "BRUJA" ||
- zoneName1Txt == "ROBAD" || zoneName1Txt == "QUARY" || zoneName1Txt == "OCTAN" || zoneName1Txt == "PALMS" ||
- zoneName1Txt == "DAM" || zoneName1Txt == "MEAD" || zoneName1Txt == "REST" || zoneName1Txt == "BYTUN" ||
- playa3->IsWithinArea(-728.85f, 1249.78f, 855.36f, 2901.67f)) {
- zone1 = THE_DESERT;
- }
- if (playa3->IsWithinArea(3000.0f, -200.0f, 8500.0f, 3500.0f)) {
- zone1 = LIBERTY_CITY;
- } else {
- if (playa3->IsWithinArea(3000.0f, -4500.0f, 8500.0f, -200.0f)) {
- zone1 = VICE_CITY;
- }
- }
- // PointWithinRectangle(playaEnexPos, -728.85f, 1249.78f, 855.36f, 2901.67f);
- return zone1;
- }
- static bool PointWithinRectangle(CVector pointA, float leftCornerX, float leftCornerY, float rightCornerX, float rightCornerY) {
- if (pointA.x > leftCornerX && pointA.x < rightCornerX && pointA.y > leftCornerY && pointA.y < rightCornerY) {
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement