Loose indentation - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Loose indentation (
/showthread.php?tid=186544)
Loose indentation -
Garc1a - 29.10.2010
I have:
pawn Код:
public OnPlayerConnect(playerid)
{
new file[100],Name[MAX_PLAYER_NAME],Ip[16];
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerIp(playerid,Ip,sizeof(Ip));
format(file,sizeof(file),PlayerFile,Name);
strcat(PlayerInfo[playerid][pName], dini_Get(file,"Name"));
strcat(PlayerInfo[playerid][pIP], dini_Get(file,"Ip"));
PlayerInfo[playerid][pRegistered] = dini_Int(file,"Registered");
PlayerInfo[playerid][pPassword] = dini_Int(file,"Password");
PlayerInfo[playerid][pJailed] = dini_Int(file,"Jailed");
PlayerInfo[playerid][pJailTime] = dini_Int(file,"JailTime");
PlayerInfo[playerid][pJailed] = dini_Int(file, "Cash");
PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
PlayerInfo[playerid][pCash] = dini_Int(file, "Cash");
PlayerInfo[playerid][pRegistered] = dini_Int(file, "Registered");
PlayerInfo[playerid][pLogged] = 0;
if(!dini_Exists(file))
{
ClearChatbox(playerid,10);
SendClientMessage(playerid, COLOR_WHITE, "Your username is not recognized on this server. Please");
SendClientMessage(playerid, COLOR_WHITE, "/register <Password> to continue to get your account registered.");
}
else
{
ClearChatbox(playerid,10);
SendClientMessage(playerid, COLOR_WHITE, "Your username is recognized on this server. Please");
SendClientMessage(playerid, COLOR_WHITE, "/login <Password> to continue to get your account logged in.");
return 1;
}
return 1;
}
and I get this when I compile:
Quote:
C:\Users\dell\Desktop\Urban FreeRoam\filterscripts\AccountSystem.pwn(124) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
|
Respuesta: Loose indentation -
admantis - 29.10.2010
On top of your script
Re: Loose indentation -
willsuckformoney - 29.10.2010
pawn Код:
new file[100],Name[MAX_PLAYER_NAME],Ip[16];
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerIp(playerid,Ip,sizeof(Ip));
format(file,sizeof(file),PlayerFile,Name);
strcat(PlayerInfo[playerid][pName], dini_Get(file,"Name"));
strcat(PlayerInfo[playerid][pIP], dini_Get(file,"Ip"));
PlayerInfo[playerid][pRegistered] = dini_Int(file,"Registered");
PlayerInfo[playerid][pPassword] = dini_Int(file,"Password");
PlayerInfo[playerid][pJailed] = dini_Int(file,"Jailed");
PlayerInfo[playerid][pJailTime] = dini_Int(file,"JailTime");
PlayerInfo[playerid][pJailed] = dini_Int(file, "Cash");
PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
PlayerInfo[playerid][pCash] = dini_Int(file, "Cash");
PlayerInfo[playerid][pRegistered] = dini_Int(file, "Registered");
PlayerInfo[playerid][pLogged] = 0;
From the pawn code it shows you have one to many indentions. Delete one. Indention means tab spaces.
Re: Loose indentation -
Alex_Valde - 29.10.2010
Quote:
Originally Posted by Garc1a
I have:
pawn Код:
public OnPlayerConnect(playerid) { new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name); strcat(PlayerInfo[playerid][pName], dini_Get(file,"Name")); strcat(PlayerInfo[playerid][pIP], dini_Get(file,"Ip")); PlayerInfo[playerid][pRegistered] = dini_Int(file,"Registered"); PlayerInfo[playerid][pPassword] = dini_Int(file,"Password"); PlayerInfo[playerid][pJailed] = dini_Int(file,"Jailed"); PlayerInfo[playerid][pJailTime] = dini_Int(file,"JailTime"); PlayerInfo[playerid][pJailed] = dini_Int(file, "Cash"); PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin"); PlayerInfo[playerid][pCash] = dini_Int(file, "Cash"); PlayerInfo[playerid][pRegistered] = dini_Int(file, "Registered"); PlayerInfo[playerid][pLogged] = 0;
if(!dini_Exists(file)) { ClearChatbox(playerid,10); SendClientMessage(playerid, COLOR_WHITE, "Your username is not recognized on this server. Please"); SendClientMessage(playerid, COLOR_WHITE, "/register <Password> to continue to get your account registered."); } else { ClearChatbox(playerid,10); SendClientMessage(playerid, COLOR_WHITE, "Your username is recognized on this server. Please"); SendClientMessage(playerid, COLOR_WHITE, "/login <Password> to continue to get your account logged in."); return 1; } return 1; }
and I get this when I compile:
|
You have an >>Tab<< too much ....you should arrange your code a little bit.
Or you can do this:
pawn Код:
#pragma tabsize 0 //at the top of your script
Respuesta: Re: Loose indentation -
admantis - 29.10.2010
Quote:
Originally Posted by Alex_Valde
You have an >>Tab<< too much ....you should arrange your code a little bit.
Or you can do this:
pawn Код:
#pragma tabsize 0 //at the top of your script
|
I already said that
Re: Respuesta: Re: Loose indentation -
Alex_Valde - 29.10.2010
Quote:
Originally Posted by admantis
I already said that 
|
Sorry, I was too late