Raised This Month: $51 Target: $400
 12% 

Solved Hud problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 06-02-2023 , 13:44   Hud problem
Reply With Quote #1

Hello, friends, I have a problem with the server jailbreak. Mainly, on the new HUD that I added, it shows me one amount of money, while on the other one, it shows a different amount. I really don't know why this is happening, and I hope someone can help me. I will leave both scripts so that anyone who can help, please do.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <basebuilder>
#include <dhudmessage>

#define PLUGIN "ShowHud"
#define VERSION "1.0"
#define AUTHOR "furia"

#define HUDID 10004

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
}

public 
client_putinserver(id)
{
    
set_task(2.0"ShowHud"id HUDID);
}

#if AMXX_VERSION_NUM < 190
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
    
remove_task(id HUDID);
}

public 
ShowHud(id)
{
    
id -= HUDID;
    
    if(
is_user_alive(id))
    {
        
// Shouldn't be saved, but better for readability.
        
new iMoney cs_get_user_money(id);

        
set_dhudmessage(0255255, -1.01.000.01.0)
        
show_dhudmessage(id"| Money: %i |",iMoney);
        
        
    }
    
set_task(1.0"ShowHud"id HUDID);


Last edited by Uzviseni Bog; 06-20-2023 at 11:20.
Uzviseni Bog is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 06-03-2023 , 03:00   Re: Hud money problem
Reply With Quote #2

try this one

Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 183     #include <dhudmessage>     #define client_disconnected client_disconnect     #define MAX_PLAYERS 32 #endif #define PLUGIN "ShowHud" #define VERSION "1.0" #define AUTHOR "furia" static const HUDID = 10004 native jbe_get_user_money(id); public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR); } public client_putinserver(id) {     if(!is_user_bot(id) && !is_user_hltv(id))     {         set_task(1.0, "ShowHud", id + HUDID, .flags = "b");     } } public client_disconnected(id) {     if(task_exists(id + HUDID))     {         remove_task(id + HUDID);     } } public ShowHud(id) {     id -= HUDID;         if(is_user_alive(id))     {         set_dhudmessage(0, 255, 255, -1.0, 1.0, 0, 0.0, 1.0)         show_dhudmessage(id, "| Money: %i |", jbe_get_user_money(id));     } }

Last edited by lexzor; 06-03-2023 at 07:09.
lexzor is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 06-03-2023 , 04:51   Re: Hud money problem
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
try this one

Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 183     #include <dhudmessage>     #define client_disconnect client_disconnected     #define MAX_PLAYERS 32 #endif #define PLUGIN "ShowHud" #define VERSION "1.0" #define AUTHOR "furia" static const HUDID = 10004 new g_iHUDMoney[MAX_PLAYERS + 1] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_message(get_user_msgid("Money"), "OnMessageMoney") } public OnMessageMoney(msgid, dest, id) {     g_iHUDMoney[id] = get_msg_arg_int(0) } public client_putinserver(id) {     if(!is_user_bot(id) && !is_user_hltv(id))     {         g_iHUDMoney[id] = 0         set_task(1.0, "ShowHud", id + HUDID);     } } public client_disconnect(id) {     if(task_exists(id + HUDID))     {         remove_task(id + HUDID);     } } public ShowHud(id) {     id -= HUDID;         if(is_user_alive(id))     {         set_dhudmessage(0, 255, 255, -1.0, 1.0, 0, 0.0, 1.0)         show_dhudmessage(id, "| Money: %i |", g_iHUDMoney[id]);     } }
Unfortunately, it's not working; it's not displaying anything on the screen
Uzviseni Bog is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 06-03-2023 , 05:09   Re: Hud money problem
Reply With Quote #4

Quote:
Originally Posted by Uzviseni Bog View Post
Unfortunately, it's not working; it's not displaying anything on the screen
i updated and tested the code. is working now.
lexzor is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 06-03-2023 , 06:52   Re: Hud money problem
Reply With Quote #5

Quote:
Originally Posted by lexzor View Post
i updated and tested the code. is working now.

Right now it displays the message and its amount, but that amount is not equal to this other one. I also included the JB script, so you can check there how that expression is defined. I couldn't find it myself.
Uzviseni Bog is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 06-03-2023 , 07:07   Re: Hud money problem
Reply With Quote #6

Quote:
Originally Posted by Uzviseni Bog View Post
Right now it displays the message and its amount, but that amount is not equal to this other one. I also included the JB script, so you can check there how that expression is defined. I couldn't find it myself.
changed again

Last edited by lexzor; 06-03-2023 at 07:15.
lexzor is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 06-03-2023 , 09:27   Re: Hud money problem
Reply With Quote #7

Thanks bro working
Uzviseni Bog is offline
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 06-03-2023 , 13:31   Re: Hud money problem
Reply With Quote #8

Quote:
Originally Posted by Uzviseni Bog View Post
Thanks bro working
i think JBE Mode has the hud already :/
QuickDroLLL is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 06-03-2023 , 14:35   Re: Hud money problem
Reply With Quote #9

Quote:
Originally Posted by QuickDroLLL View Post
i think JBE Mode has the hud already :/
There is, but I don't want everything to be in one place or one below the other.
Uzviseni Bog is offline
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 06-03-2023 , 19:12   Re: Hud money problem
Reply With Quote #10

Quote:
Originally Posted by Uzviseni Bog View Post
There is, but I don't want everything to be in one place or one below the other.
yeah its your mode and its your call do any thing you want i just give you an idea
QuickDroLLL 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:46.


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