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

Plugin Convention des Pseudos


  
 
 
Thread Tools Display Modes
Author Message
Toots
Member
Join Date: Mar 2007
Old 06-04-2013 , 12:23   Plugin Convention des Pseudos
#1

Voici un plugin qui facilite énormément le boulot des admins de notre serveur vis à vis de nos règles sur les pseudos. Suite à l'aide de AirShot, sur un autre plugin, j'ai remplacé les get_cvarptr_num par get_pcvar_num mais j'ai d'autres erreurs que je ne sait pas résoudre.

D'abord les erreurs :
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Number of arguments does not match definition on line 260
Error: Number of arguments does not match definition on line 260
Error: Undefined symbol "trim_imp" on line 298
Error: Undefined symbol "trim_imp" on line 375
Error: Undefined symbol "client_print_color" on line 419
Error: Undefined symbol "client_print_color" on line 427
Error: Number of arguments does not match definition on line 463
Error: Number of arguments does not match definition on line 463

8 Errors.
Could not locate output file Z:\00_Mes Documents\01_Developpement\urgent\addons\amx\ examples\source\pseudos.amx (compile failed).
Et voilà le code:
Code:
/* AMX Mod script
 *
 * (c) Copyright 2007-2012, Stratege (from the same Sacripan's script)
 * This file is provided as is (no warranties).
 *
 * This plugin kicks players with special characters in their names.
 * Before to be kicked, the player can see a message (via MOTD).
 * Also, it manages the "Clan Tags", like KConst Names can do, via a file.
 *
 * You can configurate the plugin via some files, commands and cvars.
 *
 * Modified by KRoT@L on 2009/03/04 => version 4.0
 * Modified by KRoT@L on 2009/03/05 => version 4.1
 * Modified by KRoT@L on 2009/03/08 => version 4.2
 * Modified by an AMX Mod User on 2012/01/23 => version 5.0
 * Modified by an AMX Mod User on 2012/01/24 => version 5.1
 * Modified by an AMX Mod User on 2012/02/09 => version 5.2
 * Modified by an AMX Mod User on 2012/03/15 => version 5.2-CSCream
 *
 */

/************** CUSTOMIZATION AREA ***************/
#define FLAG_SAY_PSEUDOS ADMIN_ALL // access flag(s) required for the "say /pseudos" command

// Uncomment this following line to force the NO_STEAM support for this plugin.
//#define NO_STEAM

#define MAX_USERS 48 // maximum number of SteamIDs/IPs in the "amx/config/pseudos_users.ini" file

#define MIN_REQUIRED_CHARS 3 // min number of valid characters required into the player's name
#define MIN_REQUIRED_VOWELS 1 // min number of vowels required into the player's name
#define DELAY_BEFORE_KICK 10.0 // kick delay (in seconds)

#define MAX_WORDS 128 // maximum number of words/sentences to check
#define MAX_WORDS_LENGTH 16 // maximum length for each word/sentence
#define MAX_ANSWERS 20 // maximum number of answer sentences
#define MAX_ANSWERS_LENGTH 64 // maximum length for each answer

#define MAX_CONVENTION_LENGTH 1280 // maximum length for the convention text (from the default "pseudos_convention.txt" file)

#define MAX_NAME_LENGTH 33 // maximum name length (don't modify)
#define MAX_TAG_LENGTH 12 // maximum tag length

#define TASKID_KICK 687778

// File names (without path)
new const g_tagsFile[]       = "pseudos_users.ini" // file name for SteamIDs/IPs and their tags (without path)
new const g_conventionFile[] = "pseudos_convention.txt" // file name for the default convention text
new const g_cfgFile[]        = "pseudos_forbidden.cfg" // file name for the forbidden words and their answers (without path)

new const g_defaultTitle[]   = "Rules for Names" // default convention title used if cvar not set

/*********** END OF CUSTOMIZATION AREA ***********/

#include <translator>
#include <amxmod>
#include <amxmisc>

new const g_answerList[MAX_ANSWERS][MAX_ANSWERS_LENGTH+1]
new g_answerListCount = 0

new const g_wordList[MAX_WORDS][MAX_WORDS_LENGTH+1]
new g_wordListNum[MAX_WORDS]
new g_wordListCount = 0

new g_convention[MAX_CONVENTION_LENGTH] = ""
new g_conventionLen = 0

new const g_playerName[33][MAX_NAME_LENGTH]
new bool:g_kickTaskCreated[33]

new g_pseudosAuthIdsIps[MAX_USERS][24]
new g_pseudosTags[MAX_USERS][MAX_TAG_LENGTH]
new g_pseudosAuthIdsIpsCount

new g_cvarConventionTitle
new g_cvarTag
new g_cvarImmuneMembers

new bool:g_setConsolePrint
#if !defined NO_STEAM
new g_iMsgSayText, g_iMsgIdSayText
#endif
new g_szLogFile[20]

new const g_chars[]            = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@$ _.-'`~#{}()[]|\/*<>"
new const g_replacementChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzaS                    "
new const g_vowels[]           = "AEIOUYaeiouy"
new const g_numbers[]          = "0123456789"

#if !defined charsmax
  #define charsmax(%1) sizeof(%1) - 1
#endif

public plugin_init()
{
  load_translations("pseudos")
  new const PLUGIN_VERSION[] = "5.2-CSCream"
  register_plugin(_T("Pseudos"), PLUGIN_VERSION, "KRoT@L")

  register_srvcmd("amx_pseudos_answer", "pseudos_answer", ADMIN_RCON, _T("<answer> - adds an answer to a words list (from number)"))
  register_srvcmd("amx_pseudos_word", "pseudos_wordcheck", ADMIN_RCON, _T("<word/sentence to check> <answer number> - adds a word/sentence to check"))
  register_clcmd("say /pseudos", "pseudos_rules", FLAG_SAY_PSEUDOS, _T("- displays the rules about the players's names (MOTD)"))

  g_cvarConventionTitle = register_cvar("pseudos_convention_title", "Names Rules") // convention title name
  g_cvarTag = register_cvar("pseudos_tag", "1") // 0 = disabled, 1 = before name, 2 = after name
  g_cvarImmuneMembers = register_cvar("pseudos_immune_members", "1") // 0 = check members's names, 1 = don't check member's names
  register_cvar("Pseudos", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
  set_cvar_string("Pseudos", PLUGIN_VERSION)

  register_event("ResetHUD", "eResetHud", "be") // called only on an alive player

  #if !defined NO_STEAM
  g_iMsgIdSayText = get_user_msgid("SayText")
  #endif

  get_logfile(g_szLogFile, charsmax(g_szLogFile)) // could be used on non-local area

  // Forbidden file (forbidden words and their answers), tags file and convention file executed below
  new szConfigDir[32]
  get_localinfo("amx_configdir", szConfigDir, charsmax(szConfigDir))
  if(szConfigDir[0] == 0)
  {
    build_path(szConfigDir, charsmax(szConfigDir), "$configdir")
  }

  server_cmd("exec %s/%s", szConfigDir, g_cfgFile)
  set_task(4.0, "taskSetConsolePrint", 276979)

  new szFileName[64]
  new iFileNameLen = formatex(szFileName, charsmax(szFileName), "%s/%s", szConfigDir, g_tagsFile)

  loadPseudos(szFileName)

  szFileName[iFileNameLen - sizeof(g_tagsFile)] = 0
  formatex(szFileName, charsmax(szFileName), "%s/%s", szConfigDir, g_conventionFile)

  loadConvention(szFileName)
}

loadPseudos(const filename[])
{
  if(!file_exists(filename))
    return

  new line, len, text[64]
  while(g_pseudosAuthIdsIpsCount < MAX_USERS && (line = read_file(filename, line, text, charsmax(text), len)) != 0)
  {
    if(len < 3 || text[0] == ';' || text[0] == '#' || text[0] == '/' && text[1] == '/') continue
    if(parse(text, g_pseudosAuthIdsIps[g_pseudosAuthIdsIpsCount], charsmax(g_pseudosAuthIdsIps[]), g_pseudosTags[g_pseudosAuthIdsIpsCount], charsmax(g_pseudosTags[])) < 2) continue
    g_pseudosAuthIdsIpsCount++
  }

  if(g_pseudosAuthIdsIpsCount > 0)
  {
    log_to_file(g_szLogFile, _T("Pseudos: Loaded %d SteamID%s/IP%s and tag%s (%s)."),
    g_pseudosAuthIdsIpsCount, (g_pseudosAuthIdsIpsCount > 1) ? "s" : "", (g_pseudosAuthIdsIpsCount > 1) ? "s" : "", (g_pseudosAuthIdsIpsCount > 1) ? "s" : "", filename)
  }
  else
  {
    log_to_file(g_szLogFile, _T("Pseudos: No SteamID/IP and tag loaded (%s)."), filename)
  }
}

loadConvention(const filename[])
{
  if(!file_exists(filename))
    return

  new line, len, text[128]
  g_conventionLen = 0

  while(g_conventionLen < MAX_CONVENTION_LENGTH && (line = read_file(filename, line, text, charsmax(text), len)) != 0)
  {
    if(len == 0 || text[0] == ';' || text[0] == '#' || text[0] == '/' && text[1] == '/') continue
    if(g_conventionLen + len < MAX_CONVENTION_LENGTH)
    {
      g_conventionLen += copy(g_convention[g_conventionLen], MAX_CONVENTION_LENGTH - g_conventionLen, text)
    }
  }

  if(get_cvar_pointer("amxmodx_version"))
  {
    server_cmd("quit")
  }
}

public pseudos_answer(id, level, cid)
{
  if(!cmd_access(id, level, cid, 1))
    return PLUGIN_HANDLED

  if(g_answerListCount < MAX_ANSWERS)
  {
    read_argv(1, g_answerList[g_answerListCount], MAX_ANSWERS_LENGTH - 1)
    ++g_answerListCount
    if(g_setConsolePrint)
      console_print(id, _T("[AMX] Answer ^"%s^" added to the list."), g_answerList[g_answerListCount - 1])
  }
  else if(g_setConsolePrint)
  {
    console_print(id, _T("[AMX] Unable to add an answer to the list, limit reached!"))
  }

  return PLUGIN_HANDLED
}

public pseudos_wordcheck(id, level, cid)
{
  if(!cmd_access(id, level, cid, 3))
    return PLUGIN_HANDLED

  if(g_wordListCount < MAX_WORDS)
  {
    read_argv(1, g_wordList[g_wordListCount], MAX_WORDS_LENGTH - 1)

    new argument_num[4]
    read_argv(2, argument_num, charsmax(argument_num))
    if(!is_str_num(argument_num))
    {
      if(g_setConsolePrint)
        console_print(id, _T("[AMX] Usage: amx_pseudos_word <word/sentence to check> <answer number> - adds a word/sentence to check"))
      return PLUGIN_HANDLED
    }

    g_wordListNum[g_wordListCount] = str_to_num(argument_num)
    ++g_wordListCount

    if(g_setConsolePrint)
      console_print(id, _T("[AMX] Word/Sentence ^"%s^" (number: %d) added to the list."), g_wordList[g_wordListCount - 1], g_wordListNum[g_wordListCount - 1])
  }
  else if(g_setConsolePrint)
  {
    console_print(id, _T("[AMX] Unable to add a word/sentence to the list, limit reached!"))
  }

  return PLUGIN_HANDLED
}

public taskSetConsolePrint()
{
  g_setConsolePrint = true
}

public pseudos_rules(id, level)
{
  if(!access(id, level))
  {
    console_print(id, _T("You have no access to that command."))
    return PLUGIN_HANDLED
  }

  #if !defined NO_STEAM
  copy(g_convention[g_conventionLen], MAX_CONVENTION_LENGTH - g_conventionLen - 1, _T("<b>You requested to see it!</b>", id))
  #else
  copy(g_convention[g_conventionLen], MAX_CONVENTION_LENGTH - g_conventionLen - 1, _T("You requested to see it!", id))
  #endif

  new titleName[32]
  get_pcvar_num(g_cvarConventionTitle, titleName, charsmax(titleName))

  show_motd(id, g_convention, (titleName[0] && titleName[0] != 0) ? titleName : g_defaultTitle)
  return PLUGIN_HANDLED
}

test_pseudo(id, playerName[])
{
  new bool:kick = false
  new bool:defaultMsg = false
  new i = 0
  new cvarTag
  new cvarImmune
  new bufferLetterToCheck
  new memberPosition = -1
  new listPosition = 0
  new validCharsNum = 0
  new vowelsNum = 0
  new tagLen = 0
  new authidLen
  new ipLen
  new playerNameLen
  new authid[24]
  new ip[24]
  new newPlayerName[MAX_NAME_LENGTH]
  new playerNameTag[MAX_TAG_LENGTH]
  static message[MAX_ANSWERS_LENGTH]
  message[0] = 0

  for(i = 0; i < g_pseudosAuthIdsIpsCount; ++i)
  {
    replace(playerName, MAX_NAME_LENGTH - 1, g_pseudosTags[i], "")
  }

  authidLen = get_user_authid(id, authid, charsmax(authid))
  ipLen = get_user_ip(id, ip, charsmax(ip), 1)
  memberPosition = check_tag(authid, authidLen, ip, ipLen)

  playerNameLen = trim_imp(playerName)

  if(memberPosition == -1 || memberPosition != -1 && (cvarImmune = get_pcvar_num(g_cvarImmuneMembers)) <= 0)
  {
    for(i = 0; i < playerNameLen; ++i)
    {
      bufferLetterToCheck = playerName[i]

      listPosition = light_contain(0, bufferLetterToCheck)

      if(listPosition == -1)
      {
        if(light_contain(1, bufferLetterToCheck) == -1)
        {
          #if !defined NO_STEAM
          copy(message, MAX_ANSWERS_LENGTH - 1, "<b>Forbidden character(s)</b>")
          #else
          copy(message, MAX_ANSWERS_LENGTH - 1, "Forbidden character(s)")
          #endif
          kick = true
          defaultMsg = true
        }
      }
      else
      {
        add(newPlayerName, MAX_NAME_LENGTH - 1, g_replacementChars[listPosition], 1)
        ++validCharsNum
      }

      if(light_contain(2, bufferLetterToCheck) >= 0)
        ++vowelsNum
    }

    if(kick == false && validCharsNum < MIN_REQUIRED_CHARS)
    {
      #if !defined NO_STEAM
      copy(message, MAX_ANSWERS_LENGTH - 1, "<b>Number of characters does not enough</b>")
      #else
      copy(message, MAX_ANSWERS_LENGTH - 1, "Number of characters does not enough")
      #endif
      kick = true
      defaultMsg = true
    }

    if(kick == false && vowelsNum < MIN_REQUIRED_VOWELS)
    {
      #if !defined NO_STEAM
      copy(message, MAX_ANSWERS_LENGTH - 1, "<b>Unpronounceable name</b>")
      #else
      copy(message, MAX_ANSWERS_LENGTH - 1, "Unpronounceable name")
      #endif
      kick = true
      defaultMsg = true
    }

    if(kick == false)
    {
      for(i = 0; i < g_wordListCount; ++i)
      {
        if(containi(newPlayerName, g_wordList[i]) >= 0)
        {
          kick = true
          defaultMsg = false
          copy(message, MAX_ANSWERS_LENGTH - 1, g_answerList[g_wordListNum[i]])
          break
        }
      }
    }
  }

  if(kick == false)
  {
    if(memberPosition != -1 && cvarImmune > 0)
    {
      copy(newPlayerName, charsmax(newPlayerName), playerName)
    }

    playerNameLen = trim_imp(newPlayerName)

    if(equali(newPlayerName, "Player"))
    {
      playerNameLen = format(newPlayerName, MAX_NAME_LENGTH - 1, "%s_%i", newPlayerName, id)
    }

    if(memberPosition != -1 && (cvarTag = get_pcvar_num(g_cvarTag)) > 0)
    {
      if(cvarTag > 1)
      {
        tagLen = copy(playerNameTag, MAX_TAG_LENGTH - 1, g_pseudosTags[memberPosition])

        if(MAX_NAME_LENGTH - playerNameLen > tagLen)
        {
          add(newPlayerName, charsmax(newPlayerName), playerNameTag) 
        }
        else
        {
          copy(newPlayerName[MAX_NAME_LENGTH - tagLen - 2], tagLen, playerNameTag)
        }
      }
      else
      {
        tagLen = copy(playerNameTag, MAX_TAG_LENGTH - 1, g_pseudosTags[memberPosition])
        format(newPlayerName, charsmax(newPlayerName), "%s-%s", playerNameTag, newPlayerName)
      }
    }

    if(!equal(playerName, newPlayerName))
    {
      if(is_user_alive(id))
      {
        #if !defined NO_STEAM
        if(!g_iMsgSayText)
        {
          g_iMsgSayText = register_message(g_iMsgIdSayText, "msgSayText")
        }
        #endif

        set_user_info(id, "name", newPlayerName)
        if(g_playerName[id][0])
        {
          #if !defined NO_STEAM
          client_print_color(id, 0, _T("[AMX] ^"^3%s^1^" changed name to ^"^3%s^1^", then renamed to ^"^3%s^1^"."), g_playerName[id], playerName, newPlayerName)
          #else
          client_print(0, print_chat, _T("[AMX] ^"%s^" changed name to ^"%s^", then renamed to ^"%s^"."), g_playerName[id], playerName, newPlayerName)
          #endif
        }
        else
        {
          #if !defined NO_STEAM
          client_print_color(id, 0, _T("[AMX] ^"^3%s^1^" renamed to ^"^3%s^1^"."), playerName, newPlayerName)
          #else
          client_print(0, print_chat, _T("[AMX] ^"%s^" renamed to ^"%s^"."), playerName, newPlayerName)
          #endif
        }
        //client_print(0, print_chat, _T("[AMX] ^"%s^" renamed to ^"%s^"."), playerName, newPlayerName)
        copy(g_playerName[id], MAX_NAME_LENGTH - 1, newPlayerName)
      }
    }
    else
    {
      copy(g_playerName[id], MAX_NAME_LENGTH - 1, playerName)
    }
  }
  else
  {
    if(defaultMsg)
    {
      copy(g_convention[g_conventionLen], MAX_CONVENTION_LENGTH - g_conventionLen - 1, _T(message, id))
    }
    else
    {
      #if !defined NO_STEAM
      formatex(g_convention[g_conventionLen], MAX_CONVENTION_LENGTH - g_conventionLen - 1, "<b>%s</b>", message)
      #else
      copy(g_convention[g_conventionLen], MAX_CONVENTION_LENGTH - g_conventionLen - 1, message)
      #endif
    }

    if(!g_kickTaskCreated[id])
    {
      set_task(DELAY_BEFORE_KICK, "kickPlayer", TASKID_KICK+id)
      g_kickTaskCreated[id] = true
    }

    new titleName[32]
    get_pcvar_num(g_cvarConventionTitle, titleName, charsmax(titleName))

    show_motd(id, g_convention, (titleName[0] && titleName[0] != 0) ? titleName : g_defaultTitle)
  }
}

public kickPlayer(id)
{
  id -= TASKID_KICK
  if(g_kickTaskCreated[id])
  {
    new playerName[MAX_NAME_LENGTH], message[96]
    get_user_name(id, playerName, MAX_NAME_LENGTH - 1)
    client_print(0, print_chat, _T("[AMX] Player ^"%s^" disconnected due to his invalid name!"), playerName)
    client_cmd(id, _T("echo ^"[AMX] You name contains words or symbols forbidden on this server!^""))
    formatex(message, charsmax(message), _T("Your player name ^"%s^" doesn't match with the server rules!", id), playerName)
    #if !defined NO_STEAM
    server_cmd("kick #%d %s", get_user_userid(id), message)
    #else
    client_cmd(id, "echo ^"Kicked: %s^";disconnect", message)
    #endif
  }
}

#if !defined NO_STEAM
public msgSayText(/*const iMsgId, const iMsgDest, const id*/)
{
  new szArg[24]
  if(get_msg_arg_string(2, szArg, charsmax(szArg)) == 20 && equal(szArg, "#Cstrike_Name_Change"))
  {
    unregister_message(g_iMsgIdSayText, g_iMsgSayText)
    g_iMsgSayText = 0
    return PLUGIN_HANDLED
  }
  return PLUGIN_CONTINUE
}
#endif

public client_putinserver(id)
{
  g_playerName[id][0] = '^0'
  if(/*!is_user_bot(id) && */!is_user_hltv(id))
  {
    new playername[MAX_NAME_LENGTH]
    get_user_name(id, playername, MAX_NAME_LENGTH - 1)
    test_pseudo(id, playername)
  }
}

public client_infochanged(id)
{
  if(/*!is_user_bot(id) && */is_user_alive(id))
  {
    new playername[MAX_NAME_LENGTH], oldname[MAX_NAME_LENGTH]
    get_user_info(id, "name", playername, MAX_NAME_LENGTH - 1)
    get_user_name(id, oldname, MAX_NAME_LENGTH - 1)

    if(g_playerName[id][0] && !equal(oldname, playername) && !equal(playername, g_playerName[id]))
    {
      for(new i = 1; i < sizeof(g_playerName); i++)
      {
        if(id != i && g_playerName[i][0] && equali(oldname, g_playerName[i]))
        {
          set_user_info(id, "name", playername)
          return
        }
      }
      test_pseudo(id, playername)
    }
  }
}

public client_disconnect(id)
{
  g_playerName[id][0] = '^0'
  if(g_kickTaskCreated[id])
  {
    remove_task(TASKID_KICK+id)
    g_kickTaskCreated[id] = false
  }
}

public eResetHud(id)
{
  if(!g_playerName[id][0] && !is_user_bot(id))
  {
    new playername[MAX_NAME_LENGTH]
    get_user_name(id, playername, MAX_NAME_LENGTH - 1)
    if(!equal(playername, g_playerName[id]))
    {
      test_pseudo(id, playername)
    }
  }
}

check_tag(const authid[], const authidlen, const ip[], const iplen)
{
  for(new i = 0; i < g_pseudosAuthIdsIpsCount; i++)
  {
    if((authid[authidlen - 1] == g_pseudosAuthIdsIps[i][authidlen - 1] || ip[iplen - 1] == g_pseudosAuthIdsIps[i][iplen - 1])
    && (authid[authidlen - 3] == g_pseudosAuthIdsIps[i][authidlen - 3] || ip[iplen - 3] == g_pseudosAuthIdsIps[i][iplen - 3])
    && (equali(authid, g_pseudosAuthIdsIps[i]) || equali(ip, g_pseudosAuthIdsIps[i])))
    {
      return i
    }
  }
  return -1
}

light_contain(const mode, const cText)
{
  static i
  switch(mode)
  {
    case 0: // g_chars
    {
      for(i = 0; i < sizeof(g_chars); i++)
      {
        if(cText == g_chars[i])
        {
          return i
        }
      }
    }
    case 1: // g_numbers
    {
      for(i = 0; i < sizeof(g_numbers); i++)
      {
        if(cText == g_numbers[i])
        {
          return i
        }
      }
    }
    case 2: // g_vowels
    {
      for(i = 0; i < sizeof(g_vowels); i++)
      {
        if(cText == g_vowels[i])
        {
          return i
        }
      }
    }
  }
  return -1
}
Pourriez vous me donner un coup de main, s'il vous plait?

Merci d'avance ;)

Last edited by Toots; 06-04-2013 at 12:23.
Toots is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2013 , 12:33   Re: Plugin Convention des Pseudos
#2

Pourrais-tu attacher le fichier de langue également ?
__________________
Arkshine is offline
Toots
Member
Join Date: Mar 2007
Old 06-04-2013 , 12:42   Re: Plugin Convention des Pseudos
#3

Voilà ;)

"Pseudos"

fr:"Pseudos"



"<answer> - adds an answer to a words list (from number)"

fr:"<reponse> - ajoute une reponse a une liste de mots (depuis un nombre)"



"<word/sentence to check> <answer number> - adds a word/sentence to check"

fr:"<mot/phrase a analyser> <numero de reponse> - ajoute un(e) mot/phrase a analyser"



"- displays the rules about the players's names (MOTD)"

fr:"- affiche les regles a propos des noms de joueurs (MOTD)"



"Pseudos: Loaded %d SteamID%s/IP%s and tag%s (%s)."

fr:"Pseudos : chargement de %d SteamID%s/IP%s et tag%s (%s)."



"Pseudos: No SteamID/IP and tag loaded (%s)."

fr:"Pseudos : aucune SteamID/IP et tag charge (%s)."



"[AMX] Answer ^"%s^" added to the list."

fr:"[AMX] Reponse ^"%s^" ajoutee a la liste."



"[AMX] Unable to add an answer to the list, limit reached!"

fr:"[AMX] Impossible d'ajouter une reponse a la liste, limite atteinte !"



"[AMX] Usage: amx_pseudos_word <word/sentence to check> <answer number> - adds a word/sentence to check"

fr:"[AMX] Utilisation : amx_pseudos_word <mot/phrase a analyser> <numero de reponse> - ajoute un(e) mot/phrase a analyser"



"[AMX] Word/Sentence ^"%s^" (number: %d) added to the list."

fr:"[AMX] Mot/Phrase ^"%s^" (numero : %d) ajoute(e) a la liste."



"[AMX] Unable to add a word/sentence to the list, limit reached!"

fr:"[AMX] Impossible d'ajouter un(e) mot/phrase a la liste, limite atteinte !"



"<b>You requested to see it!</b>"

fr:"<b>Vous avez demandé à la voir !</b>"



"You requested to see it!"

fr:"Vous avez demandé à la voir !"



"<b>Forbidden character(s)</b>"

fr:"<b>Caractere(s) interdit(s)</b>"



"<b>Number of characters does not enough</b>"

fr:"<b>Nombre de caracteres insuffisant</b>"



"<b>Unpronounceable name</b>"

fr:"<b>Pseudo imprononcable</b>"



"[AMX] ^"^3%s^1^" changed name to ^"^3%s^1^", then renamed to ^"^3%s^1^"."

fr:"[AMX] ^"^3%s^1^" a change son nom en ^"^3%s^1^", puis renomme en ^"^3%s^1^"."



"[AMX] ^"%s^" changed name to ^"%s^", then renamed to ^"%s^"."

fr:"[AMX] ^"%s^" a change son nom en ^"%s^", puis renomme en ^"%s^"."



"[AMX] ^"^3%s^1^" renamed to ^"^3%s^1^"."

fr:"[AMX] ^"^3%s^1^" renomme en ^"^3%s^1^"."



"[AMX] ^"%s^" renamed to ^"%s^"."

fr:"[AMX] ^"%s^" renomme en ^"%s^"."



"[AMX] Player ^"%s^" disconnected due to his invalid name!"

fr:"[AMX] Joueur ^"%s^" deconnecte pour cause de pseudo incorrect !"



"echo ^"[AMX] You name contains words or symbols forbidden on this server!^""

fr:"echo ^"[AMX] Votre pseudo contient des mots ou symboles interdits sur ce serveur !^""



"Your player name ^"%s^" doesn't match with the server rules!"

fr:"Le nom de joueur ^"%s^" n'est pas conforme aux regles du serveur !"

[/QUOTE]
Toots is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2013 , 13:04   Re: Plugin Convention des Pseudos
#4

Désolé d'être chiant, mais pourrais-tu ATTACHER (et non COPIER-COLLER le contenu) ?

Si tu ne sais pas faire :

- Bouton Go Advanced
- Bouton Manager Attachments
- Tu choisis tes fichiers

C'est plus facile de récupérer un fichier plutôt que de faire du copier-coller. Aussi, ça pollue moins les messages.
__________________
Arkshine is offline
Toots
Member
Join Date: Mar 2007
Old 06-04-2013 , 13:38   Re: Plugin Convention des Pseudos
#5

Oups désolé pour la pollution.

voila.
Attached Files
File Type: txt pseudos.txt (2.7 KB, 162 views)
Toots is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2013 , 13:57   Re: Plugin Convention des Pseudos
#6

Je suis en train de convertir et d'améliorer parce que le code fait mal aux yeux. Je ne serais pas contre d'avoir les fichiers de configs également, histoire que si je teste, j'ai déjà ce qu'il faut sous la main.

EDIT : je ne t'oublie pas, juste que je n'étais pas très dispo, je suis toujours dessus, je finis ASAP.
__________________

Last edited by Arkshine; 06-07-2013 at 12:56.
Arkshine is offline
Toots
Member
Join Date: Mar 2007
Old 06-04-2013 , 14:34   Re: Plugin Convention des Pseudos
#7

Et voilà, merci beaucoup pour ton aide ;)
Attached Files
File Type: txt pseudos_convention.txt (1.6 KB, 210 views)
File Type: cfg pseudos_forbidden.cfg (4.0 KB, 217 views)
File Type: ini pseudos_users.ini (509 Bytes, 173 views)
Toots is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-11-2013 , 19:46   Re: Plugin Convention des Pseudos
#8

Désolé pour l'attente, j'ai plus ou moins fini, me reste quand même à relire/tester un ch'tit peu avant. J'ai un peu trainé les choses du fait que j'étais occupé sur d'autres choses et que j'ai fais diverses améliorations du code.

Question : est-ce qu'il y a sur ton serveur un plugin qui affiche la couleur dans le chat ? Le plugin utilise client_print_color() de base, et pour AMXX, il existe 2/3 versions ; donc si t'en as d'installé, je l'utiliserais ; si pas, je te donnerais un lien vers celui que je choisirais.
__________________
Arkshine is offline
Toots
Member
Join Date: Mar 2007
Old 06-12-2013 , 13:06   Re: Plugin Convention des Pseudos
#9

Pas de problème pour le délais Arkshine, c'est déjà sympa de t'en occupé. Pour le plugin de couleur, je n'ai rien installé de spécial. Il y a juste allchat qui utilise des couleurs mais je ne sais pas ce qu'il fait exactement avec les couleurs, si il les gère ou donne simplement la couleur à utiliser. Au niveau cvars, il y a ça pour ce plugin:
ac_namecolor 0
ac_msgcolor 0
//0 - Team color
//1 - Green
//2 - White
Toots is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-19-2013 , 05:48   Re: Plugin Convention des Pseudos
#10

Bon, tu peux essayer ça. Vraiment désolé pour le délai. C'est ce qui arrive quand on fait 36000 choses en parallèle, au final, on ne fait rien. Mais c'est de ma faute, j'ai voulu dépoussiéré, et ça a commeçé à prendre du temps, puis j'ai fais autre chose, etc.

Je ne suis pas entièrement satisfait, et il y a encore beaucoup d'améliorations qu'on pourrait faire. Mais c'est déjà mieux qu'avant. Pour débuter, c'est pas mal.

Voici déjà ce que j'ai changé :

- Les limites ( mots, réponses, utilisateurs ) ont été enlevées. Ca utilise un tableau dynamique maintenant, et tu peux en mettre autant que tu veux.
- J'ai rajouté 3 cvars pour remplacer les 3 defines : pseudos_min_required_chars, pseudos_min_required_vowels, pseudos_delay_before_kick.
- Le fichier de log spécifique a été remplacé par le fichier de log amxx commun (plus performant, et pour ce qui est affiché, pas vraiment besoin de log séparé).
- Le reste, c'est de l'optimisation en générale. Un code plus lisible, utilisation de forwards/natives plus appropriés, simplification par ci par là, code plus propre, etc.

L'intérêt c'est de ne plus éditer le plugin et le recompiler.

Tu auras besoin d'installer ce plugin : https://forums.alliedmods.net/showthread.php?t=94960 pour avoir la couleur.
Il te faut compiler avec l'include fournit (du lien).
Le pseudos.txt va dans data/lang/.

J'ai quand même testé avant, et ça a l'air ok.
Attached Files
File Type: sma Get Plugin or Get Source (pseudos.sma - 713 views - 23.9 KB)
File Type: txt pseudos.txt (3.5 KB, 237 views)
__________________

Last edited by Arkshine; 06-19-2013 at 14:15.
Arkshine 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 02:26.


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