SA-MP Forums Archive
Maybe it will sound stupid - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Maybe it will sound stupid (/showthread.php?tid=409030)



Maybe it will sound stupid - BodyBoardVEVO - 20.01.2013

I got 1 warning, but i cant fix help me, please [Maybe i just dont see]

pawn Код:
C:\Program Files\Files2\SA-MP Servers\Cops And Robbers [ORGINAL SERVER]\gamemodes\LVCNR.pwn(5330) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warnings.
Here is 5330 Line

pawn Код:
public OnPlayerUpdate(playerid)
{
        if(IsPlayerNPC(playerid)) return 1;
        if(HasSpawned{playerid} == true && GetPlayerState(playerid) != PLAYER_STATE_NONE)
        {
        new string[150];
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new veh = GetPlayerVehicleID(playerid);

            new Float:speed_x, Float:speed_y, Float:speed_z;
            GetVehicleVelocity(veh, speed_x,speed_y, speed_z);


            format(string, sizeof(string), "");
            TextDrawSetString(LVCNRInfo[playerid], string);
        }
        else
        {
            new current_zone;
            current_zone = Player_Zone[playerid];
            format(string, sizeof(string), "%s", ZoneNames[current_zone][zone_name]);
            TextDrawSetString(LVCNRInfo[playerid], string);
            }
        }
    return 1;
}
pawn Код:
return 1; //this is that line



Re: Maybe it will sound stupid - Goldino - 20.01.2013

Add this under your Includes at the top of your script

Код:
#pragma tabsize 0



Re: Maybe it will sound stupid - BodyBoardVEVO - 20.01.2013

Quote:
Originally Posted by Goldino
Посмотреть сообщение
Add this under your Includes at the top of your script

Код:
#pragma tabsize 0
Awesome Thanks Dude, +rep


Re: Maybe it will sound stupid - Goldino - 20.01.2013

Thanks!


Re: Maybe it will sound stupid - Patrick - 20.01.2013

As ****** says
Pragma tabsize 0 is not recomended
pawn Код:
#pragma tabsize 0
Quote:

As you correctly point out, the pragma is not recommended, so why mention it in the first place? Just ignore it - the less that people know about it, the less that people can choose to ignore your nice advice and just use it anyway.

Quote:

It can't be related to indentation directly, but bad indentation very frequently hides logic errors.

Fix your indentation

Here
pawn Код:
public OnPlayerUpdate(playerid)
{
        if(IsPlayerNPC(playerid)) return 1;
        if(HasSpawned{playerid} == true && GetPlayerState(playerid) != PLAYER_STATE_NONE)
        {
        new string[150];
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new veh = GetPlayerVehicleID(playerid);

            new Float:speed_x, Float:speed_y, Float:speed_z;
            GetVehicleVelocity(veh, speed_x,speed_y, speed_z);


            format(string, sizeof(string), "");
            TextDrawSetString(LVCNRInfo[playerid], string);
        }
        else
        {
            new current_zone;
            current_zone = Player_Zone[playerid];
            format(string, sizeof(string), "%s", ZoneNames[current_zone][zone_name]);
            TextDrawSetString(LVCNRInfo[playerid], string);
            }
        }
        return 1;
}