Raised This Month: $51 Target: $400
 12% 

How can i Fix this warning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DEX|Extrem
Junior Member
Join Date: Jul 2010
Location: Germany
Old 04-02-2011 , 08:27   How can i Fix this warning
Reply With Quote #1

Hello,
I scripted a little bit, but if i compile the Script it comes these warning:
//rp_main.sp(8191) : warning 217 loose indantion
Script Code:
Quote:
public TaxiMenu2(Handle:menu, MenuAction:action, param1, param2)
{
if(action == MenuAction_Select)
{
new String:info2[64];
GetMenuItem(menu, param2, info2, sizeof(info2));
decl String:Buffer[2][32];
ExplodeString(info2, ",", Buffer, 2, 32);
decl Cost;
Cost = StringToInt(Buffer[1]);
if(Money[param1] < Cost)
{
PrintToChat(param1, "[RP] Du hasst nicht genug Geld fuer eine Taxi-Fahrt");
}
else
{
Money[param1] = Money[param1] - Cost;

decl Handle:Taxi;
decl Float:TaxiOrigin[3];
Taxi = CreateKeyValues("Taxi");
FileToKeyValues(Taxi, TaxiPath);
KvJumpToKey(Taxi, Buffer[0], false);
KvGetVector(Taxi, "Origin", TaxiOrigin);
TeleportEntity(param1, TaxiOrigin, NULL_VECTOR, NULL_VECTOR);
KvRewind(Taxi);
CloseHandle(Taxi);
}
}
}

//E Key:
public Action:CommandSpeed(Client)
{
//Cuffed:
if(IsCuffed[Client])
{

//Print:
PrintToChat(Client, "[RP] Du kannst das nicht machen, weil du gecufft bisst!");

//Return:
return Plugin_Handled;
}
//Declare:
decl Handle:Vault; <<<<<<<<<<---------------------------------------------------------------------------------------------- LINE 8191
decl Floatist, Float:ClientOrigin[3], Float:Origin[3];
decl String:NPCId[255], Stringrops[255], String:Buffer[5][32];

//Vault:
Vault = CreateKeyValues("Vault");

//Retrieve:
FileToKeyValues(Vault, NPCPath);

//Loop:
for(new X = 0; X < 100; X++)
{

//Convert:
IntToString(X, NPCId, 255);

//Load:
LoadString(Vault, "1", NPCId, "Null", Props);

//Found in DB:
if(StrContains(Props, "Null", false) == -1)
{

//Explode:
ExplodeString(Props, " ", Buffer, 5, 32);

//Origin:
GetClientAbsOrigin(Client, ClientOrigin);
Origin[0] = StringToFloat(Buffer[1]);
Origin[1] = StringToFloat(Buffer[2]);
Origin[2] = StringToFloat(Buffer[3]);

//Distance:
Dist = GetVectorDistance(ClientOrigin, Origin);


//Check:
if(Dist <= 150)
{
if(lastpressedSH[Client] >= GetGameTime()-3)
{
//Save
RobOrigin[Client] = Origin;

//Rob:
BeginRob(Client, "Banker", 125, 1, StringToInt(NPCId));
} else
{
PrintToChat(Client, "[RP] Druecke erneut <Sprinten> um den NPC auszurauben!");
}
lastpressedSH[Client] = GetGameTime();

}
}

Last edited by DEX|Extrem; 04-02-2011 at 08:32. Reason: lol
DEX|Extrem is offline
Send a message via ICQ to DEX|Extrem Send a message via Skype™ to DEX|Extrem
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-02-2011 , 08:31   Re: How can i Fix this warning
Reply With Quote #2

By ... searching

Indentation*
__________________
Silvers is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 04-02-2011 , 09:34   Re: How can i Fix this warning
Reply With Quote #3

delete line 8191
modify
Code:
Vault = CreateKeyValues("Vault");
to
Code:
new Handle:Vault = CreateKeyValues("Vault");
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 04-02-2011 , 09:43   Re: How can i Fix this warning
Reply With Quote #4

Quote:
Originally Posted by mcpan313 View Post
delete line 8191
modify
Code:
Vault = CreateKeyValues("Vault");
to
Code:
new Handle:Vault = CreateKeyValues("Vault");
No, what he has is right, it's an indentation warning...
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks
Samantha is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 04-03-2011 , 02:36   Re: How can i Fix this warning
Reply With Quote #5

Indentation warning occurs when your code is not organized.
Like:
This code wouldn't generate indentations warnings
Code:
stock Random()
{
   for(new client=MaxClients; client>0; client--)
      PrintToConsole(client, "Random!");
}
This one would generate indentations warning.
Code:
stock Random()
{
   for(new client=MaxClients; client>0; client--)
   PrintToConsole(client, "Random!");
}
Sammy-ROCK! is offline
DEX|Extrem
Junior Member
Join Date: Jul 2010
Location: Germany
Old 04-03-2011 , 16:42   Re: How can i Fix this warning
Reply With Quote #6

Ok, thx for Help
DEX|Extrem is offline
Send a message via ICQ to DEX|Extrem Send a message via Skype™ to DEX|Extrem
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 04-03-2011 , 18:32   Re: How can i Fix this warning
Reply With Quote #7

Use Notepad++, it has an auto indentation feature if your script gets really messed up.
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks
Samantha is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-03-2011 , 23:10   Re: How can i Fix this warning
Reply With Quote #8

Also if you're using spaces to indent your lines, and then you use a tab for the next line, it will throw the warning (and vice versa).
bl4nk is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-04-2011 , 02:48   Re: How can i Fix this warning
Reply With Quote #9

When copy code snips from forums post, there not TAB-spaces anymore.
Just lot of regular spaces, then happens what @bl4nk mention above.
Bacardi is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 04-04-2011 , 09:10   Re: How can i Fix this warning
Reply With Quote #10

Most text editors allow for fast indentation.
So if you're getting a lot of warnings like that, just remove all indentation (Select all and shift-tab a few times to decrease all indentation) and re-indent according to your brackets.
After a while, you should get used to having indentation done correctly the first time, though ;p
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode