I've an idea about how to make my chat more "Special Chat" in my server!
#1

I was thinking about making my chat even better, when you sending a message it will sendclientmessage to anyone with your NAME: Text... but you will see in your screen this: You: Text..

it returns 0 and ONLY ONE MESSAGE SENT and not two sendclientmessages I mean I can't do this right?
SendClientMessage(i,0xffffffaa, str); // Message Shows To Anyone but not you
SendClientMessage(playerid,0xffffffaa, istr); // Message Shows ONLY to you!
return 0;



Thank you for your help!
Reply
#2

Use SendClientMessageToAll.
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Use SendClientMessageToAll.
But it will send to anyone including myself, I want that one message will send only to me, and the other message will send to the others but not me


NAME: hi all <<< everyone will see it but not me

You: hi all << I will see it but no one else will see it
Reply
#4

PHP код:
for(new 0MAX_PLAYERSi++) {
    if(
IsPlayerConnected(i)) {
        if(
== playerid) {
            
SendClientMessage(i,0xffffffaaistr); // Message Shows ONLY to you!
        
} else {
            
SendClientMessage(i,0xffffffaastr); // Message Shows To Anyone but not you
        
}
    }

Excuse my indentation, wrote it in the reply box.

EDIT: My OCD kicked in.. had to fix the indentation... xD
Reply
#5

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
PHP код:
for(new 0MAX_PLAYERSi++) {
    if(
IsPlayerConnected(i)) {
        if(
== playerid) {
            
SendClientMessage(i,0xffffffaaistr); // Message Shows ONLY to you!
        
} else {
            
SendClientMessage(i,0xffffffaastr); // Message Shows To Anyone but not you
        
}
    }

Excuse my indentation, wrote it in the reply box.

EDIT: My OCD kicked in.. had to fix the indentation... xD
If I will put return 0 under these functions it will work? these 2 functions will work at the same time when I'll send one message in public OnPlayerText? I had no time to test it out sorry.
Reply
#6

Put a return 0 after it.
Also, test it, as I might or might not have made mistake with the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)