Вопросы

Chopick
Новичок

Всем здравствуйте! Делаю систему домов/бизнесов по туториалу knox know с плагином GoodArea. Есть проблема, если заходишь в интерьер бизнеса, то когда выходишь спавнит почему-то на пикап дома.

Вот енумы:
 


#define MAX_HOUSES 1000
#define MAX_BIZS 1000

enum house
{
        hID,
        STREAMER_TAG_PICKUP:hPICKUP,
        STREAMER_TAG_AREA:hAREA,
        hOWNER[MAX_PLAYER_NAME],
        STREAMER_TAG_3D_TEXT_LABEL:hTEXT[256],
        STREAMER_TAG_MAP_ICON:hICON,
        hPRICE,
        hCLASS,
        hINTERIOR,
        Float:hX,
        Float:hY,
        Float:hZ,
        Float:hA,
        hCONDITION // Закрыт/Открыт
}
new House[MAX_HOUSES][house];
new Houses;
new HouseGroup;

enum biz
{
        bID,
        STREAMER_TAG_PICKUP:bPICKUP,
        STREAMER_TAG_AREA:bAREA,
        bOWNER[MAX_PLAYER_NAME],
        STREAMER_TAG_3D_TEXT_LABEL:bTEXT[256],
        STREAMER_TAG_MAP_ICON:bICON,
        bNAME[25],
        bPRICE,
        bTYPE,
        bINTERIOR,
        Float:bX,
        Float:bY,
        Float:bZ,
        Float:bA
}
new Biz[MAX_BIZS][biz];
new Bizs;
new BizGroup;

enum interior_info
{
        intID,
        intNAME[41],
        intINTERIOR,
        Float:intX,
        Float:intY,
        Float:intZ,
        Float:intA,
        STREAMER_TAG_AREA:intAREA
}
new Interior[MAX_INTERIORS][interior_info];
new Interiors;
new InteriorGroup;

Вот что у меня в OnGameModeInit:

HouseGroup = CreateGroupGoodAreas(GoodArea:HouseEnter);
InteriorGroup = CreateGroupGoodAreas(GoodArea:InteriorExit);
BizGroup = CreateGroupGoodAreas(GoodArea:BizArea);

 

Вот стоки:

GAResponse:HouseEnter(playerid, response, key, index)
{
        switch(response)
        {
            case GA_RESPONSE_PRESS_KEY:
            {
                if(key & KEY_WALK)
                {
                if(House[index][hCONDITION] > 0 && House[index][hOWNER] == player_info[playerid][NAME] || House[index][hCONDITION] == 0)
                {
                                        GoToInterior(playerid, House[index][hINTERIOR]);
                                        SetPlayerVirtualWorld(playerid, index);
                                }
                                else if(House[index][hCONDITION] > 0 && House[index][hOWNER] != player_info[playerid][NAME]) return SCM(playerid, COLOR_RED, "[Ошибка]{ffffff}Этот дом закрыт на ключ!");
                        }
                }
                case GA_RESPONSE_ENTER:
                {
                    if(House[index][hOWNER] == 0)
                    {
                        CreateNoOwnerHouseTD(playerid);
                        for(new i = 0; i < sizeof NoOwnerTextDraw_PTD[]; i++)
                        {
                            PlayerTextDrawShow(playerid, NoOwnerTextDraw_PTD[playerid][i]);
                                }
                                new price[8];
                                format(price, sizeof(price), "%d$", House[index][hPRICE]);
                                PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][2], price);
                                new id[9];
                                format(id, sizeof(id), "%d", House[index][hID]);
                                PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][0], id);
                                switch(House[index][hCLASS])
                                {
                                    case 1: PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][1], "A");
                                    case 2: PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][1], "B");
                                    case 3: PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][1], "C");
                                }
                                for(new i = 0; i < sizeof NoOwnerTextDraw_TD; i++)
                        {
                            TextDrawShowForPlayer(playerid, NoOwnerTextDraw_TD[i]);
                                }
                        }
                }
                case GA_RESPONSE_LEAVE:
                {
                for(new i = 0; i < sizeof NoOwnerTextDraw_PTD[]; i++)
                {
                    PlayerTextDrawHide(playerid, NoOwnerTextDraw_PTD[playerid][i]);
                        }
                        for(new i = 0; i < sizeof NoOwnerTextDraw_TD; i++)
                {
                    TextDrawHideForPlayer(playerid, NoOwnerTextDraw_TD[i]);
                        }
                }
        }
        return 1;
}

GAResponse:BizArea(playerid, response, key, index)
{
        switch(response)
        {
            case GA_RESPONSE_PRESS_KEY:
            {
                if(key & KEY_WALK)
                {
                    GoToInteriorBiz(playerid, Biz[index][bINTERIOR]);
                                SetPlayerVirtualWorld(playerid, index);
                }
                }
        }
        return 1;
}

GAResponse:InteriorExit(playerid, response, key, index)
{
        switch(response)
        {
            case GA_RESPONSE_PRESS_KEY:
            {
                new world = GetPlayerVirtualWorld(playerid);
                if(key & KEY_WALK)
                {
                    if(world < MAX_HOUSES)
                    {
                        SetPlayerInterior(playerid, 0);
                            SetPlayerVirtualWorld(playerid, 0);
                            SetPlayerPos(playerid, House[world][hX], House[world][hY], House[world][hZ]);
                            SetPlayerFacingAngle(playerid, House[world][hA]);
                                }
                                else if(world < MAX_HOUSES + MAX_BIZS)
                    {
                        world -= MAX_HOUSES;
                                        printf("%d index world", world);
                        SetPlayerInterior(playerid, 0);
                            SetPlayerVirtualWorld(playerid, 0);
                            SetPlayerPos(playerid, Biz[world][bX], Biz[world][bY], Biz[world][bZ]);
                            SetPlayerFacingAngle(playerid, Biz[world][bA]);
                                }
                        }
                        if(key & KEY_CTRL_BACK)
                        {
                            if(player_info[playerid][HOUSE] != House[world][hID]) return SCM(playerid, COLOR_RED, "[Ошибка]{ffffff}Вы не владелец данного дома!");
                            new dialog[256];
                                format(dialog, sizeof(dialog),
                                        "{ffd900}[1]{ffffff}Информация о доме\n\
                                        {ffd900}[2]{ffffff}%s дом",
                                (House[world][hCONDITION] == 1) ? ("{00ff00}Открыть") : ("{ff0000}Закрыть"));
                            SPD(playerid, DLG_HMENU, DIALOG_STYLE_LIST, "{ffd900}Меню дома", dialog, "Выбрать", "Закрыть");
                            return 1;
                        }
                }
        }
        return 1;
}

stock GoToInterior(playerid, interior)
{
    for(new i = 0; i < Interiors; i++)
        {
            if(Interior[i][intID] != interior) continue;
            SetPlayerInterior(playerid, Interior[i][intINTERIOR]);
            SetPlayerPos(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ]);
            SetPlayerFacingAngle(playerid, Interior[i][intA]);
            SetPlayerCheckpoint(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 1.0);
            new str[128];
            format(str, sizeof(str),
                        "Нажмите \"ALT\" для выхода\n\
                        Нажмите \"H\", чтобы открыть меню дома");
            Create3DTextLabel(str, -1, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 15.0, 0, 1);
            return 1;
        }
        return 0;
}

stock GoToInteriorBiz(playerid, interior)
{
    for(new i = 0; i < Interiors; i++)
        {
            if(Interior[i][intID] != interior) continue;
            SetPlayerInterior(playerid, Interior[i][intINTERIOR]);
            SetPlayerPos(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ]);
            SetPlayerFacingAngle(playerid, Interior[i][intA]);
            SetPlayerCheckpoint(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 1.0);
            new str[128];
            format(str, sizeof(str),
                        "Нажмите \"ALT\" для выхода");
            Create3DTextLabel(str, -1, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 15.0, 0, 1);
            return 1;
        }
        return 0;
}

 

 

Что мне делать, подскажите пожалуйста?

Поделиться сообщением


Ссылка на сообщение

1 ответ на этот вопрос

  • 0
Vilvetto
Новичок

@Chopick Привет, я хочу помогать бесплатно я такойже новичек в этом деле, давайте  я помогу, но обьясните сперва. Что это CRMP или SAMP и какая версия. Я практик, делаю методом проб и ошибок. 

 

@Chopick У меня сейчас еще не скачена игра и не настроен павн, я займусь этим. Можете пока забыть о своей проблеме, я постараюсь что-нибудь сделать, займитесь чем - нибудь еще. Но Вам придётся подождать

 

@Chopick Я скобку в лево убрал, не знаю это повлияет или нет. Я практик, мне нужен мод и самому разбирать. Я попробую вставить код этот себе, но не знаю зарабоает он или нет. Подправте скобочку как у меня, может из-за неё? Но что-то сомниваюсь

GAResponse:BizArea(playerid, response, key, index)
{
        switch(response)
        {
            case GA_RESPONSE_PRESS_KEY:
            {
                if(key & KEY_WALK)
                {
                    GoToInteriorBiz(playerid, Biz[index][bINTERIOR]);
                                SetPlayerVirtualWorld(playerid, index);
                }
            }
        }
        return 1;
}

Заметка от Cawfee , создано

Поставил вас на премодерацию.

Поделиться сообщением


Ссылка на сообщение
Гость
Эта тема закрыта для публикации ответов.
  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

  • Похожий контент

    • patrickk
      От patrickk
      Всем привет, решил написать dm сервер и довольно хорошим получился, даже на голову выше Goat dm. Оставил не решенную проблему тем что  у меня есть 4 локации с rp run и cj run ну а как добавить cj бег на те локации не знаю и как эта система работает. Надеюсь мне помогут знающие люди
    • Samolet
      От Samolet
      Здраствуйте, cоздаю копию Arizona на ОМП, опен мультиплеер, загрузил и подключил бд, но сервер не хочет вот лог :[2026-10-20T21:03:32+0300] [Info] Log file reloaded. Starting open.mp server (1.5.8.3079) from commit c6759bd8d265171ae3d86598895a23d5a8d92a3b Loading component $CAPI.so Successfully loaded component C-API (1.5.8.3079) with UID 10467dd8d4c56fc6 Loading component LegacyConfig.so Successfully loaded component LegacyConfig (1.5.8.3079) with UID 24ef6216838f9ffc Loading component NPCs.so Successfully loaded component NPCs (1.5.8.3079) with UID 3d0e59e87f4e90bc Loading component Recordings.so Successfully loaded component Recordings (1.5.8.3079) with UID 871144d399f5f613 Loading component Checkpoints.so Successfully loaded component Checkpoints (1.5.8.3079) with UID 44a937350d611dde Loading component TextDraws.so Successfully loaded component TextDraws (1.5.8.3079) with UID 9b5dc2b1d15c992a Loading component Pawn.so Successfully loaded component Pawn (1.5.8.3079) with UID 78906cd9f19c36a6 Loading component GangZones.so Successfully loaded component GangZones (1.5.8.3079) with UID b3351d11ee8d8056 Loading component Actors.so Successfully loaded component Actors (1.5.8.3079) with UID c81ca021eae2ad5c Loading component Pickups.so Successfully loaded component Pickups (1.5.8.3079) with UID cf304faa363dd971 Loading component Dialogs.so Successfully loaded component Dialogs (1.5.8.3079) with UID 44a111350d611dde Loading component Objects.so Successfully loaded component Objects (1.5.8.3079) with UID 59f8415f72da6160 Loading component Console.so Successfully loaded component Console (1.5.8.3079) with UID bfa24e49d0c95ee4 Loading component TextLabels.so Successfully loaded component TextLabels (1.5.8.3079) with UID a0c57ea80a009742 Loading component Variables.so Successfully loaded component Variables (1.5.8.3079) with UID 75e121848bc01fa2 Loading component Databases.so Successfully loaded component Databases (1.5.8.3079) with UID 80092e7eb5821a96 Loading component LegacyNetwork.so Successfully loaded component RakNetLegacyNetwork (1.5.8.3079) with UID ea9799fd79cf8442 Loading component CustomModels.so Successfully loaded component CustomModels (1.5.8.3079) with UID 15e3cb1e7c77ffff Loading component Menus.so Successfully loaded component Menus (1.5.8.3079) with UID 621e219eb97ee0b2 Loading component Vehicles.so Successfully loaded component Vehicles (1.5.8.3079) with UID 3f1f62ee9e22ab19 Loading component Classes.so Successfully loaded component Classes (1.5.8.3079) with UID 8cfb3183976da208 Loading component Timers.so Successfully loaded component Timers (1.5.8.3079) with UID 2ad8124c5ea257a3 Loaded 22 component(s) from /home/gs113492/components Executing Server Config... [2026-10-20T21:03:33+0300] [Info] Loading plugin: crashdetect.so [2026-10-20T21:03:33+0300] [Info] CrashDetect plugin 4.19 [2026-10-20T21:03:33+0300] [Info] Loading plugin: mapandreas.so [2026-10-20T21:03:33+0300] [Info] Loading plugin: streamer.so [2026-10-20T21:03:33+0300] [Info] *** Streamer Plugin v2.9.4 by Incognito loaded *** [2026-10-20T21:03:33+0300] [Info] Loading plugin: sscanf.so [2026-10-20T21:03:33+0300] [Info] [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] sscanf plugin loaded. [2026-10-20T21:03:33+0300] [Info] Version: 2.8.3 [2026-10-20T21:03:33+0300] [Info] (c) 2018 Alex "Y_Less" Cole [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] Loading plugin: TOTP.so [2026-10-20T21:03:33+0300] [Info] TOTP plugin v1.0.1 by Games loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: mysql_static.so [2026-10-20T21:03:33+0300] [Info] >> plugin.mysql: R39-6 successfully loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: libpawn_json.so [2026-10-20T21:03:34+0300] [Error] Function not registered: YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_RegAlias [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Reset [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_RegHandler [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Delete [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_New [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_IgnoreBits [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_Init [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendRPC [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendPacket [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_WriteValue [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ReadValue [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Info] Legacy Network started on ***.**.**.***:2717. Помогите пожалуйста