Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.
Показано с 1 по 6 из 6
  1. #1
    Аватар для Felix -_____-
    Пользователь

    Статус
    Оффлайн
    Регистрация
    15.04.2018
    Сообщений
    4
    Репутация:
    0 ±

    warning 217: loose indentation

    Помогите с кодом, команда /afly, Все вроде правильно написал, но не понимаю, что за ошибки: warning 217: loose indentation и как их убрать

    Вот что выходит при компилировании:
    PHP код:
    C:\Users\Felix\Desktop\Server DM\gamemodes\server.pwn(4598) : warning 217loose indentation
    C
    :\Users\Felix\Desktop\Server DM\gamemodes\server.pwn(4831) : warning 217loose indentation
    C
    :\Users\Felix\Desktop\Server DM\gamemodes\server.pwn(4864) : warning 217loose indentation
    C
    :\Users\Felix\Desktop\Server DM\gamemodes\server.pwn(6548) : warning 211possibly unintended assignment
    C
    :\Users\Felix\Desktop\Server DM\gamemodes\server.pwn(6555) : warning 202number of arguments does not match definition 
    Строчка 4598 жалуется, код:

    PHP код:
    public OnPlayerCommandText(playeridcmdtext[])
    {
        if(!
    strcmp(cmdtext"/afly"true))
        {
            if(
    GetPVarType(playerid"FlyMode")) CancelFlyMode(playerid);
            else 
    FlyMode(playerid);
            return 
    true;
        }
     
    4598  return true;

    Строчка 4831 и 4864 жалуется, код:
    PHP код:
        4831    if(noclipdata[playerid][cameramode] == CAMERA_MODE_FLY)
        {
            new 
    keys,ud,lr;
            
    GetPlayerKeys(playerid,keys,ud,lr);

            if(
    noclipdata[playerid][mode] && (GetTickCount() - noclipdata[playerid][lastmove] > 100))
            {
                
    // If the last move was > 100ms ago, process moving the object the players camera is attached to
                
    MoveCamera(playerid);
            }

            
    // Is the players current key state different than their last keystate?
            
    if(noclipdata[playerid][udold] != ud || noclipdata[playerid][lrold] != lr)
            {
                if((
    noclipdata[playerid][udold] != || noclipdata[playerid][lrold] != 0) && ud == && lr == 0)
                {   
    // All keys have been released, stop the object the camera is attached to and reset the acceleration multiplier
                    
    StopPlayerObject(playeridnoclipdata[playerid][flyobject]);
                    
    noclipdata[playerid][mode]      = 0;
                    
    noclipdata[playerid][accelmul]  = 0.0;
                }
                else
                {   
    // Indicates a new key has been pressed

                    // Get the direction the player wants to move as indicated by the keys
                    
    noclipdata[playerid][mode] = GetMoveDirectionFromKeys(udlr);

                    
    // Process moving the object the players camera is attached to
                    
    MoveCamera(playerid);
                }
            }
            
    noclipdata[playerid][udold] = udnoclipdata[playerid][lrold] = lr// Store current keys pressed for comparison next update
            
    return 0;
            }
        return 
    true;//4864

    Строчка 6548 и 6555 жалуется, код:
    PHP код:
    CMD:afly(playerid,params[])
    {
        if(
    dostup[playerid] = 0) return true;// 6548
        
    if(PlayerInfo[playerid][pAdmin] < 1) return true;
        
    SetPVarInt(playerid,"spawn_ac",1);

        if(
    GetPVarType(playerid"FlyMode"))
        {
                new 
    interworldFloat:XFloat:YFloat:ZFloat:FA;
                
    GetPlayerHealth(PlayerInfo[playerid][pHealth]);// 6555
            
    GetPlayerPos(playeridXYZ);
            
    GetPlayerFacingAngle(playeridFA);
            
    inter GetPlayerInterior(playerid);
            
    world GetPlayerVirtualWorld(playerid);
            
    SetPVarFloat(playerid"SpecX"X);
            
    SetPVarFloat(playerid"SpecY"Y);
            
    SetPVarFloat(playerid"SpecZ"Z);
            
    SetPVarFloat(playerid"SpecFA"FA);
            
    SetPVarInt(playerid"SpecInt"inter);
            
    SetPVarInt(playerid"SpecWorld"world);

            
    CancelFlyMode(playerid);
        }
        else
        {
            
    SetPVarInt(playerid"SpecBool"1);
            
    FlyMode(playerid);
        }
        return 
    true;

    Просьба, кто знает в чем проблемы, помогите, буду очень благодарен
    Последний раз редактировалось DeimoS; 16.04.2018 в 11:59.

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

    Статус
    Оффлайн
    Регистрация
    10.08.2017
    Сообщений
    6
    Репутация:
    0 ±
    У вас есть один параметр, и вам нужны два параметра.
    Изучите документацию http://wiki.sa-mp.com/wiki/GetPlayerHealth_RU
    Сделайте это.
    PHP код:
    GetPlayerHealth(playeridPlayerInfo[playerid][pHealth]); 
    Условие должно быть равно двум равный.
    PHP код:
    if(dostup[playerid] == 0) return true
    PHP код:
    warning 217loose indentation 
    Используйте его TAB линия

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

    Статус
    Оффлайн
    Регистрация
    15.04.2018
    Сообщений
    4
    Репутация:
    0 ±
    Сделал, теперь в строке 6555 выходит ошибка: warning 213: tag mismatch
    И все так же три ошибки: warning 217: loose indentation (4598,4831,4864).

    PHP код:
    public OnPlayerCommandText(playeridcmdtext[])
    {
        if(!
    strcmp(cmdtext"/afly"true))
        {
            if(
    GetPVarType(playerid"FlyMode")) CancelFlyMode(playerid);
            else 
    FlyMode(playerid);
            return 
    true;
        }
    4598:  return true;
    }

    4831: if(noclipdata[playerid][cameramode] == CAMERA_MODE_FLY)

            if(
    noclipdata[playerid][cameramode] == CAMERA_MODE_FLY)
        {
            new 
    keys,ud,lr;
            
    GetPlayerKeys(playerid,keys,ud,lr);

            if(
    noclipdata[playerid][mode] && (GetTickCount() - noclipdata[playerid][lastmove] > 100))
            {
                
    // If the last move was > 100ms ago, process moving the object the players camera is attached to
                
    MoveCamera(playerid);
            }

            
    // Is the players current key state different than their last keystate?
            
    if(noclipdata[playerid][udold] != ud || noclipdata[playerid][lrold] != lr)
            {
                if((
    noclipdata[playerid][udold] != || noclipdata[playerid][lrold] != 0) && ud == && lr == 0)
                {   
    // All keys have been released, stop the object the camera is attached to and reset the acceleration multiplier
                    
    StopPlayerObject(playeridnoclipdata[playerid][flyobject]);
                    
    noclipdata[playerid][mode]      = 0;
                    
    noclipdata[playerid][accelmul]  = 0.0;
                }
                else
                {   
    // Indicates a new key has been pressed

                    // Get the direction the player wants to move as indicated by the keys
                    
    noclipdata[playerid][mode] = GetMoveDirectionFromKeys(udlr);

                    
    // Process moving the object the players camera is attached to
                    
    MoveCamera(playerid);
                }
            }
            
    noclipdata[playerid][udold] = udnoclipdata[playerid][lrold] = lr// Store current keys pressed for comparison next update
            
    return 0;
            }
    4864: return true;

    Последний раз редактировалось DeimoS; 16.04.2018 в 11:59.

  4. #4
    Аватар для Felix -_____-
    Пользователь

    Статус
    Оффлайн
    Регистрация
    15.04.2018
    Сообщений
    4
    Репутация:
    0 ±
    Все решил кроме одной ошибки: warning 213: tag mismatch
    Не знаю, что с ней делать, вот строчка:
    GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);

    Если что в enum pHealth Прописан.

  5. #5
    Аватар для whale
    Пользователь

    Статус
    Оффлайн
    Регистрация
    10.04.2014
    Сообщений
    74
    Репутация:
    17 ±
    Цитата Сообщение от Felix -_____- Посмотреть сообщение
    Все решил кроме одной ошибки: warning 213: tag mismatch
    Не знаю, что с ней делать, вот строчка:
    GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);

    Если что в enum pHealth Прописан.
    pHealth в enum имеет тип Float?

  6. #6
    Аватар для Felix -_____-
    Пользователь

    Статус
    Оффлайн
    Регистрация
    15.04.2018
    Сообщений
    4
    Репутация:
    0 ±
    Сейчас уже все нормально, просто дело в том, что команда сама не робит вообще, при вводе /afly ничего не происходит, кто хоть немного понимает, в чем может быть дело, напишите, буду ждать...

 

 

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

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

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

Ваши права

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