AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show message to dead people (https://forums.alliedmods.net/showthread.php?t=63258)

Mrrr 11-16-2007 04:36

Show message to dead people
 
Can you tell me how i can put hud message only for dead people ?
I mean only dead peoples in server can read the hud message.

It must appear in the upper right corner.

Thanks :up:

Alka 11-16-2007 06:54

Re: Show message to dead people
 
Code:

new Players[32], Num, Player;
get_players(Players, Num, "bch");
 
for(new i = 0 ; i < Num ; i++)
{
    Player = Players[i];
 
    //set_hudmessage(...);
    //show_hudmessage(Player, "wow....");
}


Arkshine 11-16-2007 10:58

Re: Show message to dead people
 
Just on a side note :

get_players(Players, Num, "bch");
"b" = Don't return alive players
"c" = Skip bots
"h" = Skip HLTV
See the full list here : http://www.amxmodx.org/funcwiki.php?go=func&id=174

Alka 11-16-2007 13:24

Re: Show message to dead people
 
Quote:

Originally Posted by arkshine (Post 553513)
Just on a side note :

get_players(Players, Num, "bch");
"b" = Don't return alive players
"c" = Skip bots
"h" = Skip HLTV
See the full list here : http://www.amxmodx.org/funcwiki.php?go=func&id=174

duh, so what's the problem ?! o.O or is for Mrrr ?

Arkshine 11-16-2007 13:35

Re: Show message to dead people
 
Because you give what he needs but whitout explanations...

Obviously it's for Mrrr. -_-'

Alka 11-16-2007 13:39

Re: Show message to dead people
 
oh, nvm :), thanks for added the full explication.

Lee 11-16-2007 13:45

Re: Show message to dead people
 
This method avoids get_players() - a native which many avoid since it reduces readability.

Code:
maxPlayers = get_maxplayers(); for(new i = 1; i <= maxPlayers; i++) {     if(is_user_alive(i))     {         continue;     }     set_hudmessage();     show_hudmessage(i, "You happen to be dead. :("); }

Alka 11-16-2007 14:21

Re: Show message to dead people
 
why to loop trough 32 slots ? o.O pointless... you can make also :
Code:

static Players[32], Num;
get_players(Players, Num);
 
for(new i = 0 ; i < Num ; i++)
{
    if(is_user_alive)
        continue;
 
    //blah blah...your dead.
}


ConnorMcLeod 11-16-2007 15:04

Re: Show message to dead people
 
Does the hudmessage have to be set in the loop ?

Alka 11-16-2007 15:07

Re: Show message to dead people
 
Nope.


All times are GMT -4. The time now is 10:26.

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