Raised This Month: $ Target: $400
 0% 

Plugin Auto-ban


  
 
 
Thread Tools Display Modes
benjibau
Veteran Member
Join Date: Jul 2009
Location: France (Nord 59)
Old 09-22-2009 , 13:18   Re: Plugin Auto-ban
#21

Hmm un peut bizarre car c'est le nombre de personne tuer moins le nombre de mort sur sa tu a essayer de modifier la ratio ? (mettre plus que 8 )
benjibau is offline
Send a message via MSN to benjibau
elplouk
Member
Join Date: Aug 2009
Location: France
Old 09-22-2009 , 13:18   Re: Plugin Auto-ban
#22

elle était à 15
elplouk is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-23-2009 , 00:57   Re: Plugin Auto-ban
#23

C'est corrigé.

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    Score Maxi is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Score Maxi; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <amxmisc>

#define VERSION "0.0.3"

#define MAX_PLAYERS    32

enum _:ScoreInfo_Datas {
    
PlayerID 1,
    
Frags,
    
Deaths,
    
ClassID,
    
TeamID
}

new 
g_pCvarMaxScoreDiffg_pCvarBanTimeg_pCvarFlagsForImmunity
new g_bIsAdmin[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin("Score Maxi"VERSION"ConnorMcLeod")

    
g_pCvarMaxScoreDiff register_cvar("amx_highscore_maxdiff""3")
    
g_pCvarBanTime register_cvar("amx_highscore_bantime""60")
    
g_pCvarFlagsForImmunity register_cvar("amx_highscore_immunity""a")  // "a" pour ADMIN_IMMUNITY, on peut mettre plusieurs lettres.

    
register_event("ScoreInfo""Event_ScoreInfo""a")
}

public 
client_putinserverid )
{
    new 
szFlags[26]
    
get_pcvar_string(g_pCvarFlagsForImmunityszFlagscharsmax(szFlags))
    
g_bIsAdmin[id] = has_all_flags(idszFlags)
}

public 
Event_ScoreInfo()
{
    new 
id read_data(PlayerID)
    if(    !
g_bIsAdmin[id]
    &&    (
read_data(Frags) - read_data(Deaths) > get_pcvar_num(g_pCvarMaxScoreDiff))    )
    {
        new 
szTemp[32], szMinutes[8]

        
get_user_name(idszTempcharsmax(szTemp))
        
client_print(0print_chat"%s est banni car il est trop fort."szTemp

        
get_pcvar_string(g_pCvarBanTimeszMinutescharsmax(szMinutes))
        
get_user_authid(idszTempcharsmax(szTemp))
        
server_cmd("banid ^"%s^" ^"%s^";wait;writeid"szMinutesszTemp)

        
emessage_begin(MSG_ONESVC_DISCONNECT_id)
        
ewrite_string("Tu es trop fort pour se serveur.")
        
emessage_end()
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
elplouk
Member
Join Date: Aug 2009
Location: France
Old 09-23-2009 , 01:26   Re: Plugin Auto-ban
#24

Merci je l'essaye cet aprèm
elplouk is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-23-2009 , 02:19   Re: Plugin Auto-ban
#25

Je pourrai aussi ajouter un warning qui préviendra le joueur quand il est proche du score critique, ce qui lui permettra de se limiter par exemple en armes.
Regarde aussi le plugin mTl que j'ai posté dans cette section, il pourrait t'intéresser, il est très léger en limitation et je pense qu'il pourrait te convenir.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
elplouk
Member
Join Date: Aug 2009
Location: France
Old 09-23-2009 , 06:15   Re: Plugin Auto-ban
#26

J'ai déjà essayé ton plugin mTl mais il ne me convient pas car par exemple, sur les maps awp, on est limité au glock car on ne peut pas acheter.

Sinon pour le warning j'aimerai bien un petit message qui s'affiche quand on vient de rejoindre le serveur (comme pour le HPK) avec : Difference de ... entre le score et les morts => ban ...h
ou un truc du genre ^^

Merci
elplouk is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-23-2009 , 12:02   Re: Plugin Auto-ban
#27

Suffit de désactiver mtl sur les maps awp, une ligne dans le fichier plugins-awp.ini et c'est réglé.

amx_highscore_advert pour le nombre de fois de suite que le message est affiché.

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    Score Maxi is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Score Maxi; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <amxmisc>

#define VERSION "0.0.4"

#define MAX_PLAYERS    32

enum _:ScoreInfo_Datas {
    
PlayerID 1,
    
Frags,
    
Deaths,
    
ClassID,
    
TeamID
}

new 
g_pCvarMaxScoreDiffg_pCvarBanTimeg_pCvarFlagsForImmunityg_pCvarAdvertise
new g_bIsAdmin[MAX_PLAYERS+1]
new 
gmsgSayText

public plugin_init()
{
    
register_plugin("Score Maxi"VERSION"ConnorMcLeod")

    
g_pCvarMaxScoreDiff register_cvar("amx_highscore_maxdiff""3")
    
g_pCvarBanTime register_cvar("amx_highscore_bantime""60")
    
g_pCvarFlagsForImmunity register_cvar("amx_highscore_immunity""a")  // "a" pour ADMIN_IMMUNITY, on peut mettre plusieurs lettres.
    
g_pCvarAdvertise register_cvar("amx_highscore_advert""2")

    
register_event("ScoreInfo""Event_ScoreInfo""a")

    
gmsgSayText get_user_msgid("SayText")
}

public 
client_putinserverid )
{
    new 
szFlags[26]
    
get_pcvar_string(g_pCvarFlagsForImmunityszFlagscharsmax(szFlags))
    
g_bIsAdmin[id] = has_all_flags(idszFlags)

    new 
iAdverts get_pcvar_num(g_pCvarAdvertise)
    if( 
iAdverts )
    {
        
set_task(random_float(21.029.0), "HighScoreRadioAdvert"id, .flags=iAdverts "a" "", .repeat=iAdverts-1)
    }
}

public 
HighScoreRadioAdvert(id)
{
    new 
iDiff get_pcvar_num(g_pCvarMaxScoreDiff)
    
ColorChat(idid"^4Sur ce serveur, si tes ^3frags ^4depassent de ^3%d ^4tes ^3morts^4, tu sera banni."iDiff)
    
ColorChat(idid"^3Frags ^4- ^3Deaths ^4> ^3%d ^4= ^3BAN"iDiff)
}

public 
Event_ScoreInfo()
{
    new 
id read_data(PlayerID)
    if(    !
g_bIsAdmin[id]
    &&    (
read_data(Frags) - read_data(Deaths) > get_pcvar_num(g_pCvarMaxScoreDiff))    )
    {
        new 
szTemp[32], szMinutes[8]

        
get_user_name(idszTempcharsmax(szTemp))
        
ColorChat(0id"^4%s ^3est banni car il est trop fort."szTemp

        
get_pcvar_string(g_pCvarBanTimeszMinutescharsmax(szMinutes))
        
get_user_authid(idszTempcharsmax(szTemp))
        
server_cmd("banid ^"%s^" ^"%s^";wait;writeid"szMinutesszTemp)

        
emessage_begin(MSG_ONESVC_DISCONNECT_id)
        
ewrite_string("Tu es trop fort pour se serveur.")
        
emessage_end()
    }
}

ColorChat(const iReceiver, const iSender 1, const fmt[], any:...)
{
    new 
szMessage[192]
    
vformat(szMessagecharsmax(szMessage), fmt4)

    
message_begin(iReceiver MSG_ONE_UNRELIABLE MSG_BROADCASTgmsgSayText, .player=iReceiver)
    
write_byte(iSender)
    
write_string(szMessage)
    
message_end()

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
elplouk
Member
Join Date: Aug 2009
Location: France
Old 09-23-2009 , 15:37   Re: Plugin Auto-ban
#28

Connor le plugin que tu as posté ce matin ne marche toujours pas... Il a ban le joueur fort mais en même temps il a kick tout le monde avec ce message :
Reliable Channel Overflowed

De plus, l'ID steam du joueur banni n'apparaissait pas sur HLSW, il y avait un ban d'une heure sans ID
elplouk is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-24-2009 , 01:18   Re: Plugin Auto-ban
#29

Essaie cette version :

PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    Score Maxi is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Score Maxi; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <amxmisc>

#define VERSION "0.0.5"

#define MAX_PLAYERS    32

enum _:ScoreInfo_Datas {
    
PlayerID 1,
    
Frags,
    
Deaths,
    
ClassID,
    
TeamID
}

new 
g_pCvarMaxScoreDiffg_pCvarBanTimeg_pCvarFlagsForImmunityg_pCvarAdvertise
new g_bIsAdmin[MAX_PLAYERS+1]
new 
gmsgSayText

public plugin_init()
{
    
register_plugin("Score Maxi"VERSION"ConnorMcLeod")

    
g_pCvarMaxScoreDiff register_cvar("amx_highscore_maxdiff""3")
    
g_pCvarBanTime register_cvar("amx_highscore_bantime""60")
    
g_pCvarFlagsForImmunity register_cvar("amx_highscore_immunity""a")  // "a" pour ADMIN_IMMUNITY, on peut mettre plusieurs lettres.
    
g_pCvarAdvertise register_cvar("amx_highscore_advert""2")

    
register_event("ScoreInfo""Event_ScoreInfo""a")

    
gmsgSayText get_user_msgid("SayText")
}

public 
client_putinserverid )
{
    new 
szFlags[26]
    
get_pcvar_string(g_pCvarFlagsForImmunityszFlagscharsmax(szFlags))
    
g_bIsAdmin[id] = has_all_flags(idszFlags)

    new 
iAdverts get_pcvar_num(g_pCvarAdvertise)
    if( 
iAdverts )
    {
        
set_task(random_float(21.029.0), "HighScoreRadioAdvert"id, .flags=iAdverts "a" "", .repeat=iAdverts-1)
    }
}

public 
HighScoreRadioAdvert(id)
{
    new 
iDiff get_pcvar_num(g_pCvarMaxScoreDiff)
    
ColorChat(idid"^4Sur ce serveur, si tes ^3frags ^4depassent de ^3%d ^4tes ^3morts^4, tu sera banni."iDiff)
    
ColorChat(idid"^3Frags ^4- ^3Deaths ^4> ^3%d ^4= ^3BAN"iDiff)
}

public 
Event_ScoreInfo()
{
    new 
id read_data(PlayerID)
    if(    !
g_bIsAdmin[id]
    &&    (
read_data(Frags) - read_data(Deaths) > get_pcvar_num(g_pCvarMaxScoreDiff))    )
    {
        new 
szName[32]
        
get_user_name(idszNamecharsmax(szName))
        
ColorChat(0id"^4%s ^3est banni car il est trop fort."szName

        
server_cmd("banid %d #%d kick;writeid"get_pcvar_num(g_pCvarBanTime), get_user_userid(id))
    }
}

ColorChat(const iReceiver, const iSender 1, const fmt[], any:...)
{
    new 
szMessage[192]
    
vformat(szMessagecharsmax(szMessage), fmt4)

    
message_begin(iReceiver MSG_ONE_UNRELIABLE MSG_BROADCASTgmsgSayText, .player=iReceiver)
    
write_byte(iSender)
    
write_string(szMessage)
    
message_end()

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
magik
Member
Join Date: Aug 2009
Old 09-29-2009 , 14:10   Re: Plugin Auto-ban
#30

bonjour

je me suis permis t'installer le plugin sur mon serveur, mais il ne marche pas.
voila le message, je l'ai nommé limitation.sma
[ 24] unknown unknown unknown limitation.amxx bad load
( 24) Load fails: Plugin uses an unknown function (name "vformat") - check your modules.ini.
24 plugins, 23 running

serait il possible qu'une personne me compile la meme chose en amxmodx version 1.8.1 avec la possibilité de changer le nombre de frang, et le banir que 5 minutes.
je vous remercie d'avance
magik is offline
 



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:12.


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