Question

FelixRuz
Новичок

Помогите с кодом, команда /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;
}

 



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

Edited by MuhammadPawn
Причина: Убрал код под спойлер

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

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

Share this post


Link to post

10 answers to this question

  • 0
DEST
Maintainer

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

Float: pHealth,

 

Share this post


Link to post
  • 0
FelixRuz
Новичок

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

Сделал, теперь в строке 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;
}

 

 

 

Edited by MuhammadPawn
Причина: Убрал код под спойлер

Share this post


Link to post
  • 0
MuhammadPawn
Великий Гуру

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

Share this post


Link to post
  • 0
FelixRuz
Новичок

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

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

Share this post


Link to post
  • 0
FelixRuz
Новичок

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

Share this post


Link to post
  • 0
DEST
Maintainer

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

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

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Badr
      By Badr
      дратуте , решил сделать лаунчер самп на node.js , все норм сделал дизайн/стиль , но когда захожу абсолютно на любой сервер (заходил на онух рп ,и на свой сервер ) и пишет вронг сервер пароль ( мне лень на англиском писать )  скрин прикрепил 

      исходник https://disk.yandex.ru/d/D_104GFgrFO16A ( сам делал , то-есть дипсик  )
      я знаю все будут писать что (Слово удалено системой) ии-шное