Raised This Month: $ Target: $400
 0% 

If player dead show him a hud message about the player info of he looking.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-18-2010 , 05:59   If player dead show him a hud message about the player info of he looking.
Reply With Quote #1

Check if the player still alive, if yes then hide the hud message and if dead, show the hud messgae.
I try to use is_user_alive, but I don`t know what I should put in {}.
Secondly, my intention is to show the player info who the dead player looking, but now this code is show the info about myself.
Can someone help me with this two question?
Code:
public DHM(id)
{
//	if (is_user_alive(id))
//	{
//		
//	}
	for (new id = 1; id <= SzMaxPlayers; id++)
		{
			new SzHostname[64], SzTimer[32] // Get Hostname & Time
			get_cvar_string("Hostname",SzHostname,63) // Get Hostname
			get_time("%Y/%m/%d - %H:%M:%S", SzTimer,31) // Get Time
			new SzNextMap[32]
			get_cvar_string("amx_nextmap", SzNextMap, 31) 
			new SzTimeLeft = get_timeleft()

			new SzName[128] // Get Player Name
			get_user_name(id, SzName, 127) // Get Player Name

			new SzAuthID[32] // Get STEAMID
			get_user_authid(id, SzAuthID, 32) // Get STEAMID

			new SzScores = (get_user_frags(id) - get_user_deaths(id)) // Get Player Scores

			new SzIP[16] // Get Player IP
			static SzCountry[32] // Get Player Country
			get_user_ip(id, SzIP, 15, 1) // Get Player IP
			geoip_country(SzIP, SzCountry, 45) // Get Player Country By Using The IP

			new SzPing, SzLoss // Get Player Ping
			get_user_ping(id, SzPing, SzLoss) // Get Player Ping

			set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), 0.05, 0.60, 0, 1.0, 1.0, 0.1, 0.2, -1) 
			ShowSyncHudMsg(id, hudsync, "%s ^n Nextmap: %s ^n Timeleft: %d:%02d ^n Time: %s ^n Player Name: %s ^n SteamID: %s ^n Score: %d ^n Country: %s", SzHostname, SzNextMap, SzTimeLeft / 60, SzTimeLeft % 60, SzTimer, SzName, SzAuthID, SzScores, SzCountry) 
		}
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others

Last edited by GarbageBox; 08-18-2010 at 06:02.
GarbageBox is offline
vL.
Senior Member
Join Date: Aug 2009
Location: Estonia
Old 08-18-2010 , 06:40   Re: If player dead show him a hud message about the player info of he looking.
Reply With Quote #2

Maby

PHP Code:
public DHM(id)
{
    if(!
is_user_alive(id))    
    {
        for (new 
id 1id <= SzMaxPlayersid++)
        {
            new 
SzHostname[64], SzTimer[32// Get Hostname & Time
            
get_cvar_string("Hostname",SzHostname,63// Get Hostname
            
get_time("%Y/%m/%d - %H:%M:%S"SzTimer,31// Get Time
            
new SzNextMap[32]
            
get_cvar_string("amx_nextmap"SzNextMap31)
            new 
SzTimeLeft get_timeleft()
            
            new 
SzName[128// Get Player Name
            
get_user_name(idSzName127// Get Player Name
            
            
new SzAuthID[32// Get STEAMID
            
get_user_authid(idSzAuthID32// Get STEAMID
            
            
new SzScores = (get_user_frags(id) - get_user_deaths(id)) // Get Player Scores
            
            
new SzIP[16// Get Player IP
            
static SzCountry[32// Get Player Country
            
get_user_ip(idSzIP151// Get Player IP
            
geoip_country(SzIPSzCountry45// Get Player Country By Using The IP
            
            
new SzPingSzLoss // Get Player Ping
            
get_user_ping(idSzPingSzLoss// Get Player Ping
            
            
set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), 0.050.6001.01.00.10.2, -1)
            
ShowSyncHudMsg(idhudsync"%s ^n Nextmap: %s ^n Timeleft: %d:%02d ^n Time: %s ^n Player Name: %s ^n SteamID: %s ^n Score: %d ^n Country: %s"SzHostnameSzNextMapSzTimeLeft 60SzTimeLeft 60SzTimerSzNameSzAuthIDSzScoresSzCountry)
        }
    }

vL. is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-18-2010 , 07:10   Re: If player dead show him a hud message about the player info of he looking.
Reply With Quote #3

Tried, nothing change with it...
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
fireattack
Senior Member
Join Date: Jul 2008
Old 08-18-2010 , 08:39   Re: If player dead show him a hud message about the player info of he looking.
Reply With Quote #4

PHP Code:
 
public DHM(id)
{
 if(!
is_user_alive(id))    
  return 
FMRES_IGNORED
  
 
for (new id 1id <= SzMaxPlayersid++)
 {
  new 
SzHostname[64], SzTimer[32// Get Hostname & Time
  
get_cvar_string("Hostname",SzHostname,63// Get Hostname
  
get_time("%Y/%m/%d - %H:%M:%S"SzTimer,31// Get Time
  
new SzNextMap[32]
  
get_cvar_string("amx_nextmap"SzNextMap31)
  new 
SzTimeLeft get_timeleft()
            
  new 
SzName[128// Get Player Name
  
get_user_name(idSzName127// Get Player Name
            
  
new SzAuthID[32// Get STEAMID
  
get_user_authid(idSzAuthID32// Get STEAMID
            
  
new SzScores = (get_user_frags(id) - get_user_deaths(id)) // Get Player Scores
            
  
new SzIP[16// Get Player IP
  
static SzCountry[32// Get Player Country
  
get_user_ip(idSzIP151// Get Player IP
  
geoip_country(SzIPSzCountry45// Get Player Country By Using The IP
            
  
new SzPingSzLoss // Get Player Ping
  
get_user_ping(idSzPingSzLoss// Get Player Ping
            
  
set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), 0.050.6001.01.00.10.2, -1)
  
ShowSyncHudMsg(idhudsync"%s ^n Nextmap: %s ^n Timeleft: %d:%02d ^n Time: %s ^n Player Name: %s ^n SteamID: %s ^n Score: %d ^n Country: %s"SzHostnameSzNextMapSzTimeLeft 60SzTimeLeft 60SzTimerSzNameSzAuthIDSzScoresSzCountry)
 }
 return 
PLUGIN_CONTINUE

vL, your code show the hud while the player is alive, i think.
fireattack is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-18-2010 , 09:03   Re: If player dead show him a hud message about the player info of he looking.
Reply With Quote #5

I tried, if change the code like yours the hud message is hide but even when a player dead hide too.

I have fixed only show the hud message for dead player.
Code:
public DHM(id)
{
	for (new id = 1; id <= SzMaxPlayers; id++)
	{
		if(is_user_alive(id))
		continue;
And now the problem is how can change the info of the dead player who spectating.
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others

Last edited by GarbageBox; 08-18-2010 at 09:18.
GarbageBox is offline
vL.
Senior Member
Join Date: Aug 2009
Location: Estonia
Old 08-18-2010 , 10:15   Re: If player dead show him a hud message about the player info of he looking.
Reply With Quote #6

fireattack do you know what
PHP Code:
if(!is_user_alive(id)) 
even mean, it means that the user is not alive

for the how to get user stuff, use targetid, theres also some threads about it.
vL. is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-19-2010 , 00:44   Re: If player dead show him a hud message about the player info of he looking.
Reply With Quote #7

Thanks. Fixed.
But now I get another problem, when a player who is not spectating someone, the hud message will show the player name to hostname, therefore, I want to hide the dead message if a dead player is not spectating someone.
possible?
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox 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 21:56.


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