AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Remove conflict between the plugins? (https://forums.alliedmods.net/showthread.php?t=272922)

CrazY. 10-09-2015 11:58

[HELP] Remove conflict between the plugins?
 
Hi , I have a little problem between two plugins , the bullet_damage this conflicting with the hudmessage the status of human/zombie , the hudmessage is disappearing from the screen , how to fix?

PHP Code:

/*    Copyright © 2009, ConnorMcLeod

    Bullet Damage 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 Bullet Damage; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>

#define PLUGIN "Bullet Damage"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define MAX_PLAYERS    32

new const Float:g_flCoords[][] = 
{
    {
0.500.40},
    {
0.560.44},
    {
0.600.50},
    {
0.560.56},
    {
0.500.60},
    {
0.440.56},
    {
0.400.50},
    {
0.440.44}
}

new 
g_iPlayerPos[MAX_PLAYERS+1]

new 
g_iMaxPlayers
new g_pCvarEnabled

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_pCvarEnabled register_cvar("bullet_damage""1")

    
register_event("Damage""Event_Damage""b""2>0""3=0")

    
g_iMaxPlayers get_maxplayers()
}

public 
Event_DamageiVictim )
{
    if( 
get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
    {
        new 
id get_user_attacker(iVictim)
        if( (
<= id <= g_iMaxPlayers) && is_user_connected(id) )
        {
            new 
iPos = ++g_iPlayerPos[id]
            if( 
iPos == sizeof(g_flCoords) )
            {
                
iPos g_iPlayerPos[id] = 0
            
}
            
set_hudmessage(02550Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 00.12.50.020.02, -1)
            
show_hudmessage(id"%d"read_data(2))
        }
    }



OciXCrom 10-09-2015 12:26

Re: [HELP] Remove conflict between the plugins?
 
I don't see the other code.

CrazY. 10-09-2015 12:48

Re: [HELP] Remove conflict between the plugins?
 
Sorry , my bad.
PHP Code:

// Show health, class and ammo packs
set_hudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0, -1)
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"* Zombie Plague *^n^n[ %L: %d ]^n[ %L %s ]^n[ %L %d ]^n[ Colete: %i ]^n[ Mortes: %d ]^n[ Frags: %i ]^n[ Velocidade: %d ]^n^n[ %s ]"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], get_user_armor(id), get_user_deaths(id), get_user_frags(id), fm_get_speed(id), mode_names[g_Mode]) 


Depresie 10-09-2015 13:23

Re: [HELP] Remove conflict between the plugins?
 
not sure buy try
Code:

set_hudmessage(0, 255, 0, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 1.0, 0.02, 0.02, -1)


Depresie 10-09-2015 13:30

Re: [HELP] Remove conflict between the plugins?
 
sorry for double post, if i edit the last message i will not be able to set the following code in a box

btw, try this one created by hattrick, i think it is better scripted
that lazy mofo always finds a way to write code in half the lines the others do


PHP Code:

#include < amxmodx >
#include < csx >

new const Floatg_flCoords[ ][ ] =
{
    { 
0.500.40 },
    { 
0.560.44 },
    { 
0.600.50 },
    { 
0.560.56 },
    { 
0.500.60 },
    { 
0.440.56 },
    { 
0.400.50 },
    { 
0.440.44 }
};

new 
g_iPosition33 ];
new 
g_iSize;

public 
plugin_init( )
{
    
register_plugin"Bullet Damage""1.0""Hattrick" );
    
    
g_iSize sizeofg_flCoords );
}

public 
client_damageiAttackeriVictimiDamage )
{
    if( ++
g_iPositioniAttacker ] == g_iSize )
        
g_iPositioniAttacker ] = 0;
    
    
set_hudmessage04080Floatg_flCoordsg_iPositioniAttacker ] ][ ], Floatg_flCoordsg_iPositioniAttacker ] ][ ], 00.11.00.020.02, -);
    
show_hudmessageiAttacker"%i"iDamage );



Later Edit:

I tried, doesn't work, i don't think it can be done

CrazY. 10-09-2015 13:37

Re: [HELP] Remove conflict between the plugins?
 
No problem for two posts.

Did not worked , the human/zombie stats even disappears.

Depresie 10-09-2015 13:53

Re: [HELP] Remove conflict between the plugins?
 
i edited the last post, i don't think it can be done

CrazY. 10-10-2015 13:48

Re: [HELP] Remove conflict between the plugins?
 
The error is in the channel , did a test with the following code:

PHP Code:

set_hudmessage(02550Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 00.11.00.020.02

the stats not disappear , but the hudmessage of bullet damage is modified. No another method to fix this?

Depresie 10-10-2015 13:54

Re: [HELP] Remove conflict between the plugins?
 
nope, because there are only 4 hud messages available for hud messages, a random one is already taken by zp hud... when the bullet damage display 4 messages all channels are busy, and the channel of zp hud is replaced

CrazY. 10-10-2015 13:58

Re: [HELP] Remove conflict between the plugins?
 
And what is ShowSyncHudMsg?

PHP Code:

ShowSyncHudMsgiAttacker"%i"iDamage ); 



All times are GMT -4. The time now is 22:14.

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