Raised This Month: $ Target: $400
 0% 

Loose Indentation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ludacriss
BANNED
Join Date: Aug 2010
Old 08-04-2010 , 21:10   Loose Indentation
Reply With Quote #1

Why do i get the error: Loose Indentation on line 2859 and 2864

PHP Code:
public respawn_sapitem(id)
{
    if (
is_user_alive(id))
    {
        if (
has_chicken[id] == true)
        {
            
give_item(id"weapon_mac10")
        }
        
        if (
has_john[id] == true)
        {
            
give_item(id"weapon_fiveseven")
        }
        
        if (
has_tactical[id] == true)
        {
            
give_item(id"weapon_m3")
        }
    
        if (
has_dynamic[id] == true)    
        {
            
give_item(id"weapon_deagle")
        }
    }

Ludacriss is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-04-2010 , 21:15   Re: Loose Indentation
Reply With Quote #2

Which lines are 2859 and 2864??
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Ludacriss
BANNED
Join Date: Aug 2010
Old 08-04-2010 , 21:16   Re: Loose Indentation
Reply With Quote #3

PHP Code:
if (has_john[id] == true
2859

And

2864
PHP Code:
if (has_tactical[id] == true
Everything worked before i added

PHP Code:
        if (has_john[id] == true)
        {
            
give_item(id"weapon_fiveseven")
        } 
Ludacriss is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-04-2010 , 21:19   Re: Loose Indentation
Reply With Quote #4

Code:
public respawn_sapitem(id)
{
    if (is_user_alive(id))
    {
    if (has_chicken[id] == true)
        {
        give_item(id, "weapon_mac10")
        }
        
    if (has_john[id] == true)
        {
        give_item(id, "weapon_fiveseven")
        }
        
    if (has_tactical[id] == true)
        {
        give_item(id, "weapon_m3")
        }
    
    if (has_dynamic[id] == true)    
        {
        give_item(id, "weapon_deagle")
        }
    }
}
Try replacing that in and see if it works.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Ludacriss
BANNED
Join Date: Aug 2010
Old 08-04-2010 , 21:21   Re: Loose Indentation
Reply With Quote #5

Ty Man! It worked! What did u change?
Ludacriss is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-04-2010 , 21:25   Re: Loose Indentation
Reply With Quote #6

The if's were indented with spaces, so i indented them with tab. I did that for give_item also. Also, loose indentations are just warnings, usually not gonna mess up the plugin or anything, it'll still work. But just makes it more neat
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-04-2010 , 23:12   Re: Loose Indentation
Reply With Quote #7

@Ludariss, if you just copy the code that you posted here and replace the original with it then I bet it will work.

Quote:
Originally Posted by nikhilgupta345 View Post
The if's were indented with spaces, so i indented them with tab. I did that for give_item also. Also, loose indentations are just warnings, usually not gonna mess up the plugin or anything, it'll still work. But just makes it more neat
First of all, your indentation is horrible. Second, anything copied from this forum by highlighting it will give you all spaces regardless of how you have it in your text editor.


The OP's indentation is perfect but what is causing the warning is likely the combination of spaces and tabs.
__________________
fysiks is offline
Ludacriss
BANNED
Join Date: Aug 2010
Old 08-04-2010 , 21:54   Re: Loose Indentation
Reply With Quote #8

Aha ok man ty
Ludacriss is offline
Ludacriss
BANNED
Join Date: Aug 2010
Old 08-05-2010 , 09:11   Re: Loose Indentation
Reply With Quote #9

It's not my whole code it's made by Vechta.
Ludacriss is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-05-2010 , 09:19   Re: Loose Indentation
Reply With Quote #10

Quote:
Originally Posted by Ludacriss View Post
It's not my whole code it's made by Vechta.
Its an ugly code, sorry xDD

And its so bad scripted
Vechta 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 00:17.


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