This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Ultimate Break Message v1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-16-2024 , 21:00   Re: Ultimate Break Message v1.1
Reply With Quote #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
__________________
bigdaddy424 is offline
Reply



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


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