AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ban a Player (https://forums.alliedmods.net/showthread.php?t=327276)

Thew_ConFiger 09-09-2020 09:59

Ban a Player
 
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

DJEarthQuake 09-10-2020 07:16

Re: Ban a Player
 
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);

Thew_ConFiger 09-10-2020 13:30

Re: Ban a Player
 
Thank you very much but
Compile eror :
// E:\scripting\Warn.sma(168) : 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"

ZaX 09-10-2020 14:24

Re: Ban a Player
 
https://www.amxmodx.org/api/amxmodx/get_user_authid

DJEarthQuake 09-11-2020 20:36

Re: Ban a Player
 
Quote:

Originally Posted by Thew_ConFiger (Post 2717377)
Thank you very much but
Compile eror :
// E:\scripting\Warn.sma(168) : 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.

ZaX 09-12-2020 07:50

Re: Ban a Player
 
@DJEarthQuake Why MAXPLAYERS+1? It should be max steamid length. I think its 34

DJEarthQuake 09-12-2020 11:53

Re: Ban a Player
 
That's a good point. The quick copy/paste had a 33 in there and I didn't want that either.

Thew_ConFiger 09-13-2020 03:20

Re: Ban a Player
 
@DJEarthQuake
Thank you very much

DJEarthQuake 09-13-2020 08:06

Re: Ban a Player
 
@Thew_ConFiger, you're welcome. Glad you got it working.


All times are GMT -4. The time now is 07:51.

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