Raised This Month: $ Target: $400
 0% 

set,show hud message,won't be shown.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-29-2008 , 03:33   set,show hud message,won't be shown.
Reply With Quote #1

PHP Code:
public Event_DeathMsg() 

    new 
attacker read_data(1)
    new 
victim read_data(2)


if(
attacker != victim)
    {
        if (
get_user_team(victim) == 2)
        {
    for(new 
0iNum; ++i)
    {
    new 
id Players[i]
        new 
attacker_msg[32]
        new 
victim_msg[32]
    
get_user_name(attackerattacker_msg31)
    
get_user_name(victimvictim_msg31)
        
set_hudmessage(255010, -1.40.3010.011.50.010.01
        
show_hudmessage(id"%s's brains has been eaten by %s!"victim_msgattacker_msg)
        
client_cmdi"spk %s"music1[random_num(0,sizeof music1 1)]);
        } 
I wanna show message to all,but it won't show.



EDIT: Oh,I solved problem.
Must be this yes?
PHP Code:
if(attacker != victim
    { 
        if (
get_user_team(victim) == 2
        { 
    for(new 
0iNum; ++i
    { 
    new 
id Players[i
        
set_hudmessage(255010, -1.40.3010.011.50.010.01)  
        
show_hudmessage(id"%s's brains has been eaten by %s!"victimattacker
        
client_cmdi"spk %s"music1[random_num(0,sizeof music1 1)]); 
        } 
Or,no?
This is a good way?

Last edited by xbatista; 12-29-2008 at 03:42.
xbatista is offline
Send a message via Skype™ to xbatista
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-29-2008 , 03:57   Re: set,show hud message,won't be shown.
Reply With Quote #2

Quote:
Originally Posted by xbatista View Post
[php]
EDIT: Oh,I solved problem.
Must be this yes?
PHP Code:
if(attacker != victim
    { 
        if (
get_user_team(victim) == 2
        { 
    for(new 
0iNum; ++i
    { 
    new 
id Players[i
        
set_hudmessage(255010, -1.40.3010.011.50.010.01)  
        
show_hudmessage(id"%s's brains has been eaten by %s!"victimattacker
        
client_cmdi"spk %s"music1[random_num(0,sizeof music1 1)]); 
        } 
Or,no?
This is a good way?
Had you tested it?
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-29-2008 , 04:01   Re: set,show hud message,won't be shown.
Reply With Quote #3

YES.
xbatista is offline
Send a message via Skype™ to xbatista
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-29-2008 , 04:03   Re: set,show hud message,won't be shown.
Reply With Quote #4

Result?
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-29-2008 , 04:19   Re: set,show hud message,won't be shown.
Reply With Quote #5

Quote:
EDIT: Oh,I solved problem.
But maybe I'm doing something bad.
xbatista is offline
Send a message via Skype™ to xbatista
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-29-2008 , 04:24   Re: set,show hud message,won't be shown.
Reply With Quote #6

Clean code I think.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-29-2008 , 04:39   Re: set,show hud message,won't be shown.
Reply With Quote #7

Oops this is correct(I have a headache xD) :
PHP Code:
if(attacker != victim
    { 
        if (
get_user_team(victim) == 2
        { 
    for(new 
0iNum; ++i
    { 
    new 
id Players[i
        new 
attacker_msg[32
        new 
victim_msg[32
    
get_user_name(attackerattacker_msg31
    
get_user_name(victimvictim_msg31
        
set_hudmessage(255010, -1.40.3010.011.50.010.01)  
        
show_hudmessage(id"%s's brains has been eaten by %s!"victim_msgattacker_msg
        
client_cmdi"spk %s"music1[random_num(0,sizeof music1 1)]); 
        } 
xbatista is offline
Send a message via Skype™ to xbatista
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-29-2008 , 04:43   Re: set,show hud message,won't be shown.
Reply With Quote #8

Code:
I wanna show message to all,but it won't show.
Why you saying this?
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-29-2008 , 04:55   Re: set,show hud message,won't be shown.
Reply With Quote #9

PHP Code:
if(attacker != victim) {
    if (
get_user_team(victim) == 2) {
        new 
attacker_msg[32], victim_msg[32];

        
get_user_name(attackerattacker_msg31);
        
get_user_name(victimvictim_msg31);

        
set_hudmessage(255010, -1.40.3010.011.50.010.01);
        
show_hudmessage(0"%s's brains has been eaten by %s!"victim_msgattacker_msg);
        
client_cmd0"spk %s"music1[random_num(0,sizeof music1 1)]);
        
// no need to loop throught all players, hud can be shown just for all by id: 0
    
}

__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-29-2008 , 05:05   Re: set,show hud message,won't be shown.
Reply With Quote #10

WoW, thx xPaw.

Last edited by xbatista; 12-29-2008 at 05:10.
xbatista is offline
Send a message via Skype™ to xbatista
Reply


Thread Tools
Display Modes

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 09:19.


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