hud message problem !! help plesae
i m starting to develope plugins and as a first step i m doin a very basic plugin which just prints a message to a client just like welcome message..but it doesnt disply..pls help..here;s the code
#include <amxmodx> //Declare three string variables new PLUGIN[]="dfdfdf" new AUTHOR[]="dfdfddfdn" new VERSION[]="1.00" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) for (new i = 1; i <= get_maxplayers(); i++) { if (is_user_alive(i) && is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i)) { client_cmd(i,"echo ur health is critical...") } } } pls help... |
Re: hud message problem !! help plesae
You could do like this =)
PHP Code:
|
Re: hud message problem !! help plesae
Quote:
Code:
Your code could be simple as this: Code:
Try adding something to the script. get_user_name ( index, name[], len ) for example. :wink: |
Re: hud message problem !! help plesae
They likely won't see it on connect. I would either use putinserver or use putinserver and a task.
PHP Code:
PHP Code:
|
Re: hud message problem !! help plesae
Thank u all for u responses...i have learnt that certain functions like welcome_message is executed when a new player enters teh game etc...So i have anothre great problem..I want some data to be monitored in real time just like health etc , and as it changes it has to measure the variation and accordingly handle data...here i face two problems..take a sample plugin..suppose i want to monitor health and if it comes below 25 i wanna warn that guy (only him) that his health is critical..here i want the health of all the guys to be checked whether it is less than 25 throughout the game and if it is less than 25 , i need it to print it as a hud message which prints on the center of the screen such as that of round nos. etc...I already tried
PHP Code:
And about the present suggestions i ll try it out and give u the feedback...Thanks a lot for takin time to answer my queries... |
Re: hud message problem !! help plesae
This will show a HUD msg when players health drops below 25. The HUD will not remain on screen, it will show the HUD at each damage that results in health being below 25.
PHP Code:
|
Re: hud message problem !! help plesae
register_event( "Health" , "fw_Health" , "be" ); how does it work..???what's be what's health...fw_health is understood as the function...pls explain...
|
Re: hud message problem !! help plesae
and pls explain the whole program..and also i have a major doubt...does this function fw_Health get executed only once when teh plugin initialises or does it execute each second bcoz it has to monitor the health..and if it monitors constantly how ??u havent given any command for the function to be repeated...and also gimme a general clarification..when we do functions like these how to repeatedlly initialise functions that monitor variable parameters like health..
|
Re: hud message problem !! help plesae
Quote:
P.S Why use [php][/php] tags when you can use [small][/small] tags? |
Re: hud message problem !! help plesae
Quote:
register_event Half-Life Game Events Events are fired in the game when particular things occur. The "Health" event is what the game uses when it wants to update your health on the screen. The register_event() function "hooks" the Health event and will call the fw_Health() function every time it is fired by the HL game engine. This will allow you to take action any time the health value for a player changes without the need to do any type of looping to constantly check the value. The "b" flag specifies the event is called on a single player and the "e" flag requires the player to be alive. If you look at the register_event() function link above, there is an example towards the bottom of the page that shows how to hook the DeathMsg event; this allows you retrieve the killer, victim, if headshot, and weapon-used [via read_data()] when a death occurs. PHP Code:
|
| All times are GMT -4. The time now is 14:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.