AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Ultimate Break Message v1.1 (https://forums.alliedmods.net/showthread.php?t=347249)

CT_Spawn 04-14-2024 12:10

Ultimate Break Message v1.1
 
3 Attachment(s)
Ultimate Break Message v1.1

Description:
  • This plugin is inspired by Raheem. This plugin will print a message in the chat if the player breaks anything on the map. The print is done and appears only to the admin or even to all players depending on the options in the cvar. This may be useful in some cases for administrators to find out who is violating the rules. This program is also useful in zombie escape servers.
  • The new thing here is that previous plugins did not show the player break messages that occur by throwing grenades.
  • also ,The name of the thing that broke appears, and this is based on a data base that you will fill out during the game, and the player’s team appears


    Quote:

    [human] Player1 has broken a bridge
    [zombie] Fullserver has broken a wood bridge

Cvars:
  • ct_break_message_type 1 0 = Disabled | 1 = Admins only see | 2 =All player see
  • ct_break_message_show_hint 0 0 = disable | 1 = show on all admins | 2 dont show hint beakable entity for all admin only by command say /brshow <on|off>
Commands Usage:

amx_cvar ct_break_message_show_hint 1 for show hint of all entity
amx_cvar ct_break_message_show_hint 2 for show hint of all entity by say /brshow on command

say /brshow on for show breakable entity info
say /brshow off for disable show breakable entity info

say /brmsg 28 "a bridge" for set name of entity
say /brmsg 28 off for delete name of entity

Installation & Instructions:
  • Let's start learning how to install this plugin, So let's first start with what is the Requirements for this plugin?
    Simply install it like any plugin.
  1. Latest AMX Mod X 1.9+:
    • for this plugins work you need AMX Mod X 1.9 or up , not using v1.8.2
  2. Add Print Center Fix Module(optional):
    • if center message not work u will do . First download Print Center Fix 2022-01-06, move the files into this folder, here addons\amxmodx\dlls
    • and go here addons\metamod\plugins.ini , and add this line in windows server in the end of file :
      Code:

      win32  addons\amxmodx\dlls\printcenterfix_mm.dll
    • or add this line in linux server in the end of file :
      Code:

      linux addons/amxmodx/dlls/printcenterfix_mm_i386.so
  3. plugin Installation:
    • (Same as when you install plugin compile ".sma" and copy ".amxx" file form complied folder to plugins folder and go to plugins.ini and write it's name, also you need to define the module to run).
Changelog:
Spoiler

Screenshots:


mlibre 04-14-2024 14:07

Re: Ultimate Break Message v1.1
 
adds a "changelog" from previous versions, what's new or removed, added...

CT_Spawn 04-14-2024 19:36

Re: Ultimate Break Message v1.1
 
Quote:

Originally Posted by mlibre (Post 2820956)
adds a "changelog" from previous versions, what's new or removed, added...

Done ��

bigdaddy424 04-16-2024 21:00

Re: Ultimate Break Message v1.1
 
great idea, although your works lacks readability because its in someway hardcoded
  • use charsmax
  • put `get_mapname` in `plugin_init`, map name will never change
  • extensive use of `dir_exists` and `mkdir`, just create one directory on /configs and use `file_exists` pointing directly to end file and use a proper name on naming directory, dont promote your name. eg:configs/map_breakables/mapname.json should be just fine i suppose
  • `is_user_connected` is pointless
  • `entity_get_edict` doest return -1 but 0 read:https://www.amxmodx.org/api/engine/entity_get_edict
    `entity_get_edict2` returns -1 read:https://www.amxmodx.org/api/engine/entity_get_edict2
    _edict2 is recommended from devs being 'safer'
  • extensive use of `get_user_team` if/else statements, do this instead if you want to put a team name
    PHP Code:

    new const Teams[][] =
    {
        
    "UNASSIGNED",
        
    "Terrorist",
        
    "Counter-Terrorist",
        
    "Spectator"
    }
    server_print "Team %s"Teams[get_user_team(id)] 

  • or use maching team color on their name, its self explanatory and makes this plugin great for other gamemodes eg: `client_print_color(id, id, "^3%n ^1broke a structure", id)`
  • since youre dropping support for lower versions use `bind_pcvar_num` combined with `create_cvar`
  • reconstruct `ct_enitityname`
    PHP Code:

    public ct_enitityname(entity_name[], output[], len)
    {
        new 
    cells_written json_object_get_string(datajsonentity_nameoutputlen)
        if (!
    cells_written)
            
    copy(outputlen"a structure")


  • i would totally remove `send_to_admins` and send it to everyone, but id recommend having a cvar to toggle between sending the break entity message to your teammates & spectators or to everybody


All times are GMT -4. The time now is 04:18.

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