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

How to make HUD On player when we put mouse on him.


Post New Thread Reply   
 
Thread Tools Display Modes
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 05-28-2019 , 15:30   Re: How to make HUD On player when we put mouse on him.
Reply With Quote #21

Quote:
Originally Posted by OciXCrom View Post
You need to use a task if you want the message to show all the time.

In the "StatusValue" event store the targeted player in a global variable.
- if read_data(1) == 1, reset the targeted player to 0.
- if read_data(1) == 2, store the player index from read_data(2).

Assign a repeating task when the client connects or a global one in plugin_init and show the message only if the player has a stored target (target != 0).
so what to do is to make new native for read data and assaign it to player index
then idk only one thing what is read_data do? and how to assign it with player index>?
can you give toturial ?

Last edited by husam124; 05-28-2019 at 15:31.
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
thEsp
BANNED
Join Date: Aug 2017
Old 05-28-2019 , 16:07   Re: How to make HUD On player when we put mouse on him.
Reply With Quote #22

It reads data from an event or message, say someone dies and to catch the victim (via DeathMsg) you need to read the integer or string or whatever the case is.
More information can be retrieved from https://wiki.alliedmods.net/Half-life_1_game_events
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-29-2019 , 13:31   Re: How to make HUD On player when we put mouse on him.
Reply With Quote #23

Quote:
Originally Posted by husam124 View Post
but how to turn off game hud info its like their is exist player stats info how to turn it off.?
If you mean disabling the default HUD from the game, simply use "return PLUGIN_HANDLED" in the end of the "StatusValue" function, like I already mentioned.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 06-03-2019 , 15:58   Re: How to make HUD On player when we put mouse on him.
Reply With Quote #24

from plugin :
Quote:
#define PLUGIN "Severian's Mod AMXX"
#define VERSION "1.35"
#define AUTHOR "LetiLetiLepestok"
PHP Code:
new g_HudSyncObj

public plugin_init() {
    
    
register_message(get_user_msgid("StatusValue")    , "msg_StatusValue")
    
g_HudSyncObj CreateHudSyncObj()
}

public 
msg_StatusValue(iMsgIDiDestiClient)
{
    if(!
get_pcvar_num(g_pcvar_status_style))
        return 
PLUGIN_CONTINUE
    
    
if(get_pcvar_num(g_pcvar_status_style) == && !is_user_admin(iClient))
        return 
PLUGIN_HANDLED
    
    
static valuestatus[2]
        
    
value get_msg_arg_int(2)
 
    if(
value && get_msg_arg_int(1) == 1)
    {
        
status[0] = iClient
        status
[1] = value
        show_status
(status)
    }
    return 
PLUGIN_HANDLED
}




public 
show_status(status[])
{
    const     
Float:= -1.0
    
const     Float:0.55
    
    
const     180
    
const     180
    
const     255
    
    
new     id
    
new     body
    
new     name[32]
    new    
model[32]
    
    
get_user_name(status[1], name31)
    
get_user_info(status[1], "model"model31)

    
get_user_aiming(status[0], idbody)
    
    if(
id != status[1])
        return
    
    
set_hudmessage(rgbxy00.00.80.10.5, -1)
    
ShowSyncHudMsg(status[0], g_HudSyncObj"%s^n(%s)"namemodel)
    
set_task(1.5 "show_status" status[0] + 4090 status 3)

__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
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 01:56.


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