Raised This Month: $248 Target: $400
 62% 

Ban a Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thew_ConFiger
Member
Join Date: Apr 2019
Old 09-09-2020 , 09:59   Ban a Player
Reply With Quote #1

Greetings . how i can ban a player this part ??
PHP Code:
if(iWarns[iPlayer] == 6) {
        switch(
get_pcvar_num(pPunnishment)) {
            case 
0: {
                
show_motd(iPlayer"You Have 6 Warns . YOU GET BAN""Kicked!")
            }
        }
    } 
i use this but dont working
PHP Code:
if(iWarns[iPlayer] == 6) {
        switch(
get_pcvar_num(pPunnishment)) {
            case 
0: {
                
show_motd(iPlayer"You Have 6 Warns ! You Get ban""Kicked!")
                
server_cmd("amx_ban #%d ^"45.0^" ^"You Have 6 Warn  You Get Ban^" ^"AUTO^"",get_user_userid(id));
            }
        }
    } 
Can you help me please ?
i want player get 45 minutes ban
__________________
Learn to read first. And you will succeed

Last edited by Thew_ConFiger; 09-09-2020 at 10:12.
Thew_ConFiger is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-10-2020 , 07:16   Re: Ban a Player
Reply With Quote #2

Code:
#if !defined MAX_AUTHID_LENGTH #define MAX_AUTHID_LENGTH 64 #endif new authid[MAX_AUTHID_LENGTH]; get_user_authid(id,authid,charsmax(authid)); server_cmd("amx_addban ^"%s^" ^"45^" ^"Insert message here^"", authid);
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 09-12-2020 at 14:41. Reason: code revision
DJEarthQuake is offline
Thew_ConFiger
Member
Join Date: Apr 2019
Old 09-10-2020 , 13:30   Re: Ban a Player
Reply With Quote #3

Thank you very much but
Compile eror :
// E:\scripting\Warn.sma(16 : warning 217: loose indentation
// E:\scripting\Warn.sma(179) : error 017: undefined symbol "authid"
// E:\scripting\Warn.sma(183) : warning 217: loose indentation
// E:\scripting\Warn.sma(186) : error 017: undefined symbol "authid"
// E:\scripting\Warn.sma(193) : error 017: undefined symbol "authid"
__________________
Learn to read first. And you will succeed

Last edited by Thew_ConFiger; 09-10-2020 at 13:39.
Thew_ConFiger is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 09-10-2020 , 14:24   Re: Ban a Player
Reply With Quote #4

https://www.amxmodx.org/api/amxmodx/get_user_authid
ZaX is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-11-2020 , 20:36   Re: Ban a Player
Reply With Quote #5

Quote:
Originally Posted by Thew_ConFiger View Post
Thank you very much but
Compile eror :
// E:\scripting\Warn.sma(16 : warning 217: loose indentation
// E:\scripting\Warn.sma(179) : error 017: undefined symbol "authid"
// E:\scripting\Warn.sma(183) : warning 217: loose indentation
// E:\scripting\Warn.sma(186) : error 017: undefined symbol "authid"
// E:\scripting\Warn.sma(193) : error 017: undefined symbol "authid"
You are welcome. I've added to the snip so it should help you compile and get ban working.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 09-11-2020 at 20:37.
DJEarthQuake is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 09-12-2020 , 07:50   Re: Ban a Player
Reply With Quote #6

@DJEarthQuake Why MAXPLAYERS+1? It should be max steamid length. I think its 34

Last edited by ZaX; 09-12-2020 at 09:37.
ZaX is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-12-2020 , 11:53   Re: Ban a Player
Reply With Quote #7

That's a good point. The quick copy/paste had a 33 in there and I didn't want that either.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Thew_ConFiger
Member
Join Date: Apr 2019
Old 09-13-2020 , 03:20   Re: Ban a Player
Reply With Quote #8

@DJEarthQuake
Thank you very much
__________________
Learn to read first. And you will succeed
Thew_ConFiger is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-13-2020 , 08:06   Re: Ban a Player
Reply With Quote #9

@Thew_ConFiger, you're welcome. Glad you got it working.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

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 08:24.


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