Raised This Month: $23 Target: $400
 5% 

[help] this plugins doesnt works very well


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
afyfv
Junior Member
Join Date: Oct 2014
Old 08-10-2015 , 02:54   [help] this plugins doesnt works very well
Reply With Quote #1

Hello guys today i was trying to compile the following code

Code:
#include <amxmodx>

#define VERSION "1.0"
#define PLUGIN "Engine MsG Replace"

new Trie:g_tReplacements

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
    register_message(get_user_msgid("TextMsg"), "Message_TextMsg")

    g_tReplacements = TrieCreate()
    TrieSetString(g_tReplacements, "#Bomb_Planted",            "The Bomb Has Been Planted")
    TrieSetString(g_tReplacements, "#CTs_Win",                    "Counter-Terrorists Win!")
    TrieSetString(g_tReplacements, "#Terrorists_Win",            "Terrorists Win!")
    TrieSetString(g_tReplacements, "#Round_Draw",                "Round Draw!")
    TrieSetString(g_tReplacements, "#Target_Bombed",           "Target Successfully Bombed!")
    TrieSetString(g_tReplacements, "#Defusing_Bomb_With_Defuse_Kit",           "Defusing bomb WITH Defuse kit.")
    TrieSetString(g_tReplacements, "#Defusing_Bomb_Without_Defuse_Kit",           "Defusing bomb WITHOUT Defuse kit.")
    TrieSetString(g_tReplacements, "#Bomb_Defused",           "The bomb has been defused!.")
    TrieSetString(g_tReplacements, "#Auto_Team_Balance_Next_Round",           "*** Auto-Team Balance next round ***")
}

public Message_TextMsg(iMsgId, iMsgDest, id)
{
    if( !id && get_msg_arg_int(1) == print_center )
    {
        new szMessage[64]
        get_msg_arg_string(2, szMessage, charsmax(szMessage))
        if( equal(szMessage, "#Game_will_restart_in") )
        {
            new szArg1[4]
            get_msg_arg_string(3, szArg1, charsmax(szArg1))
            formatex(szMessage, charsmax(szMessage), "The game will restart in %s seconds", szArg1)
            set_hudmessage(random(256), random(256), random(256), .channel=-1)
            show_hudmessage(0, szMessage)
            return PLUGIN_HANDLED
        }
        else if( TrieGetString(g_tReplacements, szMessage, szMessage, charsmax(szMessage)) )
        {
            set_hudmessage(random(256), random(256), random(256), .channel=-1)
            show_hudmessage(0, szMessage)
            return PLUGIN_HANDLED
        }
    }
    return PLUGIN_CONTINUE
}
PD: the code isnt mine

i can compile it and even run but the hud looks like this (TOO SMALL)

http://i.imgur.com/lQy8vSf.jpg

http://i.imgur.com/VXCV5U0.jpg

when the hud should looks like this size or kinda

http://i.imgur.com/4yjGwvv.png

please help ive tried to compile so many times even online and the size still soo small
afyfv is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 08-10-2015 , 03:17   Re: [help] this plugins doesnt works very well
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <dhdhmessage>

#define VERSION "1.0"
#define PLUGIN "Engine MsG Replace"

new Trie:g_tReplacements

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")

    
g_tReplacements TrieCreate()
    
TrieSetString(g_tReplacements"#Bomb_Planted",            "The Bomb Has Been Planted")
    
TrieSetString(g_tReplacements"#CTs_Win",                    "Counter-Terrorists Win!")
    
TrieSetString(g_tReplacements"#Terrorists_Win",            "Terrorists Win!")
    
TrieSetString(g_tReplacements"#Round_Draw",                "Round Draw!")
    
TrieSetString(g_tReplacements"#Target_Bombed",           "Target Successfully Bombed!")
    
TrieSetString(g_tReplacements"#Defusing_Bomb_With_Defuse_Kit",           "Defusing bomb WITH Defuse kit.")
    
TrieSetString(g_tReplacements"#Defusing_Bomb_Without_Defuse_Kit",           "Defusing bomb WITHOUT Defuse kit.")
    
TrieSetString(g_tReplacements"#Bomb_Defused",           "The bomb has been defused!.")
    
TrieSetString(g_tReplacements"#Auto_Team_Balance_Next_Round",           "*** Auto-Team Balance next round ***")
}

public 
Message_TextMsg(iMsgIdiMsgDestid)
{
    if( !
id && get_msg_arg_int(1) == print_center )
    {
        new 
szMessage[64]
        
get_msg_arg_string(2szMessagecharsmax(szMessage))
        if( 
equal(szMessage"#Game_will_restart_in") )
        {
            new 
szArg1[4]
            
get_msg_arg_string(3szArg1charsmax(szArg1))
            
formatex(szMessagecharsmax(szMessage), "The game will restart in %s seconds"szArg1)
            
set_dhudmessage(random(256), random(256), random(256), -1.00.20)
            
show_dhudmessage(0szMessage)
            return 
PLUGIN_HANDLED
        
}
        else if( 
TrieGetString(g_tReplacementsszMessageszMessagecharsmax(szMessage)) )
        {
            
set_dhudmessage(random(256), random(256), random(256), -1.00.20)
            
show_dhudmessage(0szMessage)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

For compiling this you will need this inc Link
__________________
All my work is here

Last edited by xxxperts; 08-11-2015 at 04:05. Reason: Updated the Code on thread's owner request
xxxperts is offline
afyfv
Junior Member
Join Date: Oct 2014
Old 08-10-2015 , 19:55   Re: [help] this plugins doesnt works very well
Reply With Quote #3

Quote:
Originally Posted by xxxperts View Post
PHP Code:
#include <amxmodx>
#include <dhdhmessage>

#define VERSION "1.0"
#define PLUGIN "Engine MsG Replace"

new Trie:g_tReplacements

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")

    
g_tReplacements TrieCreate()
    
TrieSetString(g_tReplacements"#Bomb_Planted",            "The Bomb Has Been Planted")
    
TrieSetString(g_tReplacements"#CTs_Win",                    "Counter-Terrorists Win!")
    
TrieSetString(g_tReplacements"#Terrorists_Win",            "Terrorists Win!")
    
TrieSetString(g_tReplacements"#Round_Draw",                "Round Draw!")
    
TrieSetString(g_tReplacements"#Target_Bombed",           "Target Successfully Bombed!")
    
TrieSetString(g_tReplacements"#Defusing_Bomb_With_Defuse_Kit",           "Defusing bomb WITH Defuse kit.")
    
TrieSetString(g_tReplacements"#Defusing_Bomb_Without_Defuse_Kit",           "Defusing bomb WITHOUT Defuse kit.")
    
TrieSetString(g_tReplacements"#Bomb_Defused",           "The bomb has been defused!.")
    
TrieSetString(g_tReplacements"#Auto_Team_Balance_Next_Round",           "*** Auto-Team Balance next round ***")
}

public 
Message_TextMsg(iMsgIdiMsgDestid)
{
    if( !
id && get_msg_arg_int(1) == print_center )
    {
        new 
szMessage[64]
        
get_msg_arg_string(2szMessagecharsmax(szMessage))
        if( 
equal(szMessage"#Game_will_restart_in") )
        {
            new 
szArg1[4]
            
get_msg_arg_string(3szArg1charsmax(szArg1))
            
formatex(szMessagecharsmax(szMessage), "The game will restart in %s seconds"szArg1)
            
set_dhudmessage(random(256), random(256), random(256))
            
show_dhudmessage(0szMessage)
            return 
PLUGIN_HANDLED
        
}
        else if( 
TrieGetString(g_tReplacementsszMessageszMessagecharsmax(szMessage)) )
        {
            
set_dhudmessage(random(256), random(256), random(256))
            
show_dhudmessage(0szMessage)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

For compiling this you will need this inc Link
thank you, works perfectly but the hud isnt in the correct position look

http://i.imgur.com/vz0dlil.jpg ( THIS IS MY CAPTURE FROM MY SERVER )

this is the correct position (how it should be)

http://i.imgur.com/gjjLYBT.png
http://i.imgur.com/qsPpGWa.png

i really would like if you could help me out with this thanks in advance.
afyfv is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 08-11-2015 , 04:05   Re: [help] this plugins doesnt works very well
Reply With Quote #4

UPDATED the Code Please check now.
__________________
All my work is here
xxxperts is offline
Reply


Thread Tools
Display Modes

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 19:26.


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