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

Print chat for client and other


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-15-2013 , 09:20   Print chat for client and other
Reply With Quote #1

How to print message for client and for all players?

Example :

message for client :
PHP Code:
client_print idprint_chat"Your rights are removed." ); 
message for all other players :
PHP Code:
client_print 0print_chat"Client %s removed his rights."name ); 

Last edited by Debesėlis; 12-15-2013 at 09:35.
Debesėlis is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-15-2013 , 09:32   Re: Print chat for client and other
Reply With Quote #2

Exactly as you have in your examples except it is client_print instead of print_client
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-15-2013 , 09:38   Re: Print chat for client and other
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
Exactly as you have in your examples except it is client_print instead of print_client
Fixed I give you second example what i really need. Player which remove rights must see only 1 message. Now he see 2 messages (message for him and message for all players including him).
Debesėlis is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-15-2013 , 09:46   Re: Print chat for client and other
Reply With Quote #4

He is seeing 2 messages because you are showing him 2 messages. What is your question?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-15-2013 , 09:52   Re: Print chat for client and other
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
He is seeing 2 messages because you are showing him 2 messages. What is your question?
I Want to show this message for all players but not for client which removes rights. Is it possible?
Quote:
Originally Posted by Debesėlis View Post
PHP Code:
client_print 0print_chat"Client %s removed his rights."name ); 
Debesėlis is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-15-2013 , 10:13   Re: Print chat for client and other
Reply With Quote #6

Yes, you will need to loop through all players and send them the message individually.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-15-2013 , 10:43   Re: Print chat for client and other
Reply With Quote #7

Please can you give me example?
Debesėlis is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 12-15-2013 , 13:54   Re: Print chat for client and other
Reply With Quote #8

PHP Code:
new skip_player[33]

public 
handle_say_skip(id)
{
    
skip_player[id] = 1
}

// put this into your funtcion where you need this.
static aplayers[32], player_counti
get_players
(playersplayer_count)
for( 
0player_counta++ )
{
    
players[a]
    if( 
skip_player[i] == ) continue
    
// If skip_player[id] is 0 this part is running

function handle_say_skip is just an example
.Dare Devil. is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-16-2013 , 10:27   Re: Print chat for client and other
Reply With Quote #9

What i'm doing wrong? Don't understand why this doesn't work.
PHP Code:
new skip_player[33]

public 
UNACCESS id )
{
skip_player[id] = 1
client_print 
idprint_chat"Your rights are removed." ); 

 
// put this into your funtcion where you need this.
static aplayers[32], player_counti
get_players
(playersplayer_count)
for( 
0player_counta++ )
{
    
players[a]
    if( 
skip_player[i] == ) continue
    
client_print 0print_chat"Client %s removed his rights."name );  
}


Last edited by Debesėlis; 12-16-2013 at 10:28.
Debesėlis is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 12-16-2013 , 10:44   Re: Print chat for client and other
Reply With Quote #10

PHP Code:


public UNACCESS id )
{
client_print idprint_chat"Your rights are removed." ); 

static 
aplayers[32], player_count
get_players
(playersplayer_count)
for( 
0player_counta++ )
{
    if( 
id == players[a] ) continue
    
client_print players[a], print_chat"Client %s removed his rights."name );  
}


Last edited by .Dare Devil.; 12-16-2013 at 10:45.
.Dare Devil. 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 19:45.


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