Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.

Реклама


**Как получить V.I.P** (Перейти)
Чтобы заказать рекламу на Pro-Pawn.Ru, обращайтесь в Skype.
Баннерная реклама 200руб/мес, Текстовая 100руб/мес.
Показано с 1 по 3 из 3
  1. #1
    Аватар для #NickName
    Пользователь

    Статус
    Оффлайн
    Регистрация
    01.02.2014
    Адрес
    Татарстан
    Сообщений
    171
    Репутация:
    0 ±

    Не там создаются 3д тексты

    Сделал систему больницы, чтобы можно было лежать на койке.
    Но есть 2 бага на койке 3 хп не прибавляется, и 3дтекст создаются на разных койках, помогите 4 дня решаю не могу найти почему.
    PHP код:
    new HospitalBed[12]; 
    В дисконект
    PHP код:
    for(new i11i++)
        {
            if(
    HospitalBed[i] != playerid) continue;
            else
            {
                
    HospitalBed[i] = INVALID_PLAYER_ID;
                break;
            }
        } 
    В OnGameModeInit
    PHP код:
    HospitalBed[0] = INVALID_PLAYER_ID;
        
    HospitalBed[1] = INVALID_PLAYER_ID;
        
    HospitalBed[2] = INVALID_PLAYER_ID;
        
    HospitalBed[3] = INVALID_PLAYER_ID;
        
    HospitalBed[4] = INVALID_PLAYER_ID;
        
    HospitalBed[5] = INVALID_PLAYER_ID;
        
    HospitalBed[6] = INVALID_PLAYER_ID;
        
    HospitalBed[7] = INVALID_PLAYER_ID;
        
    HospitalBed[8] = INVALID_PLAYER_ID;
        
    HospitalBed[9] = INVALID_PLAYER_ID;
        
    HospitalBed[10] = INVALID_PLAYER_ID;
        
    HospitalBed[11] = INVALID_PLAYER_ID;
        
    SetTimer("HPheck"1000true); 
    Сам паблик
    PHP код:
    publicsHPheck(playerid)
    {
        if(
    PlayerInfo[playerid][pBerth1] == || PlayerInfo[playerid][pBerth2] == || PlayerInfo[playerid][pBerth3] == ||
        
    PlayerInfo[playerid][pBerth4] == || PlayerInfo[playerid][pBerth5] == || PlayerInfo[playerid][pBerth6] == ||
        
    PlayerInfo[playerid][pBerth7] == || PlayerInfo[playerid][pBerth8] == || PlayerInfo[playerid][pBerth9] == ||
        
    PlayerInfo[playerid][pBerth10] == || PlayerInfo[playerid][pBerth11] == || PlayerInfo[playerid][pBerth12] == 1)
        {
            new 
    Float:health;
            
    GetPlayerHealth(playeridhealth);
            if(
    health 95)SetPlayerHealthAC(playeridhealth 5.0);
            else
            {
                if(
    PlayerInfo[playerid][pBerth1] == || PlayerInfo[playerid][pBerth2] == || PlayerInfo[playerid][pBerth3] == ||
                
    PlayerInfo[playerid][pBerth4] == || PlayerInfo[playerid][pBerth5] == || PlayerInfo[playerid][pBerth6] == ||
                
    PlayerInfo[playerid][pBerth7] == || PlayerInfo[playerid][pBerth8] == || PlayerInfo[playerid][pBerth9] == ||
                
    PlayerInfo[playerid][pBerth10] == || PlayerInfo[playerid][pBerth11] == || PlayerInfo[playerid][pBerth12] == 1)
                {
                      
    SendClientMessage(playeridCOLOR_YELLOW"Курс лечения завершён!");
                    
    TogglePlayerControllable(playerid1);
                    
    ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1,1,0,1000,1);
                    
    PlayerInfo[playerid][pBerth1] = 0;
                    
    PlayerInfo[playerid][pBerth2] = 0;
                    
    PlayerInfo[playerid][pBerth3] = 0;
                    
    PlayerInfo[playerid][pBerth4] = 0;
                    
    PlayerInfo[playerid][pBerth5] = 0;
                    
    PlayerInfo[playerid][pBerth6] = 0;
                    
    PlayerInfo[playerid][pBerth7] = 0;
                    
    PlayerInfo[playerid][pBerth8] = 0;
                    
    PlayerInfo[playerid][pBerth9] = 0;
                    
    PlayerInfo[playerid][pBerth10] = 0;
                    
    PlayerInfo[playerid][pBerth11] = 0;
                    
    PlayerInfo[playerid][pBerth12] = 0;
                    
    PlayerInfo[playerid][pHospital] = 0;
                    for(new 
    d11d++)
                    {
                        if(
    HospitalBed[d] != playerid) continue;
                        else
                        {
                            
    HospitalBed[d] = INVALID_PLAYER_ID;
                            break;
                        }
                    }
                }
            }
        }
        return 
    1;

    И команда
    PHP код:
    CMD:health(playerid)
    {
        new 
    Float:health,
            
    str[50];
        
    GetPlayerHealth(playeridhealth);
        if(
    health >= 99.0) return 1;
        if(
    PlayerInfo[playerid][pBerth1] == || PlayerInfo[playerid][pBerth2] == || PlayerInfo[playerid][pBerth3] == ||
        
    PlayerInfo[playerid][pBerth4] == || PlayerInfo[playerid][pBerth5] == || PlayerInfo[playerid][pBerth6] == ||
        
    PlayerInfo[playerid][pBerth7] == || PlayerInfo[playerid][pBerth8] == || PlayerInfo[playerid][pBerth9] == ||
        
    PlayerInfo[playerid][pBerth10] == || PlayerInfo[playerid][pBerth11] == || PlayerInfo[playerid][pBerth12] == 1)return SendClientMessage(playeridCOLOR_RED"Вы уже лежите в больнице!");
        {
            if(
    PlayerToPoint(3.0playerid905.75378, -1290.82129998.25958))//1
            
    {
                if(
    HospitalBed[0] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 1 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 1 койку!");
                
    HospitalBed[0] = playerid;
                
    PlayerInfo[playerid][pBerth1] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,893.6427,-1274.9749,999.9067,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid910.14984, -1279.21716998.26111))//2
            
    {
                if(
    HospitalBed[1] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 2 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 2 койку!");
                
    HospitalBed[1] = playerid;
                
    PlayerInfo[playerid][pBerth2] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,893.9003,-1278.1630,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid916.04840, -1279.21313998.26190))//3
            
    {
                if(
    HospitalBed[2] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 3 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 3 койку!");
                
    HospitalBed[2] = playerid;
                
    PlayerInfo[playerid][pBerth1] = 3;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,892.9685,-1282.5905,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid913.19598, -1279.21716998.26123))//4
            
    {
                if(
    HospitalBed[3] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 4 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 4 койку!");
                
    HospitalBed[3] = playerid;
                
    PlayerInfo[playerid][pBerth1] = 4;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,895.8279,-1282.6334,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid916.28546, -1280.23486998.26123))//5
            
    {
                if(
    HospitalBed[4] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 5 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 5 койку!");
                
    HospitalBed[4] = playerid;
                
    PlayerInfo[playerid][pBerth5] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,898.8099,-1282.6639,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid910.37219, -1280.23486998.26123))//6
            
    {
                if(
    HospitalBed[5] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 6 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 6 койку!");
                
    HospitalBed[5] = playerid;
                
    PlayerInfo[playerid][pBerth6] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,916.6170,-1276.9943,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid913.16748, -1280.23486998.26123))//7
            
    {
                if(
    HospitalBed[6] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 7 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 7 койку!");
                
    HospitalBed[6] = playerid;
                
    PlayerInfo[playerid][pBerth7] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,913.4777,-1277.0863,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid899.11810, -1280.20752998.25922))//8
            
    {
                if(
    HospitalBed[7] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 8 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 8 койку!");
                
    HospitalBed[7] = playerid;
                
    PlayerInfo[playerid][pBerth8] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,910.2390,-1277.1738,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid893.27924, -1280.20605998.25922))//9
            
    {
                if(
    HospitalBed[8] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 9 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 9 койку!");
                
    HospitalBed[8] = playerid;
                
    PlayerInfo[playerid][pBerth9] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,910.1337,-1283.0668,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid896.21667, -1280.20752998.25922))//10
            
    {
                if(
    HospitalBed[9] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 10 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 10 койку!");
                
    HospitalBed[9] = playerid;
                
    PlayerInfo[playerid][pBerth10] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,913.0986,-1282.2367,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid896.04327, -1275.12598998.25922))//11
            
    {
                if(
    HospitalBed[10] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 11 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 11 койку!");
                
    HospitalBed[10] = playerid;
                
    PlayerInfo[playerid][pBerth11] = 1;
                
    TogglePlayerControllable(playerid0);
                
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                   
    Create3DTextLabel(str,COLOR_RED,916.0704,-1282.5214,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
            else if(
    PlayerToPoint(3.0playerid896.04327, -1278.15625998.25922))//12
            
    {
                if(
    HospitalBed[11] != INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_GREY"Койка под номером 12 уже занята!");
                
    SendClientMessage(playeridCOLOR_GREY"Поздравляем вы заняли 12 койку!");
                
    HospitalBed[11] = playerid;
                
    PlayerInfo[playerid][pBerth12] = 1;
                 
    TogglePlayerControllable(playerid0);
                 
    format(strsizeof(str), "Последний пациент: %s"PlayerInfo[playerid][pNames]);
                
    Create3DTextLabel(str,COLOR_RED,907.7652,-1290.8945,999.2600,15.001);
                   
    ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,0,1,1,1,1,1);
                   return 
    1;
            }
        }
        return 
    1;

    Помогите срочно прошу помощи.К примеру лёг на койке 2, а создался на другой койке 3дтекст.
    Последний раз редактировалось #NickName; 19.09.2016 в 03:23.

  2. #2
    Аватар для Saibot
    Пользователь

    Статус
    Оффлайн
    Регистрация
    21.08.2016
    Сообщений
    49
    Репутация:
    24 ±
    Проверьте правильно ли Вы указали координаты для Create3DTextLable.

    Но вот прикола с PlayerInfo[playerid][pBerth1], я так и не понял, зачем было создавать 12 перечислений?
    если одного будет достаточно.

    PHP код:
    new HospitalBed[12];
    //------
    publicsHPheck(playerid)
    {
        if 
    PlayerInfo[playerid][pBerth1] == 1
        
    || PlayerInfo[playerid][pBerth2] == 1
        
    || PlayerInfo[playerid][pBerth3] == 1
        
    || PlayerInfo[playerid][pBerth4] == 1
        
    || PlayerInfo[playerid][pBerth5] == 1
        
    || PlayerInfo[playerid][pBerth6] == 1
        
    || PlayerInfo[playerid][pBerth7] == 1
        
    || PlayerInfo[playerid][pBerth8] == 1
        
    || PlayerInfo[playerid][pBerth9] == 1
        
    || PlayerInfo[playerid][pBerth10] == 1
        
    || PlayerInfo[playerid][pBerth11] == 1
        
    || PlayerInfo[playerid][pBerth12] == *then
        
    {
            new 
    Floathealth;
            
    GetPlayerHealth(playeridhealth);
            if 
    floatcmp(health95) >= *then
                SetPlayerHealthAC
    (playeridhealth 5.0);

            else
            {
                
    SendClientMessage(playeridCOLOR_YELLOW, !"Курс лечения завершён!");
                
    TogglePlayerControllable(playerid1);
                
    ApplyAnimation(playerid, !"PED", !"IDLE_CHAT"4.1011010001);
                    
                
    PlayerInfo[playerid][pBerth1] =
                
    PlayerInfo[playerid][pBerth2] =
                
    PlayerInfo[playerid][pBerth3] =
                
    PlayerInfo[playerid][pBerth4] =
                
    PlayerInfo[playerid][pBerth5] =
                
    PlayerInfo[playerid][pBerth6] =
                
    PlayerInfo[playerid][pBerth7] =
                
    PlayerInfo[playerid][pBerth8] =
                
    PlayerInfo[playerid][pBerth9] =
                
    PlayerInfo[playerid][pBerth10] =
                
    PlayerInfo[playerid][pBerth11] =
                
    PlayerInfo[playerid][pBerth12] =
                
    PlayerInfo[playerid][pHospital] = 0;
                    
                for(new 
    sizeof(HospitalBed); i-- != 0;)
                {
                    if 
    HospitalBed[i] != playerid *then
                        
    continue;

                    
    HospitalBed[i] = INVALID_PLAYER_ID;
                    break;
                }
            }
        }
        return 
    1;
    }
    //------
    CMD:health(playerid)
    {
        new 
    Floathealth;
        
        
    GetPlayerHealth(playeridhealth);
        
        if 
    floatcmp(health99) >= *then
            
    return 1;
            
        if 
    PlayerInfo[playerid][pBerth1] == 1
        
    || PlayerInfo[playerid][pBerth2] == 1
        
    || PlayerInfo[playerid][pBerth3] == 1
        
    || PlayerInfo[playerid][pBerth4] == 1
        
    || PlayerInfo[playerid][pBerth5] == 1
        
    || PlayerInfo[playerid][pBerth6] == 1
        
    || PlayerInfo[playerid][pBerth7] == 1
        
    || PlayerInfo[playerid][pBerth8] == 1
        
    || PlayerInfo[playerid][pBerth9] == 1
        
    || PlayerInfo[playerid][pBerth10] == 1
        
    || PlayerInfo[playerid][pBerth11] == 1
        
    || PlayerInfo[playerid][pBerth12] == *then
            
    return SendClientMessage(playeridCOLOR_RED, !"Вы уже лежите в больнице!");

        static const 
    Floatposition_bed [12] [6]
        {
            {
    905.75378, -1290.82129998.25958893.6427, -1274.9749999.9067},
            {
    910.14984, -1279.21716998.26111893.9003, -1278.1630999.2600},
            {
    916.04840, -1279.21313998.26190892.9685, -1282.5905999.2600},
            {
    913.19598, -1279.21716998.26123895.8279, -1282.6334999.2600},
            {
    916.28546, -1280.23486998.26123898.8099, -1282.6639999.2600},
            {
    910.37219, -1280.23486998.26123916.6170, -1276.9943999.2600},
            {
    913.16748, -1280.23486998.26123913.4777, -1277.0863999.2600},
            {
    899.11810, -1280.20752998.25922910.2390, -1277.1738999.2600},
            {
    893.27924, -1280.20605998.25922910.1337, -1283.0668999.2600},
            {
    896.21667, -1280.20752998.25922913.0986, -1282.2367999.2600},
            {
    896.04327, -1275.12598998.25922916.0704, -1282.5214999.2600},
            {
    896.04327, -1278.15625998.25922907.7652, -1290.8945999.2600}
        };
        new 
    bed_str[19 MAX_PLAYER_NAME] = "Последний пациент: ";
        for(new 
    sizeof(position_bed); i-- != 0;)
        {
            if 
    IsPlayerInRangeOfPoint(playerid2.0
            
    ,
                
    position_bed[i][0],
                
    position_bed[i][1],
                
    position_bed[i][2]
              *
    then
            
    {
                if(
    HospitalBed[i] != INVALID_PLAYER_ID)
                    return 
    SendClientMessage(playeridCOLOR_GREY, !"Эта койка занята!");
                    
                
    HospitalBed[i] = playerid;
                
                
    strcat(bed_strPlayerInfo[playerid][pNames]);
                
    Create3DTextLabel(bed_strCOLOR_RED
                
    ,
                    
    position_bed[i][3],
                    
    position_bed[i][4],
                    
    position_bed[i][5],
                    
    15.001
                
    );
                
    SendClientMessage(playeridCOLOR_GREY, !"Поздравляем вы заняли койку!");
                switch(
    i)
                {
                    case 
    1PlayerInfo[playerid][pBerth1] = 1;
                    case 
    2PlayerInfo[playerid][pBerth2] = 1;
                    case 
    3PlayerInfo[playerid][pBerth3] = 1;
                    case 
    4PlayerInfo[playerid][pBerth4] = 1;
                    case 
    5PlayerInfo[playerid][pBerth5] = 1;
                    case 
    6PlayerInfo[playerid][pBerth6] = 1;
                    case 
    7PlayerInfo[playerid][pBerth7] = 1;
                    case 
    8PlayerInfo[playerid][pBerth8] = 1;
                    case 
    9PlayerInfo[playerid][pBerth9] = 1;
                    case 
    10PlayerInfo[playerid][pBerth10] = 1;
                    case 
    11PlayerInfo[playerid][pBerth11] = 1;
                    case 
    12PlayerInfo[playerid][pBerth12] = 1;
                }
            }
        }
        return 
    1;

    Последний раз редактировалось Saibot; 19.09.2016 в 23:24.

  3. #3
    Аватар для #NickName
    Пользователь

    Статус
    Оффлайн
    Регистрация
    01.02.2014
    Адрес
    Татарстан
    Сообщений
    171
    Репутация:
    0 ±
    Цитата Сообщение от Saibot Посмотреть сообщение
    Проверьте правильно ли Вы указали координаты для Create3DTextLable.

    Но вот прикола с PlayerInfo[playerid][pBerth1], я так и не понял, зачем было создавать 12 перечислений?
    если одного будет достаточно.

    PHP код:
    new HospitalBed[12];
    //------
    publicsHPheck(playerid)
    {
        if 
    PlayerInfo[playerid][pBerth1] == 1
        
    || PlayerInfo[playerid][pBerth2] == 1
        
    || PlayerInfo[playerid][pBerth3] == 1
        
    || PlayerInfo[playerid][pBerth4] == 1
        
    || PlayerInfo[playerid][pBerth5] == 1
        
    || PlayerInfo[playerid][pBerth6] == 1
        
    || PlayerInfo[playerid][pBerth7] == 1
        
    || PlayerInfo[playerid][pBerth8] == 1
        
    || PlayerInfo[playerid][pBerth9] == 1
        
    || PlayerInfo[playerid][pBerth10] == 1
        
    || PlayerInfo[playerid][pBerth11] == 1
        
    || PlayerInfo[playerid][pBerth12] == *then
        
    {
            new 
    Floathealth;
            
    GetPlayerHealth(playeridhealth);
            if 
    floatcmp(health95) >= *then
                SetPlayerHealthAC
    (playeridhealth 5.0);

            else
            {
                
    SendClientMessage(playeridCOLOR_YELLOW, !"Курс лечения завершён!");
                
    TogglePlayerControllable(playerid1);
                
    ApplyAnimation(playerid, !"PED", !"IDLE_CHAT"4.1011010001);
                    
                
    PlayerInfo[playerid][pBerth1] =
                
    PlayerInfo[playerid][pBerth2] =
                
    PlayerInfo[playerid][pBerth3] =
                
    PlayerInfo[playerid][pBerth4] =
                
    PlayerInfo[playerid][pBerth5] =
                
    PlayerInfo[playerid][pBerth6] =
                
    PlayerInfo[playerid][pBerth7] =
                
    PlayerInfo[playerid][pBerth8] =
                
    PlayerInfo[playerid][pBerth9] =
                
    PlayerInfo[playerid][pBerth10] =
                
    PlayerInfo[playerid][pBerth11] =
                
    PlayerInfo[playerid][pBerth12] =
                
    PlayerInfo[playerid][pHospital] = 0;
                    
                for(new 
    sizeof(HospitalBed); i-- != 0;)
                {
                    if 
    HospitalBed[i] != playerid *then
                        
    continue;

                    
    HospitalBed[i] = INVALID_PLAYER_ID;
                    break;
                }
            }
        }
        return 
    1;
    }
    //------
    CMD:health(playerid)
    {
        new 
    Floathealth;
        
        
    GetPlayerHealth(playeridhealth);
        
        if 
    floatcmp(health99) >= *then
            
    return 1;
            
        if 
    PlayerInfo[playerid][pBerth1] == 1
        
    || PlayerInfo[playerid][pBerth2] == 1
        
    || PlayerInfo[playerid][pBerth3] == 1
        
    || PlayerInfo[playerid][pBerth4] == 1
        
    || PlayerInfo[playerid][pBerth5] == 1
        
    || PlayerInfo[playerid][pBerth6] == 1
        
    || PlayerInfo[playerid][pBerth7] == 1
        
    || PlayerInfo[playerid][pBerth8] == 1
        
    || PlayerInfo[playerid][pBerth9] == 1
        
    || PlayerInfo[playerid][pBerth10] == 1
        
    || PlayerInfo[playerid][pBerth11] == 1
        
    || PlayerInfo[playerid][pBerth12] == *then
            
    return SendClientMessage(playeridCOLOR_RED, !"Вы уже лежите в больнице!");

        static const 
    Floatposition_bed [12] [6]
        {
            {
    905.75378, -1290.82129998.25958893.6427, -1274.9749999.9067},
            {
    910.14984, -1279.21716998.26111893.9003, -1278.1630999.2600},
            {
    916.04840, -1279.21313998.26190892.9685, -1282.5905999.2600},
            {
    913.19598, -1279.21716998.26123895.8279, -1282.6334999.2600},
            {
    916.28546, -1280.23486998.26123898.8099, -1282.6639999.2600},
            {
    910.37219, -1280.23486998.26123916.6170, -1276.9943999.2600},
            {
    913.16748, -1280.23486998.26123913.4777, -1277.0863999.2600},
            {
    899.11810, -1280.20752998.25922910.2390, -1277.1738999.2600},
            {
    893.27924, -1280.20605998.25922910.1337, -1283.0668999.2600},
            {
    896.21667, -1280.20752998.25922913.0986, -1282.2367999.2600},
            {
    896.04327, -1275.12598998.25922916.0704, -1282.5214999.2600},
            {
    896.04327, -1278.15625998.25922907.7652, -1290.8945999.2600}
        };
        new 
    bed_str[19 MAX_PLAYER_NAME] = "Последний пациент: ";
        for(new 
    sizeof(position_bed); i-- != 0;)
        {
            if 
    IsPlayerInRangeOfPoint(playerid2.0
            
    ,
                
    position_bed[i][0],
                
    position_bed[i][1],
                
    position_bed[i][2]
              *
    then
            
    {
                if(
    HospitalBed[i] != INVALID_PLAYER_ID)
                    return 
    SendClientMessage(playeridCOLOR_GREY, !"Эта койка занята!");
                    
                
    HospitalBed[i] = playerid;
                
                
    strcat(bed_strPlayerInfo[playerid][pNames]);
                
    Create3DTextLabel(bed_strCOLOR_RED
                
    ,
                    
    position_bed[i][3],
                    
    position_bed[i][4],
                    
    position_bed[i][5],
                    
    15.001
                
    );
                
    SendClientMessage(playeridCOLOR_GREY, !"Поздравляем вы заняли койку!");
                switch(
    i)
                {
                    case 
    1PlayerInfo[playerid][pBerth1] = 1;
                    case 
    2PlayerInfo[playerid][pBerth2] = 1;
                    case 
    3PlayerInfo[playerid][pBerth3] = 1;
                    case 
    4PlayerInfo[playerid][pBerth4] = 1;
                    case 
    5PlayerInfo[playerid][pBerth5] = 1;
                    case 
    6PlayerInfo[playerid][pBerth6] = 1;
                    case 
    7PlayerInfo[playerid][pBerth7] = 1;
                    case 
    8PlayerInfo[playerid][pBerth8] = 1;
                    case 
    9PlayerInfo[playerid][pBerth9] = 1;
                    case 
    10PlayerInfo[playerid][pBerth10] = 1;
                    case 
    11PlayerInfo[playerid][pBerth11] = 1;
                    case 
    12PlayerInfo[playerid][pBerth12] = 1;
                }
            }
        }
        return 
    1;

    Вставил я команду
    PHP код:
    CMD:health(playerid)
    {
        new 
    Floathealth;

        
    GetPlayerHealth(playeridhealth);

        if 
    floatcmp(health99) >= *then
            
    return 1;

        if(
    PlayerInfo[playerid][pBerth1] == 1
        
    || PlayerInfo[playerid][pBerth2] == 1
        
    || PlayerInfo[playerid][pBerth3] == 1
        
    || PlayerInfo[playerid][pBerth4] == 1
        
    || PlayerInfo[playerid][pBerth5] == 1
        
    || PlayerInfo[playerid][pBerth6] == 1
        
    || PlayerInfo[playerid][pBerth7] == 1
        
    || PlayerInfo[playerid][pBerth8] == 1
        
    || PlayerInfo[playerid][pBerth9] == 1
        
    || PlayerInfo[playerid][pBerth10] == 1
        
    || PlayerInfo[playerid][pBerth11] == 1
        
    || PlayerInfo[playerid][pBerth12] == 1)
            return 
    SendClientMessage(playeridCOLOR_RED, !"Вы уже лежите в больнице!");

        static const 
    Floatposition_bed[12][6]=
        {
            {
    905.75378, -1290.82129998.25958893.6427, -1274.9749999.9067},
            {
    910.14984, -1279.21716998.26111893.9003, -1278.1630999.2600},
            {
    916.04840, -1279.21313998.26190892.9685, -1282.5905999.2600},
            {
    913.19598, -1279.21716998.26123895.8279, -1282.6334999.2600},
            {
    916.28546, -1280.23486998.26123898.8099, -1282.6639999.2600},
            {
    910.37219, -1280.23486998.26123916.6170, -1276.9943999.2600},
            {
    913.16748, -1280.23486998.26123913.4777, -1277.0863999.2600},
            {
    899.11810, -1280.20752998.25922910.2390, -1277.1738999.2600},
            {
    893.27924, -1280.20605998.25922910.1337, -1283.0668999.2600},
            {
    896.21667, -1280.20752998.25922913.0986, -1282.2367999.2600},
            {
    896.04327, -1275.12598998.25922916.0704, -1282.5214999.2600},
            {
    896.04327, -1278.15625998.25922907.7652, -1290.8945999.2600}
        };
        new 
    bed_str[19 MAX_PLAYER_NAME] = "Последний пациент: ";
        for(new 
    sizeof(position_bed); i-- != 0;)
        {
            if(
    IsPlayerInRangeOfPoint(playerid2.0position_bed[i][0], position_bed[i][1], position_bed[i][2]))
            {
                if(
    HospitalBed[i] != INVALID_PLAYER_ID)
                    return 
    SendClientMessage(playeridCOLOR_GREY, !"Эта койка занята!");

                
    HospitalBed[i] = playerid;

                
    strcat(bed_strPlayerInfo[playerid][pNames]);
                
    Create3DTextLabel(bed_strCOLOR_RED
                
    ,
                    
    position_bed[i][3],
                    
    position_bed[i][4],
                    
    position_bed[i][5],
                    
    15.001
                
    );
                
    SendClientMessage(playeridCOLOR_GREY, !"Поздравляем вы заняли койку!");
                switch(
    i)
                {
                    case 
    1PlayerInfo[playerid][pBerth1] = 1;
                    case 
    2PlayerInfo[playerid][pBerth2] = 1;
                    case 
    3PlayerInfo[playerid][pBerth3] = 1;
                    case 
    4PlayerInfo[playerid][pBerth4] = 1;
                    case 
    5PlayerInfo[playerid][pBerth5] = 1;
                    case 
    6PlayerInfo[playerid][pBerth6] = 1;
                    case 
    7PlayerInfo[playerid][pBerth7] = 1;
                    case 
    8PlayerInfo[playerid][pBerth8] = 1;
                    case 
    9PlayerInfo[playerid][pBerth9] = 1;
                    case 
    10PlayerInfo[playerid][pBerth10] = 1;
                    case 
    11PlayerInfo[playerid][pBerth11] = 1;
                    case 
    12PlayerInfo[playerid][pBerth12] = 1;
                }
            }
        }
        return 
    1;

    Сейчас вообще не у какой койки не пашет

 

 

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •