Raised This Month: $32 Target: $400
 8% 

set_task loose indentation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 07-05-2020 , 13:36   set_task loose indentation
Reply With Quote #1

Hey, so I tried to find some plugins with set_task and find my mistake, but I can't find any.
I get loose indentation message when compiling.
Here is my code:
PHP Code:
set_task0.2 "team_check" "b" ); 
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-05-2020 , 14:08   Re: set_task loose indentation
Reply With Quote #2

This error is not a problem

test:
PHP Code:
set_task(0.2,"team_check",0,"b"); 
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷

Last edited by alferd; 07-05-2020 at 14:09.
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-05-2020 , 14:09   Re: set_task loose indentation
Reply With Quote #3

Indent your code properly.

Code:
if something    {   bla bla }

=>

Code:
if something {     bla bla }

@alferd - stop trying to help if you have no clue what's going on.
__________________

Last edited by OciXCrom; 07-05-2020 at 14:09.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-05-2020 , 14:11   Re: set_task loose indentation
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
@alferd - stop trying to help if you have no clue what's going on.
ok
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷

Last edited by alferd; 07-05-2020 at 14:11.
alferd is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-05-2020 , 14:34   Re: set_task loose indentation
Reply With Quote #5

PHP Code:
native set_task(Float:time, const function[], id 0, const any:parameter[] = ""len 0, const flags[] = ""repeat 0);

set_task0.2 "team_check" , .flags="b" ); 
And for compiling check what OciXCrom said.
__________________
Retired.

Last edited by Xalus; 07-05-2020 at 14:35.
Xalus is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 07-05-2020 , 14:42   Re: set_task loose indentation
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Indent your code properly.
PHP Code:
public team_check()
{
    new 
iPlayers[32], iPnum;
    
get_players(iPlayersiPnum);

    for(new 
iidsiPnumi++)
    {
        
ids iPlayers[i];
        
g_TeamId[ids] = get_user_team(ids);
    }

I see no indentation problems...
__________________
Contact! || Discord:
Mr_Boopsy_#2066

Last edited by supertrio17; 07-05-2020 at 14:44.
supertrio17 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-05-2020 , 14:47   Re: set_task loose indentation
Reply With Quote #7

After telling others to post their source code, tell yourself the exact same thing.
thEsp is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-05-2020 , 15:19   Re: set_task loose indentation
Reply With Quote #8

Are you mixing tabs and spaces?
__________________
HamletEagle is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 07-05-2020 , 15:44   Re: set_task loose indentation
Reply With Quote #9

PHP Code:
#include <amxmodx>
#include <nvault>

#define VERSION "0.1"

new g_TeamId[33];
new 
g_szAuthID[33][35];
new 
g_Vault;

public 
plugin_init() 
{
    
register_plugin("Reconnect Blocker"VERSION"Mr. Boopsy");
    
set_task(0.2"team_check"0, .flags="b");
}

public 
plugin_cfg()
{
    
g_Vault nvault_open"Reconnect_Blocker" );

    if ( 
g_Vault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );
}

public 
client_authorized(id)
{
    
register_event("TextMsg""EVENT_PlayerJoinCT""a""2&#Game_join_ct");
    
register_event("TextMsg""EVENT_PlayerJoinTT""a""2&#Game_join_terrorist");

    
get_user_authid(idg_szAuthID[id], charsmax(g_szAuthID[]));
}

public 
EVENT_PlayerJoinCT(id)
{
    new 
szKey[40];
    
formatex(szKeycharsmaxszKey ), "%sTEAM"g_szAuthID[id]);

    new 
iTeam nvault_get(g_VaultszKey );
    if(
iTeam == 2)
    {
        new 
ip[32];
        
get_user_ip(id,ip,31,1);
        
server_cmd("amx_addban %s 2"ip)
    }
}

public 
EVENT_PlayerJoinTT(id)
{
    new 
szKey[40];
    
formatex(szKeycharsmaxszKey ), "%sTEAM"g_szAuthID[id]);

    new 
iTeam nvault_get(g_VaultszKey );
    if(
iTeam == 1)
    {
        new 
ip[32];
        
get_user_ip(id,ip,31,1);
        
server_cmd("amx_addban %s 2"ip)
    }
}

public 
team_check()
{
    new 
iPlayers[32], iPnum;
    
get_players(iPlayersiPnum);

    for(new 
iidsiPnumi++)
    {
        
ids iPlayers[i];
        
g_TeamId[ids] = get_user_team(ids);
    }
}

#if AMXX_VERSION_NUM < 190
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
    new 
szTeam[20];
    new 
szKey[40];

    
formatex(szKeycharsmaxszKey ), "%sTEAM"g_szAuthID[id]);
    
formatex(szTeamcharsmaxszTeam ), "%d"g_TeamId[id]);

    
g_TeamId[id] = 0;
    
server_print("reached")
}

public 
plugin_end()
{
    
nvault_closeg_Vault );

I know that it won't work as it is, it just a test code.
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-05-2020 , 15:57   Re: set_task loose indentation
Reply With Quote #10

The code compiles without any warning or errors. If you mixed tabs and spaces in your text editor, that's the problem. The forum supports only spaces so the tabs would have automatically be changed to spaces.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 16:53.


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