SA-MP Forums Archive
Just warnings ... - 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: Just warnings ... (/showthread.php?tid=320163)



Just warnings ... - DarkyTheAngel - 21.02.2012

Hey guys ! Can someone help me with these warnings ? Thanks.
pawn Код:
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\SKR.pwn(8120) : warning 217: loose indentation
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\SKR.pwn(8140) : warning 217: loose indentation
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\SKR.pwn(8294) : warning 217: loose indentation
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\SKR.pwn(10228) : warning 217: loose indentation
Line 8120 :
pawn Код:
if(strcmp(cmdtext,"/respawnv",true)==0)
Line 8140 :
pawn Код:
if (!strcmp("/v Landstalker", cmdtext, true))
Line 8294 :
pawn Код:
if (!strcmp("/v Pony", cmdtext, true))
Line 10228 :
pawn Код:
return 0;



Re: Just warnings ... - mitchboy - 21.02.2012

loose indentications are speces that aren't allowed to be there, like this:
Код:
     if(cookie == 1)
{
nocookie = 1;
}
That would give a loose indentication cause of the spaces or tabs.


Re: Just warnings ... - DarkyTheAngel - 21.02.2012

Ohh .. thanks.I fixed it.


Re: Just warnings ... - mitchboy - 21.02.2012

Nice to hear i helped you, feel free to send me a pm if you need any further help.


Re: Just warnings ... - DarkyTheAngel - 21.02.2012

Hmmm.Just one more warning :
pawn Код:
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\SKR.pwn(10317) : warning 217: loose indentation
Command :
pawn Код:
if (!strcmp("/v Boxville2", cmdtext, true))
    {
        if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
        new Float:X,Float:Y,Float:Z,Float:ROT;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle (playerid,ROT);
        SetVehicleNumberPlate(SpawnedVehicles[playerid] = CreateVehicle(606,X,Y,Z,ROT,-1,-1,60), "{0049FF}D{F3FF02}K{F81414}R");
        PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
        GameTextForPlayer(playerid,"~h~~w~Boxville 2~n~~h~~w~ID:~h~~r~606",2500,1);
        return 1;
    }
    return 0; // Here is the warning.
}



Re: Just warnings ... - austin070 - 21.02.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/v Boxville2", cmdtext, true))
    {
        if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
        new Float:X,Float:Y,Float:Z,Float:ROT;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle (playerid,ROT);
        SetVehicleNumberPlate(SpawnedVehicles[playerid] = CreateVehicle(606,X,Y,Z,ROT,-1,-1,60), "{0049FF}D{F3FF02}K{F81414}R");
        PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
        GameTextForPlayer(playerid,"~h~~w~Boxville 2~n~~h~~w~ID:~h~~r~606",2500,1);
        return 1;
    }
    return 0;
}
Is it indented like this?

Also, if indentations don't bother you, you can always use this at the top of your script:

pawn Код:
#pragma tabsize 0



Re: Just warnings ... - mitchboy - 21.02.2012

answered the pm of you too, the same answer as austin actually.


Re: Just warnings ... - John Rockie - 21.02.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/v Boxville2", cmdtext, true))
    {
        if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
        new Float:X,Float:Y,Float:Z,Float:ROT;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle (playerid,ROT);
        SetVehicleNumberPlate(SpawnedVehicles[playerid] = CreateVehicle(606,X,Y,Z,ROT,-1,-1,60), "{0049FF}D{F3FF02}K{F81414}R");
        PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
        GameTextForPlayer(playerid,"~h~~w~Boxville 2~n~~h~~w~ID:~h~~r~606",2500,1);
        return 1;
    }
return 0;
}



Re: Just warnings ... - DarkyTheAngel - 21.02.2012

I tried all ... but still giving me
pawn Код:
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\SKR.pwn(10317) : warning 217: loose indentation



Re: Just warnings ... - Mark™ - 22.02.2012

Try this one below
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/v Boxville2", cmdtext, true))
{
if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
new Float:X,Float:Y,Float:Z,Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle (playerid,ROT);
SetVehicleNumberPlate(SpawnedVehicles[playerid] = CreateVehicle(606,X,Y,Z,ROT,-1,-1,60), "{0049FF}D{F3FF02}K{F81414}R");
PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
GameTextForPlayer(playerid,"~h~~w~Boxville 2~n~~h~~w~ID:~h~~r~606",2500,1);
return 1;
}
return 0;
}