Raised This Month: $ Target: $400
 0% 

plugin bug (modify)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nemesiscfg
New Member
Join Date: Feb 2020
Old 02-27-2020 , 11:24   plugin bug (modify)
Reply With Quote #1

hi. i have this plugin and when its hs only on (amx_hsonly 1) you can hit and kill players only with hs, but sometimes some players can hit and kill their enemy with no hs.. i don't know why, the plugin don't shows any warnings or errors on compile.
HTML Code:
#include <amxmodx>
#include <fun>
#include <csdm>

#define TASKID 127546

static None[]="";

new bool:bEnabled;

public aim_prac(id)
{
    if (id && !((get_user_flags(id) & ADMIN_CVAR)))
    {
        client_print(id, print_console, "[Indungi] Nu ai acces la aceasta comanda.")
        return PLUGIN_CONTINUE
    }
    new arg[8]
    read_argv(1, arg, 7)
    if(equal(arg, None))
    {
        client_print(id, print_console, "amx_hsonly <on/off>");
        return PLUGIN_HANDLED;
    }
    if((equali(arg, "on"))||(equali(arg, "1")))
    {
        set_user_hitzones(0 ,0, 2)
        client_print(id, print_console, "[Indungi] Modul HS Only a fost activat.")
        new name[32]
        get_user_name(id,name,charsmax(name))
        colorchat_CC( 0, "!E[Indungi]!N Modul!V HS Only!N a fost activat de catre!V %s!N.", name)
        set_hudmessage(0, 100, 0, 0.02, 0.18, _, _, 1.0, _, _, 1)
        show_hudmessage (0, "HS ONLY: ON");
        bEnabled = true;
    }
    else
    {
        set_user_hitzones(0, 0, 255)
        client_print(id, print_console, "[Indungi] Modul HS Only a fost dezactivat.")
        new name[32]
        get_user_name(id,name,charsmax(name))
        colorchat_CC( 0, "!E[Indungi]!N Modul!V HS Only!N a fost dezactivat de catre!V %s!N.", name)
        set_hudmessage(0, 90, 0, 0.02, 0.18, _, _, 1.0, _, _, 1)
        show_hudmessage (0, "HS ONLY: OFF");
        bEnabled = false;
    }
    return PLUGIN_HANDLED
}

public plugin_init()
{
    register_plugin("Aim Practice","1.0","James Romeril")
    register_concmd("amx_hsonly", "aim_prac", ADMIN_CVAR, "")
    
    set_task(1.0, "ShowHudMessage", TASKID, _, _, "b");
}

public ShowHudMessage()
{
    new iPlayers[32], iNum;
    get_players(iPlayers, iNum, "ch");
    
    if(iNum > 0)
    {
        bEnabled ? set_hudmessage(0, 128, 0, 0.02, 0.25, _, _, 1.0, _, _, 1) : set_hudmessage(255, 0, 0, 0.02, 0.25, _, _, 1.0, _, _, 1);
		
            
        for(new i; i < iNum; i++)
        {
            show_hudmessage(iPlayers[i], "HS Only: %s", bEnabled ? "ON" : "OFF");
        }
    }
}

stock colorchat_CC(const id, const input[], any:...)
{
    new count = 1, Jucatori[32]
    static msg[191]
    vformat(msg, 190, input, 3)
    
    replace_all(msg, 190, "!V", "^4") // Culoarea Verde
    replace_all(msg, 190, "!N", "^1") // Culoarea Normala a Chat-ului (galben)
    replace_all(msg, 190, "!E", "^3") // Culoarea Echipei : CT = Albastru | T = Rosu.
    
    if (id) Jucatori[0] = id; else get_players(Jucatori, count, "ch")
    {
        for (new Y = 0; Y < count; Y++)
        {
            if (is_user_connected(Jucatori[Y]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Jucatori[Y])
                write_byte(Jucatori[Y]);
                write_string(msg);
                message_end();
            }
        }
    }
}
nemesiscfg is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-27-2020 , 13:33   Re: plugin bug (modify)
Reply With Quote #2

Because it only changes the hitzones for players that are currently connected, ignoring everyone that joins the game after the command has been used.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nemesiscfg
New Member
Join Date: Feb 2020
Old 02-27-2020 , 15:19   Re: plugin bug (modify)
Reply With Quote #3

and you can write some code to resolve the problem?
nemesiscfg 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 23:55.


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