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

What is wrong in code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 04-15-2020 , 01:35   What is wrong in code?
Reply With Quote #1

PHP Code:
public client_authorized(id)
{
    new 
players get_playersnum(1)
    new 
limit maxplayers get_pcvar_num(cvar_reservedslots)
    
    if(
players limit
    {
        if( !(
get_user_flags(id) & ADMIN_IMMUNITY) ) 
            if(
get_pcvar_num(cvar_redirect) == 1)
                
redirect_player(id)
                new 
lReason[128]
                
format(lReason127"Sarvara e palen a ti nqma6 zapazeno mqsto! Za da si kypi6 skype: XXX"id)
                
server_cmd("kick #%d %s"get_user_userid(id), lReason)
    }
    return 
PLUGIN_CONTINUE

What is wrong here? I have this error when compile.
slot_redirekt.sma(11) : warning 217: loose indentation
LauNcHerR is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-15-2020 , 08:34   Re: What is wrong in code?
Reply With Quote #2

Code:
Your     code        is not indented            properly.

Plus, that's not an error, just a warning. The code will still work.

Code:
public function() {     some code     if(something)     {         some code                 if(something)         {             some code         }     } }
__________________

Last edited by OciXCrom; 04-15-2020 at 08:34.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 04-17-2020 , 15:15   Re: What is wrong in code?
Reply With Quote #3

Ok i understand, but why this code run kick command first? How to make first redirect_player(id) and than kick...?

PHP Code:
public client_authorized(id)
{
    new 
players get_playersnum(1)
    new 
limit maxplayers get_pcvar_num(cvar_reservedslots)
    
    if(
players limit
    {
        if( !(
get_user_flags(id) & ADMIN_IMMUNITY) )
            {
                if(
get_pcvar_num(cvar_redirect) == 1)
                    {
                        
redirect_player(id)
                        new 
lReason[128]
                        
format(lReason127"Sarvara e palen a ti nqma6 zapazeno mqsto! Za da si kypi6 skype: XXX"id)
                        
server_cmd("kick #%d %s"get_user_userid(id), lReason)
                    }
            }
    }
    return 
PLUGIN_CONTINUE

LauNcHerR is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-17-2020 , 15:26   Re: What is wrong in code?
Reply With Quote #4

And what does redirect_player() do?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 04-17-2020 , 16:08   Re: What is wrong in code?
Reply With Quote #5

PHP Code:
stock redirect_player(id)
{
    
client_cmd(id,"connect 123.123.123.123:27015")

LauNcHerR is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-17-2020 , 17:40   Re: What is wrong in code?
Reply With Quote #6

That won't work. Redirection is blocked by Steam.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 04-17-2020 , 20:50   Re: What is wrong in code?
Reply With Quote #7

Yes but works for other users. Anyway, i make public for kick with task. Here search for better method but no one help...

Last edited by LauNcHerR; 04-17-2020 at 20:55.
LauNcHerR is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-17-2020 , 21:21   Re: What is wrong in code?
Reply With Quote #8

Those "other users" are not supported here.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-17-2020 , 23:31   Re: What is wrong in code?
Reply With Quote #9

Nice post edit. No steam = no support.
Attached Thumbnails
Click image for larger version

Name:	NonSteam.PNG
Views:	71
Size:	17.2 KB
ID:	180849  
__________________

Last edited by Bugsy; 04-17-2020 at 23:32.
Bugsy is online now
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-18-2020 , 04:30   Re: What is wrong in code?
Reply With Quote #10

Quote:
Originally Posted by LauNcHerR View Post
Yes but works for other users. Anyway, i make public for kick with task. Here search for better method but no one help...
You just don't like the truth. Steam users can not be redirected, there's nothing to help you with.
__________________
HamletEagle 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 01:03.


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