Вопросы

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

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

Строчка 4598 жалуется, код:

 

Спойлер

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/afly", true))
{
if(GetPVarType(playerid, "FlyMode")) CancelFlyMode(playerid);
else FlyMode(playerid);
return true;
}
4598 return true;
}

Строчка 4831 и 4864 жалуется, код:
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] != 0 || noclipdata[playerid][lrold] != 0) && ud == 0 && lr == 0)
{ // All keys have been released, stop the object the camera is attached to and reset the acceleration multiplier
StopPlayerObject(playerid, noclipdata[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(ud, lr);

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

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

if(GetPVarType(playerid, "FlyMode"))
{
new inter, world, Float:X, Float:Y, Float:Z, Float:FA;
6555 GetPlayerHealth(PlayerInfo[playerid][pHealth]);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, FA);
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;
}

 



Просьба, кто знает в чем проблемы, помогите, буду очень благодарен

Отредактировано пользователем MuhammadPawn
Причина: Убрал код под спойлер

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

Ошибки желательно тоже под код

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


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

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

  • 0

@FelixRuz вы внимательно читайте, я указал, что должно быть в типе Float, т.е.: 

Float: pHealth,

 

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


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

Исправил некоторое, теперь вылезли другие ошибки:

Сделал, теперь в строке 6555 выходит ошибка: warning 213: tag mismatch
И все так же три ошибки: warning 217: loose indentation (4598,4831,4864).

 

Спойлер

public OnPlayerCommandText(playerid, cmdtext[])
{
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] != 0 || noclipdata[playerid][lrold] != 0) && ud == 0 && lr == 0)
{ // All keys have been released, stop the object the camera is attached to and reset the acceleration multiplier
StopPlayerObject(playerid, noclipdata[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(ud, lr);

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

 

 

 

Отредактировано пользователем MuhammadPawn
Причина: Убрал код под спойлер

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


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

warning 217: loose indentation - загугли что такое табуляция 

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


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

Спасибо, понял, с табуляцией разобрался, но что делать с warning 213: tag mismatch?

Строка GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);

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


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

@FelixRuz pHealth в enum'e должно быть типа Float. 

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


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

@DEST Есть, прописан pHealth в enum

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


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

@FelixRuz как прописан? 

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


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

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


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

@DEST Все сделал, спасибо, +поставил, но мы можем как то пообщаться сейчас, еще есть несколько вопросов, вк или что то еще?

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


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

@FelixRuz на форуме можем пообщаться, создавайте для своих вопросов темы. 

Эта решена, закрыто. 

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


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

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

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

    • Redmondd
      От Redmondd
      При запуске сервера в консоли пишет: Started server on port: 7777, with maxplayers: 500 lanmode is OFF.
      И когда захожу на сервер пишет server didnt respond
       
      ---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, (C)2005-2015 SA-MP Team filterscripts = ""  (string) Server Plugins --------------  Loading plugin: mysql   > MySQL plugin R7-2 successfully loaded.   Loaded.  Loading plugin: sscanf  ===============================       sscanf plugin loaded.          Version:  2.8.1    (c) 2012 Alex "Y_Less" Cole  ===============================   Loaded.  Loading plugin: dc_cmd   Daniel's CMD plugin v2.8     (c) 2014 Daniel_Cortez         www.pro-pawn.ru   Loaded.  Loading plugin: streamer *** Streamer Plugin v2.7.9 by Incognito loaded ***   Loaded.  Loaded 4 plugins. Started server on port: 7777, with maxplayers: 500 lanmode is OFF. Filterscripts ---------------   Loaded 0 filterscripts. Подключение к базе данных MYSQL успешно ---------------------------------- --------Redmond RP 01-------- ---------------------------------- Number of vehicle models: 5 Склады загружены успешно Дома (15 шт) загружены успешно